1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="monitoring_v3.html">Stackdriver Monitoring API</a> . <a href="monitoring_v3.projects.html">projects</a> . <a href="monitoring_v3.projects.metricDescriptors.html">metricDescriptors</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#create">create(name, body, x__xgafv=None)</a></code></p> 79<p class="firstline">Creates a new metric descriptor. User-created metric descriptors define custom metrics.</p> 80<p class="toc_element"> 81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> 82<p class="firstline">Deletes a metric descriptor. Only user-created custom metrics can be deleted.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(name, x__xgafv=None)</a></code></p> 85<p class="firstline">Gets a single metric descriptor. This method does not require a Stackdriver account.</p> 86<p class="toc_element"> 87 <code><a href="#list">list(name, pageSize=None, filter=None, pageToken=None, x__xgafv=None)</a></code></p> 88<p class="firstline">Lists metric descriptors that match a filter. This method does not require a Stackdriver account.</p> 89<p class="toc_element"> 90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 91<p class="firstline">Retrieves the next page of results.</p> 92<h3>Method Details</h3> 93<div class="method"> 94 <code class="details" id="create">create(name, body, x__xgafv=None)</code> 95 <pre>Creates a new metric descriptor. User-created metric descriptors define custom metrics. 96 97Args: 98 name: string, The project on which to execute the request. The format is "projects/{project_id_or_number}". (required) 99 body: object, The request body. (required) 100 The object takes the form of: 101 102{ # Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. 103 "displayName": "A String", # A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". 104 "description": "A String", # A detailed description of the metric, which can be used in documentation. 105 "metricKind": "A String", # Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported. 106 "valueType": "A String", # Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported. 107 "labels": [ # The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. 108 { # A description of a label. 109 "valueType": "A String", # The type of data that can be assigned to the label. 110 "description": "A String", # A human-readable description for the label. 111 "key": "A String", # The label key. 112 }, 113 ], 114 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 115 # "custom.googleapis.com/invoice/paid/amount" 116 # "appengine.googleapis.com/http/server/response_latencies" 117 "unit": "A String", # The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) 118 # bit bit 119 # By byte 120 # s second 121 # min minute 122 # h hour 123 # d dayPrefixes (PREFIX) 124 # k kilo (10**3) 125 # M mega (10**6) 126 # G giga (10**9) 127 # T tera (10**12) 128 # P peta (10**15) 129 # E exa (10**18) 130 # Z zetta (10**21) 131 # Y yotta (10**24) 132 # m milli (10**-3) 133 # u micro (10**-6) 134 # n nano (10**-9) 135 # p pico (10**-12) 136 # f femto (10**-15) 137 # a atto (10**-18) 138 # z zepto (10**-21) 139 # y yocto (10**-24) 140 # Ki kibi (2**10) 141 # Mi mebi (2**20) 142 # Gi gibi (2**30) 143 # Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors: 144 # / division (as an infix operator, e.g. 1/s). 145 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 146 # Expression = Component { "." Component } { "/" Component } ; 147 # 148 # Component = [ PREFIX ] UNIT [ Annotation ] 149 # | Annotation 150 # | "1" 151 # ; 152 # 153 # Annotation = "{" NAME "}" ; 154 # Notes: 155 # Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. 156 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 157 "name": "A String", # The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id: 158 # "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" 159 } 160 161 x__xgafv: string, V1 error format. 162 Allowed values 163 1 - v1 error format 164 2 - v2 error format 165 166Returns: 167 An object of the form: 168 169 { # Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. 170 "displayName": "A String", # A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". 171 "description": "A String", # A detailed description of the metric, which can be used in documentation. 172 "metricKind": "A String", # Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported. 173 "valueType": "A String", # Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported. 174 "labels": [ # The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. 175 { # A description of a label. 176 "valueType": "A String", # The type of data that can be assigned to the label. 177 "description": "A String", # A human-readable description for the label. 178 "key": "A String", # The label key. 179 }, 180 ], 181 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 182 # "custom.googleapis.com/invoice/paid/amount" 183 # "appengine.googleapis.com/http/server/response_latencies" 184 "unit": "A String", # The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) 185 # bit bit 186 # By byte 187 # s second 188 # min minute 189 # h hour 190 # d dayPrefixes (PREFIX) 191 # k kilo (10**3) 192 # M mega (10**6) 193 # G giga (10**9) 194 # T tera (10**12) 195 # P peta (10**15) 196 # E exa (10**18) 197 # Z zetta (10**21) 198 # Y yotta (10**24) 199 # m milli (10**-3) 200 # u micro (10**-6) 201 # n nano (10**-9) 202 # p pico (10**-12) 203 # f femto (10**-15) 204 # a atto (10**-18) 205 # z zepto (10**-21) 206 # y yocto (10**-24) 207 # Ki kibi (2**10) 208 # Mi mebi (2**20) 209 # Gi gibi (2**30) 210 # Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors: 211 # / division (as an infix operator, e.g. 1/s). 212 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 213 # Expression = Component { "." Component } { "/" Component } ; 214 # 215 # Component = [ PREFIX ] UNIT [ Annotation ] 216 # | Annotation 217 # | "1" 218 # ; 219 # 220 # Annotation = "{" NAME "}" ; 221 # Notes: 222 # Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. 223 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 224 "name": "A String", # The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id: 225 # "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" 226 }</pre> 227</div> 228 229<div class="method"> 230 <code class="details" id="delete">delete(name, x__xgafv=None)</code> 231 <pre>Deletes a metric descriptor. Only user-created custom metrics can be deleted. 232 233Args: 234 name: string, The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example of {metric_id} is: "custom.googleapis.com/my_test_metric". (required) 235 x__xgafv: string, V1 error format. 236 Allowed values 237 1 - v1 error format 238 2 - v2 error format 239 240Returns: 241 An object of the form: 242 243 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: 244 # service Foo { 245 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 246 # } 247 # The JSON representation for Empty is empty JSON object {}. 248 }</pre> 249</div> 250 251<div class="method"> 252 <code class="details" id="get">get(name, x__xgafv=None)</code> 253 <pre>Gets a single metric descriptor. This method does not require a Stackdriver account. 254 255Args: 256 name: string, The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example value of {metric_id} is "compute.googleapis.com/instance/disk/read_bytes_count". (required) 257 x__xgafv: string, V1 error format. 258 Allowed values 259 1 - v1 error format 260 2 - v2 error format 261 262Returns: 263 An object of the form: 264 265 { # Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. 266 "displayName": "A String", # A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". 267 "description": "A String", # A detailed description of the metric, which can be used in documentation. 268 "metricKind": "A String", # Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported. 269 "valueType": "A String", # Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported. 270 "labels": [ # The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. 271 { # A description of a label. 272 "valueType": "A String", # The type of data that can be assigned to the label. 273 "description": "A String", # A human-readable description for the label. 274 "key": "A String", # The label key. 275 }, 276 ], 277 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 278 # "custom.googleapis.com/invoice/paid/amount" 279 # "appengine.googleapis.com/http/server/response_latencies" 280 "unit": "A String", # The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) 281 # bit bit 282 # By byte 283 # s second 284 # min minute 285 # h hour 286 # d dayPrefixes (PREFIX) 287 # k kilo (10**3) 288 # M mega (10**6) 289 # G giga (10**9) 290 # T tera (10**12) 291 # P peta (10**15) 292 # E exa (10**18) 293 # Z zetta (10**21) 294 # Y yotta (10**24) 295 # m milli (10**-3) 296 # u micro (10**-6) 297 # n nano (10**-9) 298 # p pico (10**-12) 299 # f femto (10**-15) 300 # a atto (10**-18) 301 # z zepto (10**-21) 302 # y yocto (10**-24) 303 # Ki kibi (2**10) 304 # Mi mebi (2**20) 305 # Gi gibi (2**30) 306 # Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors: 307 # / division (as an infix operator, e.g. 1/s). 308 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 309 # Expression = Component { "." Component } { "/" Component } ; 310 # 311 # Component = [ PREFIX ] UNIT [ Annotation ] 312 # | Annotation 313 # | "1" 314 # ; 315 # 316 # Annotation = "{" NAME "}" ; 317 # Notes: 318 # Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. 319 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 320 "name": "A String", # The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id: 321 # "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" 322 }</pre> 323</div> 324 325<div class="method"> 326 <code class="details" id="list">list(name, pageSize=None, filter=None, pageToken=None, x__xgafv=None)</code> 327 <pre>Lists metric descriptors that match a filter. This method does not require a Stackdriver account. 328 329Args: 330 name: string, The project on which to execute the request. The format is "projects/{project_id_or_number}". (required) 331 pageSize: integer, A positive number that is the maximum number of results to return. 332 filter: string, If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics: 333metric.type = starts_with("custom.googleapis.com/") 334 335 pageToken: string, If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. 336 x__xgafv: string, V1 error format. 337 Allowed values 338 1 - v1 error format 339 2 - v2 error format 340 341Returns: 342 An object of the form: 343 344 { # The ListMetricDescriptors response. 345 "nextPageToken": "A String", # If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. 346 "metricDescriptors": [ # The metric descriptors that are available to the project and that match the value of filter, if present. 347 { # Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable. 348 "displayName": "A String", # A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". 349 "description": "A String", # A detailed description of the metric, which can be used in documentation. 350 "metricKind": "A String", # Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported. 351 "valueType": "A String", # Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported. 352 "labels": [ # The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed. 353 { # A description of a label. 354 "valueType": "A String", # The type of data that can be assigned to the label. 355 "description": "A String", # A human-readable description for the label. 356 "key": "A String", # The label key. 357 }, 358 ], 359 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined custom metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 360 # "custom.googleapis.com/invoice/paid/amount" 361 # "appengine.googleapis.com/http/server/response_latencies" 362 "unit": "A String", # The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) 363 # bit bit 364 # By byte 365 # s second 366 # min minute 367 # h hour 368 # d dayPrefixes (PREFIX) 369 # k kilo (10**3) 370 # M mega (10**6) 371 # G giga (10**9) 372 # T tera (10**12) 373 # P peta (10**15) 374 # E exa (10**18) 375 # Z zetta (10**21) 376 # Y yotta (10**24) 377 # m milli (10**-3) 378 # u micro (10**-6) 379 # n nano (10**-9) 380 # p pico (10**-12) 381 # f femto (10**-15) 382 # a atto (10**-18) 383 # z zepto (10**-21) 384 # y yocto (10**-24) 385 # Ki kibi (2**10) 386 # Mi mebi (2**20) 387 # Gi gibi (2**30) 388 # Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/s.The grammar also includes these connectors: 389 # / division (as an infix operator, e.g. 1/s). 390 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 391 # Expression = Component { "." Component } { "/" Component } ; 392 # 393 # Component = [ PREFIX ] UNIT [ Annotation ] 394 # | Annotation 395 # | "1" 396 # ; 397 # 398 # Annotation = "{" NAME "}" ; 399 # Notes: 400 # Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. 401 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 402 "name": "A String", # The resource name of the metric descriptor. Depending on the implementation, the name typically includes: (1) the parent resource name that defines the scope of the metric type or of its data; and (2) the metric's URL-encoded type, which also appears in the type field of this descriptor. For example, following is the resource name of a custom metric within the GCP project my-project-id: 403 # "projects/my-project-id/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" 404 }, 405 ], 406 }</pre> 407</div> 408 409<div class="method"> 410 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 411 <pre>Retrieves the next page of results. 412 413Args: 414 previous_request: The request for the previous page. (required) 415 previous_response: The response from the request for the previous page. (required) 416 417Returns: 418 A request object that you can call 'execute()' on to request the next 419 page. Returns None if there are no more items in the collection. 420 </pre> 421</div> 422 423</body></html>