| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 1 library googleapis_beta.cloudmonitoring.v2beta2; | 3 library googleapis_beta.cloudmonitoring.v2beta2; |
| 2 | 4 |
| 3 import "dart:core" as core; | 5 import 'dart:core' as core; |
| 4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
| 5 import "dart:async" as async; | 7 import 'dart:async' as async; |
| 6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
| 7 | 9 |
| 8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
| 9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; | |
| 11 import '../common/common.dart' as common; | |
| 12 | 13 |
| 13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError; |
| 16 |
| 17 const core.String USER_AGENT = 'dart-api-client cloudmonitoring/v2beta2'; |
| 15 | 18 |
| 16 /** API for accessing Google Cloud and API monitoring data. */ | 19 /** API for accessing Google Cloud and API monitoring data. */ |
| 17 class CloudmonitoringApi { | 20 class CloudmonitoringApi { |
| 18 /** | 21 /** |
| 19 * View and write monitoring data for all of your Google and third-party Cloud | 22 * View and write monitoring data for all of your Google and third-party Cloud |
| 20 * and API projects | 23 * and API projects |
| 21 */ | 24 */ |
| 22 static const MonitoringScope = "https://www.googleapis.com/auth/monitoring"; | 25 static const MonitoringScope = "https://www.googleapis.com/auth/monitoring"; |
| 23 | 26 |
| 24 | 27 |
| 25 final common_internal.ApiRequester _requester; | 28 final commons.ApiRequester _requester; |
| 26 | 29 |
| 27 MetricDescriptorsResourceApi get metricDescriptors => new MetricDescriptorsRes
ourceApi(_requester); | 30 MetricDescriptorsResourceApi get metricDescriptors => new MetricDescriptorsRes
ourceApi(_requester); |
| 28 TimeseriesResourceApi get timeseries => new TimeseriesResourceApi(_requester); | 31 TimeseriesResourceApi get timeseries => new TimeseriesResourceApi(_requester); |
| 29 TimeseriesDescriptorsResourceApi get timeseriesDescriptors => new TimeseriesDe
scriptorsResourceApi(_requester); | 32 TimeseriesDescriptorsResourceApi get timeseriesDescriptors => new TimeseriesDe
scriptorsResourceApi(_requester); |
| 30 | 33 |
| 31 CloudmonitoringApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "cloudmonitoring/v2beta2/projects/"}) : | 34 CloudmonitoringApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "cloudmonitoring/v2beta2/projects/"}) : |
| 32 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 35 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 33 } | 36 } |
| 34 | 37 |
| 35 | 38 |
| 36 /** Not documented yet. */ | |
| 37 class MetricDescriptorsResourceApi { | 39 class MetricDescriptorsResourceApi { |
| 38 final common_internal.ApiRequester _requester; | 40 final commons.ApiRequester _requester; |
| 39 | 41 |
| 40 MetricDescriptorsResourceApi(common_internal.ApiRequester client) : | 42 MetricDescriptorsResourceApi(commons.ApiRequester client) : |
| 41 _requester = client; | 43 _requester = client; |
| 42 | 44 |
| 43 /** | 45 /** |
| 44 * Create a new metric. | 46 * Create a new metric. |
| 45 * | 47 * |
| 46 * [request] - The metadata request object. | 48 * [request] - The metadata request object. |
| 47 * | 49 * |
| 48 * Request parameters: | 50 * Request parameters: |
| 49 * | 51 * |
| 50 * [project] - The project id. The value can be the numeric project ID or | 52 * [project] - The project id. The value can be the numeric project ID or |
| 51 * string-based project name. | 53 * string-based project name. |
| 52 * | 54 * |
| 53 * Completes with a [MetricDescriptor]. | 55 * Completes with a [MetricDescriptor]. |
| 54 * | 56 * |
| 55 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 56 * error. | 58 * error. |
| 57 * | 59 * |
| 58 * If the used [http.Client] completes with an error when making a REST call, | 60 * If the used [http.Client] completes with an error when making a REST call, |
| 59 * this method will complete with the same error. | 61 * this method will complete with the same error. |
| 60 */ | 62 */ |
| 61 async.Future<MetricDescriptor> create(MetricDescriptor request, core.String pr
oject) { | 63 async.Future<MetricDescriptor> create(MetricDescriptor request, core.String pr
oject) { |
| 62 var _url = null; | 64 var _url = null; |
| 63 var _queryParams = new core.Map(); | 65 var _queryParams = new core.Map(); |
| 64 var _uploadMedia = null; | 66 var _uploadMedia = null; |
| 65 var _uploadOptions = null; | 67 var _uploadOptions = null; |
| 66 var _downloadOptions = common.DownloadOptions.Metadata; | 68 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 67 var _body = null; | 69 var _body = null; |
| 68 | 70 |
| 69 if (request != null) { | 71 if (request != null) { |
| 70 _body = convert.JSON.encode((request).toJson()); | 72 _body = convert.JSON.encode((request).toJson()); |
| 71 } | 73 } |
| 72 if (project == null) { | 74 if (project == null) { |
| 73 throw new core.ArgumentError("Parameter project is required."); | 75 throw new core.ArgumentError("Parameter project is required."); |
| 74 } | 76 } |
| 75 | 77 |
| 76 | 78 |
| 77 _url = common_internal.Escaper.ecapeVariable('$project') + '/metricDescripto
rs'; | 79 _url = commons.Escaper.ecapeVariable('$project') + '/metricDescriptors'; |
| 78 | 80 |
| 79 var _response = _requester.request(_url, | 81 var _response = _requester.request(_url, |
| 80 "POST", | 82 "POST", |
| 81 body: _body, | 83 body: _body, |
| 82 queryParams: _queryParams, | 84 queryParams: _queryParams, |
| 83 uploadOptions: _uploadOptions, | 85 uploadOptions: _uploadOptions, |
| 84 uploadMedia: _uploadMedia, | 86 uploadMedia: _uploadMedia, |
| 85 downloadOptions: _downloadOptions); | 87 downloadOptions: _downloadOptions); |
| 86 return _response.then((data) => new MetricDescriptor.fromJson(data)); | 88 return _response.then((data) => new MetricDescriptor.fromJson(data)); |
| 87 } | 89 } |
| 88 | 90 |
| 89 /** | 91 /** |
| 90 * Delete an existing metric. | 92 * Delete an existing metric. |
| 91 * | 93 * |
| 92 * Request parameters: | 94 * Request parameters: |
| 93 * | 95 * |
| 94 * [project] - The project ID to which the metric belongs. | 96 * [project] - The project ID to which the metric belongs. |
| 95 * | 97 * |
| 96 * [metric] - Name of the metric. | 98 * [metric] - Name of the metric. |
| 97 * | 99 * |
| 98 * Completes with a [DeleteMetricDescriptorResponse]. | 100 * Completes with a [DeleteMetricDescriptorResponse]. |
| 99 * | 101 * |
| 100 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 102 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 101 * error. | 103 * error. |
| 102 * | 104 * |
| 103 * If the used [http.Client] completes with an error when making a REST call, | 105 * If the used [http.Client] completes with an error when making a REST call, |
| 104 * this method will complete with the same error. | 106 * this method will complete with the same error. |
| 105 */ | 107 */ |
| 106 async.Future<DeleteMetricDescriptorResponse> delete(core.String project, core.
String metric) { | 108 async.Future<DeleteMetricDescriptorResponse> delete(core.String project, core.
String metric) { |
| 107 var _url = null; | 109 var _url = null; |
| 108 var _queryParams = new core.Map(); | 110 var _queryParams = new core.Map(); |
| 109 var _uploadMedia = null; | 111 var _uploadMedia = null; |
| 110 var _uploadOptions = null; | 112 var _uploadOptions = null; |
| 111 var _downloadOptions = common.DownloadOptions.Metadata; | 113 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 112 var _body = null; | 114 var _body = null; |
| 113 | 115 |
| 114 if (project == null) { | 116 if (project == null) { |
| 115 throw new core.ArgumentError("Parameter project is required."); | 117 throw new core.ArgumentError("Parameter project is required."); |
| 116 } | 118 } |
| 117 if (metric == null) { | 119 if (metric == null) { |
| 118 throw new core.ArgumentError("Parameter metric is required."); | 120 throw new core.ArgumentError("Parameter metric is required."); |
| 119 } | 121 } |
| 120 | 122 |
| 121 | 123 |
| 122 _url = common_internal.Escaper.ecapeVariable('$project') + '/metricDescripto
rs/' + common_internal.Escaper.ecapeVariable('$metric'); | 124 _url = commons.Escaper.ecapeVariable('$project') + '/metricDescriptors/' + c
ommons.Escaper.ecapeVariable('$metric'); |
| 123 | 125 |
| 124 var _response = _requester.request(_url, | 126 var _response = _requester.request(_url, |
| 125 "DELETE", | 127 "DELETE", |
| 126 body: _body, | 128 body: _body, |
| 127 queryParams: _queryParams, | 129 queryParams: _queryParams, |
| 128 uploadOptions: _uploadOptions, | 130 uploadOptions: _uploadOptions, |
| 129 uploadMedia: _uploadMedia, | 131 uploadMedia: _uploadMedia, |
| 130 downloadOptions: _downloadOptions); | 132 downloadOptions: _downloadOptions); |
| 131 return _response.then((data) => new DeleteMetricDescriptorResponse.fromJson(
data)); | 133 return _response.then((data) => new DeleteMetricDescriptorResponse.fromJson(
data)); |
| 132 } | 134 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 154 * the next page of results. | 156 * the next page of results. |
| 155 * | 157 * |
| 156 * [query] - The query used to search against existing metrics. Separate | 158 * [query] - The query used to search against existing metrics. Separate |
| 157 * keywords with a space; the service joins all keywords with AND, meaning | 159 * keywords with a space; the service joins all keywords with AND, meaning |
| 158 * that all keywords must match for a metric to be returned. If this field is | 160 * that all keywords must match for a metric to be returned. If this field is |
| 159 * omitted, all metrics are returned. If an empty string is passed with this | 161 * omitted, all metrics are returned. If an empty string is passed with this |
| 160 * field, no metrics are returned. | 162 * field, no metrics are returned. |
| 161 * | 163 * |
| 162 * Completes with a [ListMetricDescriptorsResponse]. | 164 * Completes with a [ListMetricDescriptorsResponse]. |
| 163 * | 165 * |
| 164 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 166 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 165 * error. | 167 * error. |
| 166 * | 168 * |
| 167 * If the used [http.Client] completes with an error when making a REST call, | 169 * If the used [http.Client] completes with an error when making a REST call, |
| 168 * this method will complete with the same error. | 170 * this method will complete with the same error. |
| 169 */ | 171 */ |
| 170 async.Future<ListMetricDescriptorsResponse> list(ListMetricDescriptorsRequest
request, core.String project, {core.int count, core.String pageToken, core.Strin
g query}) { | 172 async.Future<ListMetricDescriptorsResponse> list(ListMetricDescriptorsRequest
request, core.String project, {core.int count, core.String pageToken, core.Strin
g query}) { |
| 171 var _url = null; | 173 var _url = null; |
| 172 var _queryParams = new core.Map(); | 174 var _queryParams = new core.Map(); |
| 173 var _uploadMedia = null; | 175 var _uploadMedia = null; |
| 174 var _uploadOptions = null; | 176 var _uploadOptions = null; |
| 175 var _downloadOptions = common.DownloadOptions.Metadata; | 177 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 176 var _body = null; | 178 var _body = null; |
| 177 | 179 |
| 178 if (request != null) { | 180 if (request != null) { |
| 179 _body = convert.JSON.encode((request).toJson()); | 181 _body = convert.JSON.encode((request).toJson()); |
| 180 } | 182 } |
| 181 if (project == null) { | 183 if (project == null) { |
| 182 throw new core.ArgumentError("Parameter project is required."); | 184 throw new core.ArgumentError("Parameter project is required."); |
| 183 } | 185 } |
| 184 if (count != null) { | 186 if (count != null) { |
| 185 _queryParams["count"] = ["${count}"]; | 187 _queryParams["count"] = ["${count}"]; |
| 186 } | 188 } |
| 187 if (pageToken != null) { | 189 if (pageToken != null) { |
| 188 _queryParams["pageToken"] = [pageToken]; | 190 _queryParams["pageToken"] = [pageToken]; |
| 189 } | 191 } |
| 190 if (query != null) { | 192 if (query != null) { |
| 191 _queryParams["query"] = [query]; | 193 _queryParams["query"] = [query]; |
| 192 } | 194 } |
| 193 | 195 |
| 194 | 196 |
| 195 _url = common_internal.Escaper.ecapeVariable('$project') + '/metricDescripto
rs'; | 197 _url = commons.Escaper.ecapeVariable('$project') + '/metricDescriptors'; |
| 196 | 198 |
| 197 var _response = _requester.request(_url, | 199 var _response = _requester.request(_url, |
| 198 "GET", | 200 "GET", |
| 199 body: _body, | 201 body: _body, |
| 200 queryParams: _queryParams, | 202 queryParams: _queryParams, |
| 201 uploadOptions: _uploadOptions, | 203 uploadOptions: _uploadOptions, |
| 202 uploadMedia: _uploadMedia, | 204 uploadMedia: _uploadMedia, |
| 203 downloadOptions: _downloadOptions); | 205 downloadOptions: _downloadOptions); |
| 204 return _response.then((data) => new ListMetricDescriptorsResponse.fromJson(d
ata)); | 206 return _response.then((data) => new ListMetricDescriptorsResponse.fromJson(d
ata)); |
| 205 } | 207 } |
| 206 | 208 |
| 207 } | 209 } |
| 208 | 210 |
| 209 | 211 |
| 210 /** Not documented yet. */ | |
| 211 class TimeseriesResourceApi { | 212 class TimeseriesResourceApi { |
| 212 final common_internal.ApiRequester _requester; | 213 final commons.ApiRequester _requester; |
| 213 | 214 |
| 214 TimeseriesResourceApi(common_internal.ApiRequester client) : | 215 TimeseriesResourceApi(commons.ApiRequester client) : |
| 215 _requester = client; | 216 _requester = client; |
| 216 | 217 |
| 217 /** | 218 /** |
| 218 * List the data points of the time series that match the metric and labels | 219 * List the data points of the time series that match the metric and labels |
| 219 * values and that have data points in the interval. Large responses are | 220 * values and that have data points in the interval. Large responses are |
| 220 * paginated; use the nextPageToken returned in the response to request | 221 * paginated; use the nextPageToken returned in the response to request |
| 221 * subsequent pages of results by setting the pageToken query parameter to the | 222 * subsequent pages of results by setting the pageToken query parameter to the |
| 222 * value of the nextPageToken. | 223 * value of the nextPageToken. |
| 223 * | 224 * |
| 224 * [request] - The metadata request object. | 225 * [request] - The metadata request object. |
| 225 * | 226 * |
| 226 * Request parameters: | 227 * Request parameters: |
| 227 * | 228 * |
| 228 * [project] - The project ID to which this time series belongs. The value can | 229 * [project] - The project ID to which this time series belongs. The value can |
| 229 * be the numeric project ID or string-based project name. | 230 * be the numeric project ID or string-based project name. |
| 230 * | 231 * |
| 231 * [metric] - Metric names are protocol-free URLs as listed in the Supported | 232 * [metric] - Metric names are protocol-free URLs as listed in the Supported |
| 232 * Metrics page. For example, | 233 * Metrics page. For example, |
| 233 * compute.googleapis.com/instance/disk/read_ops_count. | 234 * compute.googleapis.com/instance/disk/read_ops_count. |
| 234 * | 235 * |
| 235 * [youngest] - End of the time interval (inclusive), which is expressed as an | 236 * [youngest] - End of the time interval (inclusive), which is expressed as an |
| 236 * RFC 3339 timestamp. | 237 * RFC 3339 timestamp. |
| 237 * | 238 * |
| 238 * [aggregator] - The aggregation function that will reduce the data points in | 239 * [aggregator] - The aggregation function that will reduce the data points in |
| 239 * each window to a single point. This parameter is only valid for | 240 * each window to a single point. This parameter is only valid for |
| 240 * non-cumulative metric types. | 241 * non-cumulative metrics with a value type of INT64 or DOUBLE. |
| 241 * Possible string values are: | 242 * Possible string values are: |
| 242 * - "max" | 243 * - "max" |
| 243 * - "mean" | 244 * - "mean" |
| 244 * - "min" | 245 * - "min" |
| 245 * - "sum" | 246 * - "sum" |
| 246 * | 247 * |
| 247 * [count] - Maximum number of data points per page, which is used for | 248 * [count] - Maximum number of data points per page, which is used for |
| 248 * pagination of results. | 249 * pagination of results. |
| 249 * Value must be between "1" and "12000". | 250 * Value must be between "1" and "12000". |
| 250 * | 251 * |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 * for non-cumulative metric types. Units: | 287 * for non-cumulative metric types. Units: |
| 287 * - m: minute | 288 * - m: minute |
| 288 * - h: hour | 289 * - h: hour |
| 289 * - d: day | 290 * - d: day |
| 290 * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is | 291 * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is |
| 291 * not allowed; you should use 17d instead. | 292 * not allowed; you should use 17d instead. |
| 292 * Value must have pattern "[0-9]+[mhdw]?". | 293 * Value must have pattern "[0-9]+[mhdw]?". |
| 293 * | 294 * |
| 294 * Completes with a [ListTimeseriesResponse]. | 295 * Completes with a [ListTimeseriesResponse]. |
| 295 * | 296 * |
| 296 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 297 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 297 * error. | 298 * error. |
| 298 * | 299 * |
| 299 * If the used [http.Client] completes with an error when making a REST call, | 300 * If the used [http.Client] completes with an error when making a REST call, |
| 300 * this method will complete with the same error. | 301 * this method will complete with the same error. |
| 301 */ | 302 */ |
| 302 async.Future<ListTimeseriesResponse> list(ListTimeseriesRequest request, core.
String project, core.String metric, core.String youngest, {core.String aggregato
r, core.int count, core.List<core.String> labels, core.String oldest, core.Strin
g pageToken, core.String timespan, core.String window}) { | 303 async.Future<ListTimeseriesResponse> list(ListTimeseriesRequest request, core.
String project, core.String metric, core.String youngest, {core.String aggregato
r, core.int count, core.List<core.String> labels, core.String oldest, core.Strin
g pageToken, core.String timespan, core.String window}) { |
| 303 var _url = null; | 304 var _url = null; |
| 304 var _queryParams = new core.Map(); | 305 var _queryParams = new core.Map(); |
| 305 var _uploadMedia = null; | 306 var _uploadMedia = null; |
| 306 var _uploadOptions = null; | 307 var _uploadOptions = null; |
| 307 var _downloadOptions = common.DownloadOptions.Metadata; | 308 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 308 var _body = null; | 309 var _body = null; |
| 309 | 310 |
| 310 if (request != null) { | 311 if (request != null) { |
| 311 _body = convert.JSON.encode((request).toJson()); | 312 _body = convert.JSON.encode((request).toJson()); |
| 312 } | 313 } |
| 313 if (project == null) { | 314 if (project == null) { |
| 314 throw new core.ArgumentError("Parameter project is required."); | 315 throw new core.ArgumentError("Parameter project is required."); |
| 315 } | 316 } |
| 316 if (metric == null) { | 317 if (metric == null) { |
| 317 throw new core.ArgumentError("Parameter metric is required."); | 318 throw new core.ArgumentError("Parameter metric is required."); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 336 _queryParams["pageToken"] = [pageToken]; | 337 _queryParams["pageToken"] = [pageToken]; |
| 337 } | 338 } |
| 338 if (timespan != null) { | 339 if (timespan != null) { |
| 339 _queryParams["timespan"] = [timespan]; | 340 _queryParams["timespan"] = [timespan]; |
| 340 } | 341 } |
| 341 if (window != null) { | 342 if (window != null) { |
| 342 _queryParams["window"] = [window]; | 343 _queryParams["window"] = [window]; |
| 343 } | 344 } |
| 344 | 345 |
| 345 | 346 |
| 346 _url = common_internal.Escaper.ecapeVariable('$project') + '/timeseries/' +
common_internal.Escaper.ecapeVariable('$metric'); | 347 _url = commons.Escaper.ecapeVariable('$project') + '/timeseries/' + commons.
Escaper.ecapeVariable('$metric'); |
| 347 | 348 |
| 348 var _response = _requester.request(_url, | 349 var _response = _requester.request(_url, |
| 349 "GET", | 350 "GET", |
| 350 body: _body, | 351 body: _body, |
| 351 queryParams: _queryParams, | 352 queryParams: _queryParams, |
| 352 uploadOptions: _uploadOptions, | 353 uploadOptions: _uploadOptions, |
| 353 uploadMedia: _uploadMedia, | 354 uploadMedia: _uploadMedia, |
| 354 downloadOptions: _downloadOptions); | 355 downloadOptions: _downloadOptions); |
| 355 return _response.then((data) => new ListTimeseriesResponse.fromJson(data)); | 356 return _response.then((data) => new ListTimeseriesResponse.fromJson(data)); |
| 356 } | 357 } |
| 357 | 358 |
| 358 /** | 359 /** |
| 359 * Put data points to one or more time series for one or more metrics. If a | 360 * Put data points to one or more time series for one or more metrics. If a |
| 360 * time series does not exist, a new time series will be created. It is not | 361 * time series does not exist, a new time series will be created. It is not |
| 361 * allowed to write a time series point that is older than the existing | 362 * allowed to write a time series point that is older than the existing |
| 362 * youngest point of that time series. Points that are older than the existing | 363 * youngest point of that time series. Points that are older than the existing |
| 363 * youngest point of that time series will be discarded silently. Therefore, | 364 * youngest point of that time series will be discarded silently. Therefore, |
| 364 * users should make sure that points of a time series are written | 365 * users should make sure that points of a time series are written |
| 365 * sequentially in the order of their end time. | 366 * sequentially in the order of their end time. |
| 366 * | 367 * |
| 367 * [request] - The metadata request object. | 368 * [request] - The metadata request object. |
| 368 * | 369 * |
| 369 * Request parameters: | 370 * Request parameters: |
| 370 * | 371 * |
| 371 * [project] - The project ID. The value can be the numeric project ID or | 372 * [project] - The project ID. The value can be the numeric project ID or |
| 372 * string-based project name. | 373 * string-based project name. |
| 373 * | 374 * |
| 374 * Completes with a [WriteTimeseriesResponse]. | 375 * Completes with a [WriteTimeseriesResponse]. |
| 375 * | 376 * |
| 376 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 377 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 377 * error. | 378 * error. |
| 378 * | 379 * |
| 379 * If the used [http.Client] completes with an error when making a REST call, | 380 * If the used [http.Client] completes with an error when making a REST call, |
| 380 * this method will complete with the same error. | 381 * this method will complete with the same error. |
| 381 */ | 382 */ |
| 382 async.Future<WriteTimeseriesResponse> write(WriteTimeseriesRequest request, co
re.String project) { | 383 async.Future<WriteTimeseriesResponse> write(WriteTimeseriesRequest request, co
re.String project) { |
| 383 var _url = null; | 384 var _url = null; |
| 384 var _queryParams = new core.Map(); | 385 var _queryParams = new core.Map(); |
| 385 var _uploadMedia = null; | 386 var _uploadMedia = null; |
| 386 var _uploadOptions = null; | 387 var _uploadOptions = null; |
| 387 var _downloadOptions = common.DownloadOptions.Metadata; | 388 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 388 var _body = null; | 389 var _body = null; |
| 389 | 390 |
| 390 if (request != null) { | 391 if (request != null) { |
| 391 _body = convert.JSON.encode((request).toJson()); | 392 _body = convert.JSON.encode((request).toJson()); |
| 392 } | 393 } |
| 393 if (project == null) { | 394 if (project == null) { |
| 394 throw new core.ArgumentError("Parameter project is required."); | 395 throw new core.ArgumentError("Parameter project is required."); |
| 395 } | 396 } |
| 396 | 397 |
| 397 | 398 |
| 398 _url = common_internal.Escaper.ecapeVariable('$project') + '/timeseries:writ
e'; | 399 _url = commons.Escaper.ecapeVariable('$project') + '/timeseries:write'; |
| 399 | 400 |
| 400 var _response = _requester.request(_url, | 401 var _response = _requester.request(_url, |
| 401 "POST", | 402 "POST", |
| 402 body: _body, | 403 body: _body, |
| 403 queryParams: _queryParams, | 404 queryParams: _queryParams, |
| 404 uploadOptions: _uploadOptions, | 405 uploadOptions: _uploadOptions, |
| 405 uploadMedia: _uploadMedia, | 406 uploadMedia: _uploadMedia, |
| 406 downloadOptions: _downloadOptions); | 407 downloadOptions: _downloadOptions); |
| 407 return _response.then((data) => new WriteTimeseriesResponse.fromJson(data)); | 408 return _response.then((data) => new WriteTimeseriesResponse.fromJson(data)); |
| 408 } | 409 } |
| 409 | 410 |
| 410 } | 411 } |
| 411 | 412 |
| 412 | 413 |
| 413 /** Not documented yet. */ | |
| 414 class TimeseriesDescriptorsResourceApi { | 414 class TimeseriesDescriptorsResourceApi { |
| 415 final common_internal.ApiRequester _requester; | 415 final commons.ApiRequester _requester; |
| 416 | 416 |
| 417 TimeseriesDescriptorsResourceApi(common_internal.ApiRequester client) : | 417 TimeseriesDescriptorsResourceApi(commons.ApiRequester client) : |
| 418 _requester = client; | 418 _requester = client; |
| 419 | 419 |
| 420 /** | 420 /** |
| 421 * List the descriptors of the time series that match the metric and labels | 421 * List the descriptors of the time series that match the metric and labels |
| 422 * values and that have data points in the interval. Large responses are | 422 * values and that have data points in the interval. Large responses are |
| 423 * paginated; use the nextPageToken returned in the response to request | 423 * paginated; use the nextPageToken returned in the response to request |
| 424 * subsequent pages of results by setting the pageToken query parameter to the | 424 * subsequent pages of results by setting the pageToken query parameter to the |
| 425 * value of the nextPageToken. | 425 * value of the nextPageToken. |
| 426 * | 426 * |
| 427 * [request] - The metadata request object. | 427 * [request] - The metadata request object. |
| 428 * | 428 * |
| 429 * Request parameters: | 429 * Request parameters: |
| 430 * | 430 * |
| 431 * [project] - The project ID to which this time series belongs. The value can | 431 * [project] - The project ID to which this time series belongs. The value can |
| 432 * be the numeric project ID or string-based project name. | 432 * be the numeric project ID or string-based project name. |
| 433 * | 433 * |
| 434 * [metric] - Metric names are protocol-free URLs as listed in the Supported | 434 * [metric] - Metric names are protocol-free URLs as listed in the Supported |
| 435 * Metrics page. For example, | 435 * Metrics page. For example, |
| 436 * compute.googleapis.com/instance/disk/read_ops_count. | 436 * compute.googleapis.com/instance/disk/read_ops_count. |
| 437 * | 437 * |
| 438 * [youngest] - End of the time interval (inclusive), which is expressed as an | 438 * [youngest] - End of the time interval (inclusive), which is expressed as an |
| 439 * RFC 3339 timestamp. | 439 * RFC 3339 timestamp. |
| 440 * | 440 * |
| 441 * [aggregator] - The aggregation function that will reduce the data points in | 441 * [aggregator] - The aggregation function that will reduce the data points in |
| 442 * each window to a single point. This parameter is only valid for | 442 * each window to a single point. This parameter is only valid for |
| 443 * non-cumulative metric types. | 443 * non-cumulative metrics with a value type of INT64 or DOUBLE. |
| 444 * Possible string values are: | 444 * Possible string values are: |
| 445 * - "max" | 445 * - "max" |
| 446 * - "mean" | 446 * - "mean" |
| 447 * - "min" | 447 * - "min" |
| 448 * - "sum" | 448 * - "sum" |
| 449 * | 449 * |
| 450 * [count] - Maximum number of time series descriptors per page. Used for | 450 * [count] - Maximum number of time series descriptors per page. Used for |
| 451 * pagination. If not specified, count = 100. | 451 * pagination. If not specified, count = 100. |
| 452 * Value must be between "1" and "1000". | 452 * Value must be between "1" and "1000". |
| 453 * | 453 * |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 * for non-cumulative metric types. Units: | 489 * for non-cumulative metric types. Units: |
| 490 * - m: minute | 490 * - m: minute |
| 491 * - h: hour | 491 * - h: hour |
| 492 * - d: day | 492 * - d: day |
| 493 * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is | 493 * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is |
| 494 * not allowed; you should use 17d instead. | 494 * not allowed; you should use 17d instead. |
| 495 * Value must have pattern "[0-9]+[mhdw]?". | 495 * Value must have pattern "[0-9]+[mhdw]?". |
| 496 * | 496 * |
| 497 * Completes with a [ListTimeseriesDescriptorsResponse]. | 497 * Completes with a [ListTimeseriesDescriptorsResponse]. |
| 498 * | 498 * |
| 499 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 499 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 500 * error. | 500 * error. |
| 501 * | 501 * |
| 502 * If the used [http.Client] completes with an error when making a REST call, | 502 * If the used [http.Client] completes with an error when making a REST call, |
| 503 * this method will complete with the same error. | 503 * this method will complete with the same error. |
| 504 */ | 504 */ |
| 505 async.Future<ListTimeseriesDescriptorsResponse> list(ListTimeseriesDescriptors
Request request, core.String project, core.String metric, core.String youngest,
{core.String aggregator, core.int count, core.List<core.String> labels, core.Str
ing oldest, core.String pageToken, core.String timespan, core.String window}) { | 505 async.Future<ListTimeseriesDescriptorsResponse> list(ListTimeseriesDescriptors
Request request, core.String project, core.String metric, core.String youngest,
{core.String aggregator, core.int count, core.List<core.String> labels, core.Str
ing oldest, core.String pageToken, core.String timespan, core.String window}) { |
| 506 var _url = null; | 506 var _url = null; |
| 507 var _queryParams = new core.Map(); | 507 var _queryParams = new core.Map(); |
| 508 var _uploadMedia = null; | 508 var _uploadMedia = null; |
| 509 var _uploadOptions = null; | 509 var _uploadOptions = null; |
| 510 var _downloadOptions = common.DownloadOptions.Metadata; | 510 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 511 var _body = null; | 511 var _body = null; |
| 512 | 512 |
| 513 if (request != null) { | 513 if (request != null) { |
| 514 _body = convert.JSON.encode((request).toJson()); | 514 _body = convert.JSON.encode((request).toJson()); |
| 515 } | 515 } |
| 516 if (project == null) { | 516 if (project == null) { |
| 517 throw new core.ArgumentError("Parameter project is required."); | 517 throw new core.ArgumentError("Parameter project is required."); |
| 518 } | 518 } |
| 519 if (metric == null) { | 519 if (metric == null) { |
| 520 throw new core.ArgumentError("Parameter metric is required."); | 520 throw new core.ArgumentError("Parameter metric is required."); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 539 _queryParams["pageToken"] = [pageToken]; | 539 _queryParams["pageToken"] = [pageToken]; |
| 540 } | 540 } |
| 541 if (timespan != null) { | 541 if (timespan != null) { |
| 542 _queryParams["timespan"] = [timespan]; | 542 _queryParams["timespan"] = [timespan]; |
| 543 } | 543 } |
| 544 if (window != null) { | 544 if (window != null) { |
| 545 _queryParams["window"] = [window]; | 545 _queryParams["window"] = [window]; |
| 546 } | 546 } |
| 547 | 547 |
| 548 | 548 |
| 549 _url = common_internal.Escaper.ecapeVariable('$project') + '/timeseriesDescr
iptors/' + common_internal.Escaper.ecapeVariable('$metric'); | 549 _url = commons.Escaper.ecapeVariable('$project') + '/timeseriesDescriptors/'
+ commons.Escaper.ecapeVariable('$metric'); |
| 550 | 550 |
| 551 var _response = _requester.request(_url, | 551 var _response = _requester.request(_url, |
| 552 "GET", | 552 "GET", |
| 553 body: _body, | 553 body: _body, |
| 554 queryParams: _queryParams, | 554 queryParams: _queryParams, |
| 555 uploadOptions: _uploadOptions, | 555 uploadOptions: _uploadOptions, |
| 556 uploadMedia: _uploadMedia, | 556 uploadMedia: _uploadMedia, |
| 557 downloadOptions: _downloadOptions); | 557 downloadOptions: _downloadOptions); |
| 558 return _response.then((data) => new ListTimeseriesDescriptorsResponse.fromJs
on(data)); | 558 return _response.then((data) => new ListTimeseriesDescriptorsResponse.fromJs
on(data)); |
| 559 } | 559 } |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 _json["metric"] = metric; | 1353 _json["metric"] = metric; |
| 1354 } | 1354 } |
| 1355 if (project != null) { | 1355 if (project != null) { |
| 1356 _json["project"] = project; | 1356 _json["project"] = project; |
| 1357 } | 1357 } |
| 1358 return _json; | 1358 return _json; |
| 1359 } | 1359 } |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 | 1362 |
| 1363 /** Not documented yet. */ | |
| 1364 class TimeseriesDescriptorLabel { | 1363 class TimeseriesDescriptorLabel { |
| 1365 /** The label's name. */ | 1364 /** The label's name. */ |
| 1366 core.String key; | 1365 core.String key; |
| 1367 | 1366 |
| 1368 /** The label's value. */ | 1367 /** The label's value. */ |
| 1369 core.String value; | 1368 core.String value; |
| 1370 | 1369 |
| 1371 | 1370 |
| 1372 TimeseriesDescriptorLabel(); | 1371 TimeseriesDescriptorLabel(); |
| 1373 | 1372 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 } | 1484 } |
| 1486 | 1485 |
| 1487 core.Map toJson() { | 1486 core.Map toJson() { |
| 1488 var _json = new core.Map(); | 1487 var _json = new core.Map(); |
| 1489 if (kind != null) { | 1488 if (kind != null) { |
| 1490 _json["kind"] = kind; | 1489 _json["kind"] = kind; |
| 1491 } | 1490 } |
| 1492 return _json; | 1491 return _json; |
| 1493 } | 1492 } |
| 1494 } | 1493 } |
| 1495 | |
| 1496 | |
| OLD | NEW |