1 <html><body> 2 <style> 3 4 body, 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 15 body { 16 font-size: 13px; 17 padding: 1em; 18 } 19 20 h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23 } 24 25 h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28 } 29 30 h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34 } 35 36 pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39 } 40 41 pre { 42 margin-top: 0.5em; 43 } 44 45 h1, h2, h3, p { 46 font-family: Arial, sans serif; 47 } 48 49 h1, 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="cloudmonitoring_v2beta2.html">Cloud Monitoring API</a> . <a href="cloudmonitoring_v2beta2.timeseries.html">timeseries</a></h1> 76 <h2>Instance Methods</h2> 77 <p class="toc_element"> 78 <code><a href="#list">list(project, metric, youngest, count=None, timespan=None, aggregator=None, labels=None, window=None, pageToken=None, oldest=None)</a></code></p> 79 <p class="firstline">List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.</p> 80 <p class="toc_element"> 81 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 82 <p class="firstline">Retrieves the next page of results.</p> 83 <p class="toc_element"> 84 <code><a href="#write">write(project, body)</a></code></p> 85 <p class="firstline">Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.</p> 86 <h3>Method Details</h3> 87 <div class="method"> 88 <code class="details" id="list">list(project, metric, youngest, count=None, timespan=None, aggregator=None, labels=None, window=None, pageToken=None, oldest=None)</code> 89 <pre>List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. 90 91 Args: 92 project: string, The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name. (required) 93 metric: string, Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count. (required) 94 youngest: string, End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp. (required) 95 count: integer, Maximum number of data points per page, which is used for pagination of results. 96 timespan: string, Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: 97 - s: second 98 - m: minute 99 - h: hour 100 - d: day 101 - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. 102 103 If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]. 104 aggregator: string, The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE. 105 Allowed values 106 max - 107 mean - 108 min - 109 sum - 110 labels: string, A collection of labels for the matching time series, which are represented as: 111 - key==value: key equals the value 112 - key=~value: key regex matches the value 113 - key!=value: key does not equal the value 114 - key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify: 115 label=cloud.googleapis.com%2Flocation=~us-central1.* (repeated) 116 window: string, The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: 117 - m: minute 118 - h: hour 119 - d: day 120 - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. 121 pageToken: string, The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results. 122 oldest: string, Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest] 123 124 Returns: 125 An object of the form: 126 127 { # The response of cloudmonitoring.timeseries.list 128 "nextPageToken": "A String", # Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series. 129 "youngest": "A String", # The youngest timestamp of the interval of this query as an RFC 3339 string. 130 "kind": "cloudmonitoring#listTimeseriesResponse", # Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesResponse". 131 "oldest": "A String", # The oldest timestamp of the interval of this query as an RFC 3339 string. 132 "timeseries": [ # The returned time series. 133 { # The monitoring data is organized as metrics and stored as data points that are recorded over time. Each data point represents information like the CPU utilization of your virtual machine. A historical record of these data points is called a time series. 134 "timeseriesDesc": { # TimeseriesDescriptor identifies a single time series. # The descriptor of this time series. 135 "project": "A String", # The Developers Console project number to which this time series belongs. 136 "metric": "A String", # The name of the metric. 137 "labels": { # The label's name. 138 "a_key": "A String", # The label's name. 139 }, 140 }, 141 "points": [ # The data points of this time series. The points are listed in order of their end timestamp, from younger to older. 142 { # Point is a single point in a time series. It consists of a start time, an end time, and a value. 143 "end": "A String", # The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings. 144 "doubleValue": 3.14, # The value of this data point as a double-precision floating-point number. 145 "start": "A String", # The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings. 146 "boolValue": True or False, # The value of this data point. Either "true" or "false". 147 "distributionValue": { # Distribution data point value type. When writing distribution points, try to be consistent with the boundaries of your buckets. If you must modify the bucket boundaries, then do so by merging, partitioning, or appending rather than skewing them. # The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The values of these points can be used to create a histogram. 148 "buckets": [ # The finite buckets. 149 { # The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event in [U1, L2). 150 "count": "A String", # The number of events whose values are in the interval defined by this bucket. 151 "lowerBound": 3.14, # The lower bound of the value interval of this bucket (inclusive). 152 "upperBound": 3.14, # The upper bound of the value interval of this bucket (exclusive). 153 }, 154 ], 155 "underflowBucket": { # The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of the events that are less than its upper bound. # The underflow bucket. 156 "count": "A String", # The number of events whose values are in the interval defined by this bucket. 157 "upperBound": 3.14, # The upper bound of the value interval of this bucket (exclusive). 158 }, 159 "overflowBucket": { # The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the events that are no less than its lower bound. # The overflow bucket. 160 "count": "A String", # The number of events whose values are in the interval defined by this bucket. 161 "lowerBound": 3.14, # The lower bound of the value interval of this bucket (inclusive). 162 }, 163 }, 164 "stringValue": "A String", # The value of this data point in string format. 165 "int64Value": "A String", # The value of this data point as a 64-bit integer. 166 }, 167 ], 168 }, 169 ], 170 }</pre> 171 </div> 172 173 <div class="method"> 174 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 175 <pre>Retrieves the next page of results. 176 177 Args: 178 previous_request: The request for the previous page. (required) 179 previous_response: The response from the request for the previous page. (required) 180 181 Returns: 182 A request object that you can call 'execute()' on to request the next 183 page. Returns None if there are no more items in the collection. 184 </pre> 185 </div> 186 187 <div class="method"> 188 <code class="details" id="write">write(project, body)</code> 189 <pre>Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time. 190 191 Args: 192 project: string, The project ID. The value can be the numeric project ID or string-based project name. (required) 193 body: object, The request body. (required) 194 The object takes the form of: 195 196 { # The request of cloudmonitoring.timeseries.write 197 "timeseries": [ # Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete list of labels that required by the metric. 198 { # When writing time series, TimeseriesPoint should be used instead of Timeseries, to enforce single point for each time series in the timeseries.write request. 199 "timeseriesDesc": { # TimeseriesDescriptor identifies a single time series. # The descriptor of this time series. 200 "project": "A String", # The Developers Console project number to which this time series belongs. 201 "metric": "A String", # The name of the metric. 202 "labels": { # The label's name. 203 "a_key": "A String", # The label's name. 204 }, 205 }, 206 "point": { # Point is a single point in a time series. It consists of a start time, an end time, and a value. # The data point in this time series snapshot. 207 "end": "A String", # The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings. 208 "doubleValue": 3.14, # The value of this data point as a double-precision floating-point number. 209 "start": "A String", # The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings. 210 "boolValue": True or False, # The value of this data point. Either "true" or "false". 211 "distributionValue": { # Distribution data point value type. When writing distribution points, try to be consistent with the boundaries of your buckets. If you must modify the bucket boundaries, then do so by merging, partitioning, or appending rather than skewing them. # The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The values of these points can be used to create a histogram. 212 "buckets": [ # The finite buckets. 213 { # The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event in [U1, L2). 214 "count": "A String", # The number of events whose values are in the interval defined by this bucket. 215 "lowerBound": 3.14, # The lower bound of the value interval of this bucket (inclusive). 216 "upperBound": 3.14, # The upper bound of the value interval of this bucket (exclusive). 217 }, 218 ], 219 "underflowBucket": { # The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of the events that are less than its upper bound. # The underflow bucket. 220 "count": "A String", # The number of events whose values are in the interval defined by this bucket. 221 "upperBound": 3.14, # The upper bound of the value interval of this bucket (exclusive). 222 }, 223 "overflowBucket": { # The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the events that are no less than its lower bound. # The overflow bucket. 224 "count": "A String", # The number of events whose values are in the interval defined by this bucket. 225 "lowerBound": 3.14, # The lower bound of the value interval of this bucket (inclusive). 226 }, 227 }, 228 "stringValue": "A String", # The value of this data point in string format. 229 "int64Value": "A String", # The value of this data point as a 64-bit integer. 230 }, 231 }, 232 ], 233 "commonLabels": { # The label's name. 234 "a_key": "A String", # The label's name. 235 }, 236 } 237 238 239 Returns: 240 An object of the form: 241 242 { # The response of cloudmonitoring.timeseries.write 243 "kind": "cloudmonitoring#writeTimeseriesResponse", # Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#writeTimeseriesResponse". 244 }</pre> 245 </div> 246 247 </body></html>