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, pageToken=None, x__xgafv=None, pageSize=None, filter=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". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. 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 "launchStage": "A String", # Optional. The launch stage of the metric definition. 115 "name": "A String", # The resource name of the metric descriptor. 116 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 117 # "custom.googleapis.com/invoice/paid/amount" 118 # "external.googleapis.com/prometheus/up" 119 # "appengine.googleapis.com/http/server/response_latencies" 120 "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) 121 # bit bit 122 # By byte 123 # s second 124 # min minute 125 # h hour 126 # d dayPrefixes (PREFIX) 127 # k kilo (10**3) 128 # M mega (10**6) 129 # G giga (10**9) 130 # T tera (10**12) 131 # P peta (10**15) 132 # E exa (10**18) 133 # Z zetta (10**21) 134 # Y yotta (10**24) 135 # m milli (10**-3) 136 # u micro (10**-6) 137 # n nano (10**-9) 138 # p pico (10**-12) 139 # f femto (10**-15) 140 # a atto (10**-18) 141 # z zepto (10**-21) 142 # y yocto (10**-24) 143 # Ki kibi (2**10) 144 # Mi mebi (2**20) 145 # Gi gibi (2**30) 146 # Ti tebi (2**40)GrammarThe grammar also includes these connectors: 147 # / division (as an infix operator, e.g. 1/s). 148 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 149 # Expression = Component { "." Component } { "/" Component } ; 150 # 151 # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] 152 # | Annotation 153 # | "1" 154 # ; 155 # 156 # Annotation = "{" NAME "}" ; 157 # Notes: 158 # 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. 159 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 160 # 1 represents dimensionless value 1, such as in 1/s. 161 # % represents dimensionless value 1/100, and annotates values giving a percentage. 162 "metadata": { # Additional annotations that can be used to guide the usage of a metric. # Optional. Metadata which can be used to guide usage of the metric. 163 "samplePeriod": "A String", # The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. 164 "ingestDelay": "A String", # The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. 165 "launchStage": "A String", # Deprecated. Please use the MetricDescriptor.launch_stage instead. The launch stage of the metric definition. 166 }, 167 } 168 169 x__xgafv: string, V1 error format. 170 Allowed values 171 1 - v1 error format 172 2 - v2 error format 173 174Returns: 175 An object of the form: 176 177 { # 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. 178 "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". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. 179 "description": "A String", # A detailed description of the metric, which can be used in documentation. 180 "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. 181 "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. 182 "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. 183 { # A description of a label. 184 "valueType": "A String", # The type of data that can be assigned to the label. 185 "description": "A String", # A human-readable description for the label. 186 "key": "A String", # The label key. 187 }, 188 ], 189 "launchStage": "A String", # Optional. The launch stage of the metric definition. 190 "name": "A String", # The resource name of the metric descriptor. 191 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 192 # "custom.googleapis.com/invoice/paid/amount" 193 # "external.googleapis.com/prometheus/up" 194 # "appengine.googleapis.com/http/server/response_latencies" 195 "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) 196 # bit bit 197 # By byte 198 # s second 199 # min minute 200 # h hour 201 # d dayPrefixes (PREFIX) 202 # k kilo (10**3) 203 # M mega (10**6) 204 # G giga (10**9) 205 # T tera (10**12) 206 # P peta (10**15) 207 # E exa (10**18) 208 # Z zetta (10**21) 209 # Y yotta (10**24) 210 # m milli (10**-3) 211 # u micro (10**-6) 212 # n nano (10**-9) 213 # p pico (10**-12) 214 # f femto (10**-15) 215 # a atto (10**-18) 216 # z zepto (10**-21) 217 # y yocto (10**-24) 218 # Ki kibi (2**10) 219 # Mi mebi (2**20) 220 # Gi gibi (2**30) 221 # Ti tebi (2**40)GrammarThe grammar also includes these connectors: 222 # / division (as an infix operator, e.g. 1/s). 223 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 224 # Expression = Component { "." Component } { "/" Component } ; 225 # 226 # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] 227 # | Annotation 228 # | "1" 229 # ; 230 # 231 # Annotation = "{" NAME "}" ; 232 # Notes: 233 # 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. 234 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 235 # 1 represents dimensionless value 1, such as in 1/s. 236 # % represents dimensionless value 1/100, and annotates values giving a percentage. 237 "metadata": { # Additional annotations that can be used to guide the usage of a metric. # Optional. Metadata which can be used to guide usage of the metric. 238 "samplePeriod": "A String", # The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. 239 "ingestDelay": "A String", # The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. 240 "launchStage": "A String", # Deprecated. Please use the MetricDescriptor.launch_stage instead. The launch stage of the metric definition. 241 }, 242 }</pre> 243</div> 244 245<div class="method"> 246 <code class="details" id="delete">delete(name, x__xgafv=None)</code> 247 <pre>Deletes a metric descriptor. Only user-created custom metrics can be deleted. 248 249Args: 250 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) 251 x__xgafv: string, V1 error format. 252 Allowed values 253 1 - v1 error format 254 2 - v2 error format 255 256Returns: 257 An object of the form: 258 259 { # 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: 260 # service Foo { 261 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 262 # } 263 # The JSON representation for Empty is empty JSON object {}. 264 }</pre> 265</div> 266 267<div class="method"> 268 <code class="details" id="get">get(name, x__xgafv=None)</code> 269 <pre>Gets a single metric descriptor. This method does not require a Stackdriver account. 270 271Args: 272 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) 273 x__xgafv: string, V1 error format. 274 Allowed values 275 1 - v1 error format 276 2 - v2 error format 277 278Returns: 279 An object of the form: 280 281 { # 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. 282 "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". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. 283 "description": "A String", # A detailed description of the metric, which can be used in documentation. 284 "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. 285 "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. 286 "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. 287 { # A description of a label. 288 "valueType": "A String", # The type of data that can be assigned to the label. 289 "description": "A String", # A human-readable description for the label. 290 "key": "A String", # The label key. 291 }, 292 ], 293 "launchStage": "A String", # Optional. The launch stage of the metric definition. 294 "name": "A String", # The resource name of the metric descriptor. 295 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 296 # "custom.googleapis.com/invoice/paid/amount" 297 # "external.googleapis.com/prometheus/up" 298 # "appengine.googleapis.com/http/server/response_latencies" 299 "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) 300 # bit bit 301 # By byte 302 # s second 303 # min minute 304 # h hour 305 # d dayPrefixes (PREFIX) 306 # k kilo (10**3) 307 # M mega (10**6) 308 # G giga (10**9) 309 # T tera (10**12) 310 # P peta (10**15) 311 # E exa (10**18) 312 # Z zetta (10**21) 313 # Y yotta (10**24) 314 # m milli (10**-3) 315 # u micro (10**-6) 316 # n nano (10**-9) 317 # p pico (10**-12) 318 # f femto (10**-15) 319 # a atto (10**-18) 320 # z zepto (10**-21) 321 # y yocto (10**-24) 322 # Ki kibi (2**10) 323 # Mi mebi (2**20) 324 # Gi gibi (2**30) 325 # Ti tebi (2**40)GrammarThe grammar also includes these connectors: 326 # / division (as an infix operator, e.g. 1/s). 327 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 328 # Expression = Component { "." Component } { "/" Component } ; 329 # 330 # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] 331 # | Annotation 332 # | "1" 333 # ; 334 # 335 # Annotation = "{" NAME "}" ; 336 # Notes: 337 # 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. 338 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 339 # 1 represents dimensionless value 1, such as in 1/s. 340 # % represents dimensionless value 1/100, and annotates values giving a percentage. 341 "metadata": { # Additional annotations that can be used to guide the usage of a metric. # Optional. Metadata which can be used to guide usage of the metric. 342 "samplePeriod": "A String", # The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. 343 "ingestDelay": "A String", # The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. 344 "launchStage": "A String", # Deprecated. Please use the MetricDescriptor.launch_stage instead. The launch stage of the metric definition. 345 }, 346 }</pre> 347</div> 348 349<div class="method"> 350 <code class="details" id="list">list(name, pageToken=None, x__xgafv=None, pageSize=None, filter=None)</code> 351 <pre>Lists metric descriptors that match a filter. This method does not require a Stackdriver account. 352 353Args: 354 name: string, The project on which to execute the request. The format is "projects/{project_id_or_number}". (required) 355 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. 356 x__xgafv: string, V1 error format. 357 Allowed values 358 1 - v1 error format 359 2 - v2 error format 360 pageSize: integer, A positive number that is the maximum number of results to return. 361 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: 362metric.type = starts_with("custom.googleapis.com/") 363 364 365Returns: 366 An object of the form: 367 368 { # The ListMetricDescriptors response. 369 "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. 370 "metricDescriptors": [ # The metric descriptors that are available to the project and that match the value of filter, if present. 371 { # 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. 372 "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". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. 373 "description": "A String", # A detailed description of the metric, which can be used in documentation. 374 "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. 375 "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. 376 "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. 377 { # A description of a label. 378 "valueType": "A String", # The type of data that can be assigned to the label. 379 "description": "A String", # A human-readable description for the label. 380 "key": "A String", # The label key. 381 }, 382 ], 383 "launchStage": "A String", # Optional. The launch stage of the metric definition. 384 "name": "A String", # The resource name of the metric descriptor. 385 "type": "A String", # The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: 386 # "custom.googleapis.com/invoice/paid/amount" 387 # "external.googleapis.com/prometheus/up" 388 # "appengine.googleapis.com/http/server/response_latencies" 389 "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) 390 # bit bit 391 # By byte 392 # s second 393 # min minute 394 # h hour 395 # d dayPrefixes (PREFIX) 396 # k kilo (10**3) 397 # M mega (10**6) 398 # G giga (10**9) 399 # T tera (10**12) 400 # P peta (10**15) 401 # E exa (10**18) 402 # Z zetta (10**21) 403 # Y yotta (10**24) 404 # m milli (10**-3) 405 # u micro (10**-6) 406 # n nano (10**-9) 407 # p pico (10**-12) 408 # f femto (10**-15) 409 # a atto (10**-18) 410 # z zepto (10**-21) 411 # y yocto (10**-24) 412 # Ki kibi (2**10) 413 # Mi mebi (2**20) 414 # Gi gibi (2**30) 415 # Ti tebi (2**40)GrammarThe grammar also includes these connectors: 416 # / division (as an infix operator, e.g. 1/s). 417 # . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: 418 # Expression = Component { "." Component } { "/" Component } ; 419 # 420 # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] 421 # | Annotation 422 # | "1" 423 # ; 424 # 425 # Annotation = "{" NAME "}" ; 426 # Notes: 427 # 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. 428 # NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. 429 # 1 represents dimensionless value 1, such as in 1/s. 430 # % represents dimensionless value 1/100, and annotates values giving a percentage. 431 "metadata": { # Additional annotations that can be used to guide the usage of a metric. # Optional. Metadata which can be used to guide usage of the metric. 432 "samplePeriod": "A String", # The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. 433 "ingestDelay": "A String", # The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. 434 "launchStage": "A String", # Deprecated. Please use the MetricDescriptor.launch_stage instead. The launch stage of the metric definition. 435 }, 436 }, 437 ], 438 }</pre> 439</div> 440 441<div class="method"> 442 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 443 <pre>Retrieves the next page of results. 444 445Args: 446 previous_request: The request for the previous page. (required) 447 previous_response: The response from the request for the previous page. (required) 448 449Returns: 450 A request object that you can call 'execute()' on to request the next 451 page. Returns None if there are no more items in the collection. 452 </pre> 453</div> 454 455</body></html>