OLD | NEW |
(Empty) | |
| 1 library googleapis_beta.cloudmonitoring.v2beta1; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 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 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** API for accessing Google Cloud and API monitoring data. */ |
| 17 class CloudmonitoringApi { |
| 18 /** View monitoring data for all of your Google Cloud and API projects */ |
| 19 static const MonitoringReadonlyScope = "https://www.googleapis.com/auth/monito
ring.readonly"; |
| 20 |
| 21 |
| 22 final common_internal.ApiRequester _requester; |
| 23 |
| 24 MetricDescriptorsResourceApi get metricDescriptors => new MetricDescriptorsRes
ourceApi(_requester); |
| 25 TimeseriesResourceApi get timeseries => new TimeseriesResourceApi(_requester); |
| 26 TimeseriesDescriptorsResourceApi get timeseriesDescriptors => new TimeseriesDe
scriptorsResourceApi(_requester); |
| 27 |
| 28 CloudmonitoringApi(http.Client client) : |
| 29 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/cloudmonitoring/v2beta1/projects/"); |
| 30 } |
| 31 |
| 32 |
| 33 /** Not documented yet. */ |
| 34 class MetricDescriptorsResourceApi { |
| 35 final common_internal.ApiRequester _requester; |
| 36 |
| 37 MetricDescriptorsResourceApi(common_internal.ApiRequester client) : |
| 38 _requester = client; |
| 39 |
| 40 /** |
| 41 * List metric descriptors that match the query. If the query is not set, then |
| 42 * all of the metric descriptors will be returned. Large responses will be |
| 43 * paginated, use the nextPageToken returned in the response to request |
| 44 * subsequent pages of results by setting the pageToken query parameter to the |
| 45 * value of the nextPageToken. |
| 46 * |
| 47 * [request] - The metadata request object. |
| 48 * |
| 49 * Request parameters: |
| 50 * |
| 51 * [project] - The project id. The value can be the numeric project ID or |
| 52 * string-based project name. |
| 53 * |
| 54 * [count] - Maximum number of metric descriptors per page. Used for |
| 55 * pagination. If not specified, count = 100. |
| 56 * Value must be between "1" and "1000". |
| 57 * |
| 58 * [pageToken] - The pagination token, which is used to page through large |
| 59 * result sets. Set this value to the value of the nextPageToken to retrieve |
| 60 * the next page of results. |
| 61 * |
| 62 * [query] - The query used to search against existing metrics. Separate |
| 63 * keywords with a space; the service joins all keywords with AND, meaning |
| 64 * that all keywords must match for a metric to be returned. If this field is |
| 65 * omitted, all metrics are returned. If an empty string is passed with this |
| 66 * field, no metrics are returned. |
| 67 * |
| 68 * Completes with a [ListMetricDescriptorsResponse]. |
| 69 * |
| 70 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 71 * error. |
| 72 * |
| 73 * If the used [http.Client] completes with an error when making a REST call, |
| 74 * this method will complete with the same error. |
| 75 */ |
| 76 async.Future<ListMetricDescriptorsResponse> list(ListMetricDescriptorsRequest
request, core.String project, {core.int count, core.String pageToken, core.Strin
g query}) { |
| 77 var _url = null; |
| 78 var _queryParams = new core.Map(); |
| 79 var _uploadMedia = null; |
| 80 var _uploadOptions = null; |
| 81 var _downloadOptions = common.DownloadOptions.Metadata; |
| 82 var _body = null; |
| 83 |
| 84 if (request != null) { |
| 85 _body = convert.JSON.encode((request).toJson()); |
| 86 } |
| 87 if (project == null) { |
| 88 throw new core.ArgumentError("Parameter project is required."); |
| 89 } |
| 90 if (count != null) { |
| 91 _queryParams["count"] = ["${count}"]; |
| 92 } |
| 93 if (pageToken != null) { |
| 94 _queryParams["pageToken"] = [pageToken]; |
| 95 } |
| 96 if (query != null) { |
| 97 _queryParams["query"] = [query]; |
| 98 } |
| 99 |
| 100 |
| 101 _url = common_internal.Escaper.ecapeVariable('$project') + '/metricDescripto
rs'; |
| 102 |
| 103 var _response = _requester.request(_url, |
| 104 "GET", |
| 105 body: _body, |
| 106 queryParams: _queryParams, |
| 107 uploadOptions: _uploadOptions, |
| 108 uploadMedia: _uploadMedia, |
| 109 downloadOptions: _downloadOptions); |
| 110 return _response.then((data) => new ListMetricDescriptorsResponse.fromJson(d
ata)); |
| 111 } |
| 112 |
| 113 } |
| 114 |
| 115 |
| 116 /** Not documented yet. */ |
| 117 class TimeseriesResourceApi { |
| 118 final common_internal.ApiRequester _requester; |
| 119 |
| 120 TimeseriesResourceApi(common_internal.ApiRequester client) : |
| 121 _requester = client; |
| 122 |
| 123 /** |
| 124 * List the data points of the time series that match the metric and labels |
| 125 * values and that have data points in the interval. Large responses are |
| 126 * paginated; use the nextPageToken returned in the response to request |
| 127 * subsequent pages of results by setting the pageToken query parameter to the |
| 128 * value of the nextPageToken. |
| 129 * |
| 130 * [request] - The metadata request object. |
| 131 * |
| 132 * Request parameters: |
| 133 * |
| 134 * [project] - The project ID to which this time series belongs. The value can |
| 135 * be the numeric project ID or string-based project name. |
| 136 * |
| 137 * [metric] - Metric names are protocol-free URLs as listed in the Supported |
| 138 * Metrics page. For example, |
| 139 * compute.googleapis.com/instance/disk/read_ops_count. |
| 140 * |
| 141 * [youngest] - End of the time interval (inclusive), which is expressed as an |
| 142 * RFC 3339 timestamp. |
| 143 * |
| 144 * [count] - Maximum number of data points per page, which is used for |
| 145 * pagination of results. |
| 146 * Value must be between "1" and "12000". |
| 147 * |
| 148 * [labels] - A collection of labels for the matching time series, which are |
| 149 * represented as: |
| 150 * - key==value: key equals the value |
| 151 * - key=~value: key regex matches the value |
| 152 * - key!=value: key does not equal the value |
| 153 * - key!~value: key regex does not match the value For example, to list all |
| 154 * of the time series descriptors for the region us-central1, you could |
| 155 * specify: |
| 156 * label=cloud.googleapis.com%2Flocation=~us-central1.* |
| 157 * Value must have pattern "(.+?)(==|=~|!=|!~)(.+)". |
| 158 * |
| 159 * [oldest] - Start of the time interval (exclusive), which is expressed as an |
| 160 * RFC 3339 timestamp. If neither oldest nor timespan is specified, the |
| 161 * default time interval will be (youngest - 4 hours, youngest] |
| 162 * |
| 163 * [pageToken] - The pagination token, which is used to page through large |
| 164 * result sets. Set this value to the value of the nextPageToken to retrieve |
| 165 * the next page of results. |
| 166 * |
| 167 * [timespan] - Length of the time interval to query, which is an alternative |
| 168 * way to declare the interval: (youngest - timespan, youngest]. The timespan |
| 169 * and oldest parameters should not be used together. Units: |
| 170 * - s: second |
| 171 * - m: minute |
| 172 * - h: hour |
| 173 * - d: day |
| 174 * - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: |
| 175 * 2w3d is not allowed; you should use 17d instead. |
| 176 * |
| 177 * If neither oldest nor timespan is specified, the default time interval will |
| 178 * be (youngest - 4 hours, youngest]. |
| 179 * Value must have pattern "[0-9]+[smhdw]?". |
| 180 * |
| 181 * Completes with a [ListTimeseriesResponse]. |
| 182 * |
| 183 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 184 * error. |
| 185 * |
| 186 * If the used [http.Client] completes with an error when making a REST call, |
| 187 * this method will complete with the same error. |
| 188 */ |
| 189 async.Future<ListTimeseriesResponse> list(ListTimeseriesRequest request, core.
String project, core.String metric, core.String youngest, {core.int count, core.
List<core.String> labels, core.String oldest, core.String pageToken, core.String
timespan}) { |
| 190 var _url = null; |
| 191 var _queryParams = new core.Map(); |
| 192 var _uploadMedia = null; |
| 193 var _uploadOptions = null; |
| 194 var _downloadOptions = common.DownloadOptions.Metadata; |
| 195 var _body = null; |
| 196 |
| 197 if (request != null) { |
| 198 _body = convert.JSON.encode((request).toJson()); |
| 199 } |
| 200 if (project == null) { |
| 201 throw new core.ArgumentError("Parameter project is required."); |
| 202 } |
| 203 if (metric == null) { |
| 204 throw new core.ArgumentError("Parameter metric is required."); |
| 205 } |
| 206 if (youngest == null) { |
| 207 throw new core.ArgumentError("Parameter youngest is required."); |
| 208 } |
| 209 _queryParams["youngest"] = [youngest]; |
| 210 if (count != null) { |
| 211 _queryParams["count"] = ["${count}"]; |
| 212 } |
| 213 if (labels != null) { |
| 214 _queryParams["labels"] = labels; |
| 215 } |
| 216 if (oldest != null) { |
| 217 _queryParams["oldest"] = [oldest]; |
| 218 } |
| 219 if (pageToken != null) { |
| 220 _queryParams["pageToken"] = [pageToken]; |
| 221 } |
| 222 if (timespan != null) { |
| 223 _queryParams["timespan"] = [timespan]; |
| 224 } |
| 225 |
| 226 |
| 227 _url = common_internal.Escaper.ecapeVariable('$project') + '/timeseries/' +
common_internal.Escaper.ecapeVariable('$metric'); |
| 228 |
| 229 var _response = _requester.request(_url, |
| 230 "GET", |
| 231 body: _body, |
| 232 queryParams: _queryParams, |
| 233 uploadOptions: _uploadOptions, |
| 234 uploadMedia: _uploadMedia, |
| 235 downloadOptions: _downloadOptions); |
| 236 return _response.then((data) => new ListTimeseriesResponse.fromJson(data)); |
| 237 } |
| 238 |
| 239 } |
| 240 |
| 241 |
| 242 /** Not documented yet. */ |
| 243 class TimeseriesDescriptorsResourceApi { |
| 244 final common_internal.ApiRequester _requester; |
| 245 |
| 246 TimeseriesDescriptorsResourceApi(common_internal.ApiRequester client) : |
| 247 _requester = client; |
| 248 |
| 249 /** |
| 250 * List the descriptors of the time series that match the metric and labels |
| 251 * values and that have data points in the interval. Large responses are |
| 252 * paginated; use the nextPageToken returned in the response to request |
| 253 * subsequent pages of results by setting the pageToken query parameter to the |
| 254 * value of the nextPageToken. |
| 255 * |
| 256 * [request] - The metadata request object. |
| 257 * |
| 258 * Request parameters: |
| 259 * |
| 260 * [project] - The project ID to which this time series belongs. The value can |
| 261 * be the numeric project ID or string-based project name. |
| 262 * |
| 263 * [metric] - Metric names are protocol-free URLs as listed in the Supported |
| 264 * Metrics page. For example, |
| 265 * compute.googleapis.com/instance/disk/read_ops_count. |
| 266 * |
| 267 * [youngest] - End of the time interval (inclusive), which is expressed as an |
| 268 * RFC 3339 timestamp. |
| 269 * |
| 270 * [count] - Maximum number of time series descriptors per page. Used for |
| 271 * pagination. If not specified, count = 100. |
| 272 * Value must be between "1" and "1000". |
| 273 * |
| 274 * [labels] - A collection of labels for the matching time series, which are |
| 275 * represented as: |
| 276 * - key==value: key equals the value |
| 277 * - key=~value: key regex matches the value |
| 278 * - key!=value: key does not equal the value |
| 279 * - key!~value: key regex does not match the value For example, to list all |
| 280 * of the time series descriptors for the region us-central1, you could |
| 281 * specify: |
| 282 * label=cloud.googleapis.com%2Flocation=~us-central1.* |
| 283 * Value must have pattern "(.+?)(==|=~|!=|!~)(.+)". |
| 284 * |
| 285 * [oldest] - Start of the time interval (exclusive), which is expressed as an |
| 286 * RFC 3339 timestamp. If neither oldest nor timespan is specified, the |
| 287 * default time interval will be (youngest - 4 hours, youngest] |
| 288 * |
| 289 * [pageToken] - The pagination token, which is used to page through large |
| 290 * result sets. Set this value to the value of the nextPageToken to retrieve |
| 291 * the next page of results. |
| 292 * |
| 293 * [timespan] - Length of the time interval to query, which is an alternative |
| 294 * way to declare the interval: (youngest - timespan, youngest]. The timespan |
| 295 * and oldest parameters should not be used together. Units: |
| 296 * - s: second |
| 297 * - m: minute |
| 298 * - h: hour |
| 299 * - d: day |
| 300 * - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: |
| 301 * 2w3d is not allowed; you should use 17d instead. |
| 302 * |
| 303 * If neither oldest nor timespan is specified, the default time interval will |
| 304 * be (youngest - 4 hours, youngest]. |
| 305 * Value must have pattern "[0-9]+[smhdw]?". |
| 306 * |
| 307 * Completes with a [ListTimeseriesDescriptorsResponse]. |
| 308 * |
| 309 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 310 * error. |
| 311 * |
| 312 * If the used [http.Client] completes with an error when making a REST call, |
| 313 * this method will complete with the same error. |
| 314 */ |
| 315 async.Future<ListTimeseriesDescriptorsResponse> list(ListTimeseriesDescriptors
Request request, core.String project, core.String metric, core.String youngest,
{core.int count, core.List<core.String> labels, core.String oldest, core.String
pageToken, core.String timespan}) { |
| 316 var _url = null; |
| 317 var _queryParams = new core.Map(); |
| 318 var _uploadMedia = null; |
| 319 var _uploadOptions = null; |
| 320 var _downloadOptions = common.DownloadOptions.Metadata; |
| 321 var _body = null; |
| 322 |
| 323 if (request != null) { |
| 324 _body = convert.JSON.encode((request).toJson()); |
| 325 } |
| 326 if (project == null) { |
| 327 throw new core.ArgumentError("Parameter project is required."); |
| 328 } |
| 329 if (metric == null) { |
| 330 throw new core.ArgumentError("Parameter metric is required."); |
| 331 } |
| 332 if (youngest == null) { |
| 333 throw new core.ArgumentError("Parameter youngest is required."); |
| 334 } |
| 335 _queryParams["youngest"] = [youngest]; |
| 336 if (count != null) { |
| 337 _queryParams["count"] = ["${count}"]; |
| 338 } |
| 339 if (labels != null) { |
| 340 _queryParams["labels"] = labels; |
| 341 } |
| 342 if (oldest != null) { |
| 343 _queryParams["oldest"] = [oldest]; |
| 344 } |
| 345 if (pageToken != null) { |
| 346 _queryParams["pageToken"] = [pageToken]; |
| 347 } |
| 348 if (timespan != null) { |
| 349 _queryParams["timespan"] = [timespan]; |
| 350 } |
| 351 |
| 352 |
| 353 _url = common_internal.Escaper.ecapeVariable('$project') + '/timeseriesDescr
iptors/' + common_internal.Escaper.ecapeVariable('$metric'); |
| 354 |
| 355 var _response = _requester.request(_url, |
| 356 "GET", |
| 357 body: _body, |
| 358 queryParams: _queryParams, |
| 359 uploadOptions: _uploadOptions, |
| 360 uploadMedia: _uploadMedia, |
| 361 downloadOptions: _downloadOptions); |
| 362 return _response.then((data) => new ListTimeseriesDescriptorsResponse.fromJs
on(data)); |
| 363 } |
| 364 |
| 365 } |
| 366 |
| 367 |
| 368 |
| 369 /** The request of cloudmonitoring.metricDescriptors.list. */ |
| 370 class ListMetricDescriptorsRequest { |
| 371 /** |
| 372 * Identifies what kind of resource this is. Value: the fixed string |
| 373 * "cloudmonitoring#listMetricDescriptorsRequest". |
| 374 */ |
| 375 core.String kind; |
| 376 |
| 377 |
| 378 ListMetricDescriptorsRequest(); |
| 379 |
| 380 ListMetricDescriptorsRequest.fromJson(core.Map _json) { |
| 381 if (_json.containsKey("kind")) { |
| 382 kind = _json["kind"]; |
| 383 } |
| 384 } |
| 385 |
| 386 core.Map toJson() { |
| 387 var _json = new core.Map(); |
| 388 if (kind != null) { |
| 389 _json["kind"] = kind; |
| 390 } |
| 391 return _json; |
| 392 } |
| 393 } |
| 394 |
| 395 |
| 396 /** The response of cloudmonitoring.metricDescriptors.list. */ |
| 397 class ListMetricDescriptorsResponse { |
| 398 /** |
| 399 * Identifies what kind of resource this is. Value: the fixed string |
| 400 * "cloudmonitoring#listMetricDescriptorsResponse". |
| 401 */ |
| 402 core.String kind; |
| 403 |
| 404 /** The returned metric descriptors. */ |
| 405 core.List<MetricDescriptor> metrics; |
| 406 |
| 407 /** |
| 408 * Pagination token. If present, indicates that additional results are |
| 409 * available for retrieval. To access the results past the pagination limit, |
| 410 * pass this value to the pageToken query parameter. |
| 411 */ |
| 412 core.String nextPageToken; |
| 413 |
| 414 |
| 415 ListMetricDescriptorsResponse(); |
| 416 |
| 417 ListMetricDescriptorsResponse.fromJson(core.Map _json) { |
| 418 if (_json.containsKey("kind")) { |
| 419 kind = _json["kind"]; |
| 420 } |
| 421 if (_json.containsKey("metrics")) { |
| 422 metrics = _json["metrics"].map((value) => new MetricDescriptor.fromJson(va
lue)).toList(); |
| 423 } |
| 424 if (_json.containsKey("nextPageToken")) { |
| 425 nextPageToken = _json["nextPageToken"]; |
| 426 } |
| 427 } |
| 428 |
| 429 core.Map toJson() { |
| 430 var _json = new core.Map(); |
| 431 if (kind != null) { |
| 432 _json["kind"] = kind; |
| 433 } |
| 434 if (metrics != null) { |
| 435 _json["metrics"] = metrics.map((value) => (value).toJson()).toList(); |
| 436 } |
| 437 if (nextPageToken != null) { |
| 438 _json["nextPageToken"] = nextPageToken; |
| 439 } |
| 440 return _json; |
| 441 } |
| 442 } |
| 443 |
| 444 |
| 445 /** The request of cloudmonitoring.timeseriesDescriptors.list */ |
| 446 class ListTimeseriesDescriptorsRequest { |
| 447 /** |
| 448 * Identifies what kind of resource this is. Value: the fixed string |
| 449 * "cloudmonitoring#listTimeseriesDescriptorsRequest". |
| 450 */ |
| 451 core.String kind; |
| 452 |
| 453 |
| 454 ListTimeseriesDescriptorsRequest(); |
| 455 |
| 456 ListTimeseriesDescriptorsRequest.fromJson(core.Map _json) { |
| 457 if (_json.containsKey("kind")) { |
| 458 kind = _json["kind"]; |
| 459 } |
| 460 } |
| 461 |
| 462 core.Map toJson() { |
| 463 var _json = new core.Map(); |
| 464 if (kind != null) { |
| 465 _json["kind"] = kind; |
| 466 } |
| 467 return _json; |
| 468 } |
| 469 } |
| 470 |
| 471 |
| 472 /** The response of cloudmonitoring.timeseriesDescriptors.list */ |
| 473 class ListTimeseriesDescriptorsResponse { |
| 474 /** |
| 475 * Identifies what kind of resource this is. Value: the fixed string |
| 476 * "cloudmonitoring#listTimeseriesDescriptorsResponse". |
| 477 */ |
| 478 core.String kind; |
| 479 |
| 480 /** |
| 481 * Pagination token. If present, indicates that additional results are |
| 482 * available for retrieval. To access the results past the pagination limit, |
| 483 * set this value to the pageToken query parameter. |
| 484 */ |
| 485 core.String nextPageToken; |
| 486 |
| 487 /** |
| 488 * The oldest timestamp of the interval of this query, as an RFC 3339 string. |
| 489 */ |
| 490 core.DateTime oldest; |
| 491 |
| 492 /** The returned time series descriptors. */ |
| 493 core.List<TimeseriesDescriptor> timeseries; |
| 494 |
| 495 /** |
| 496 * The youngest timestamp of the interval of this query, as an RFC 3339 |
| 497 * string. |
| 498 */ |
| 499 core.DateTime youngest; |
| 500 |
| 501 |
| 502 ListTimeseriesDescriptorsResponse(); |
| 503 |
| 504 ListTimeseriesDescriptorsResponse.fromJson(core.Map _json) { |
| 505 if (_json.containsKey("kind")) { |
| 506 kind = _json["kind"]; |
| 507 } |
| 508 if (_json.containsKey("nextPageToken")) { |
| 509 nextPageToken = _json["nextPageToken"]; |
| 510 } |
| 511 if (_json.containsKey("oldest")) { |
| 512 oldest = core.DateTime.parse(_json["oldest"]); |
| 513 } |
| 514 if (_json.containsKey("timeseries")) { |
| 515 timeseries = _json["timeseries"].map((value) => new TimeseriesDescriptor.f
romJson(value)).toList(); |
| 516 } |
| 517 if (_json.containsKey("youngest")) { |
| 518 youngest = core.DateTime.parse(_json["youngest"]); |
| 519 } |
| 520 } |
| 521 |
| 522 core.Map toJson() { |
| 523 var _json = new core.Map(); |
| 524 if (kind != null) { |
| 525 _json["kind"] = kind; |
| 526 } |
| 527 if (nextPageToken != null) { |
| 528 _json["nextPageToken"] = nextPageToken; |
| 529 } |
| 530 if (oldest != null) { |
| 531 _json["oldest"] = (oldest).toIso8601String(); |
| 532 } |
| 533 if (timeseries != null) { |
| 534 _json["timeseries"] = timeseries.map((value) => (value).toJson()).toList()
; |
| 535 } |
| 536 if (youngest != null) { |
| 537 _json["youngest"] = (youngest).toIso8601String(); |
| 538 } |
| 539 return _json; |
| 540 } |
| 541 } |
| 542 |
| 543 |
| 544 /** The request of cloudmonitoring.timeseries.list */ |
| 545 class ListTimeseriesRequest { |
| 546 /** |
| 547 * Identifies what kind of resource this is. Value: the fixed string |
| 548 * "cloudmonitoring#listTimeseriesRequest". |
| 549 */ |
| 550 core.String kind; |
| 551 |
| 552 |
| 553 ListTimeseriesRequest(); |
| 554 |
| 555 ListTimeseriesRequest.fromJson(core.Map _json) { |
| 556 if (_json.containsKey("kind")) { |
| 557 kind = _json["kind"]; |
| 558 } |
| 559 } |
| 560 |
| 561 core.Map toJson() { |
| 562 var _json = new core.Map(); |
| 563 if (kind != null) { |
| 564 _json["kind"] = kind; |
| 565 } |
| 566 return _json; |
| 567 } |
| 568 } |
| 569 |
| 570 |
| 571 /** The response of cloudmonitoring.timeseries.list */ |
| 572 class ListTimeseriesResponse { |
| 573 /** |
| 574 * Identifies what kind of resource this is. Value: the fixed string |
| 575 * "cloudmonitoring#listTimeseriesResponse". |
| 576 */ |
| 577 core.String kind; |
| 578 |
| 579 /** |
| 580 * Pagination token. If present, indicates that additional results are |
| 581 * available for retrieval. To access the results past the pagination limit, |
| 582 * set the pageToken query parameter to this value. All of the points of a |
| 583 * time series will be returned before returning any point of the subsequent |
| 584 * time series. |
| 585 */ |
| 586 core.String nextPageToken; |
| 587 |
| 588 /** |
| 589 * The oldest timestamp of the interval of this query as an RFC 3339 string. |
| 590 */ |
| 591 core.DateTime oldest; |
| 592 |
| 593 /** The returned time series. */ |
| 594 core.List<Timeseries> timeseries; |
| 595 |
| 596 /** |
| 597 * The youngest timestamp of the interval of this query as an RFC 3339 string. |
| 598 */ |
| 599 core.DateTime youngest; |
| 600 |
| 601 |
| 602 ListTimeseriesResponse(); |
| 603 |
| 604 ListTimeseriesResponse.fromJson(core.Map _json) { |
| 605 if (_json.containsKey("kind")) { |
| 606 kind = _json["kind"]; |
| 607 } |
| 608 if (_json.containsKey("nextPageToken")) { |
| 609 nextPageToken = _json["nextPageToken"]; |
| 610 } |
| 611 if (_json.containsKey("oldest")) { |
| 612 oldest = core.DateTime.parse(_json["oldest"]); |
| 613 } |
| 614 if (_json.containsKey("timeseries")) { |
| 615 timeseries = _json["timeseries"].map((value) => new Timeseries.fromJson(va
lue)).toList(); |
| 616 } |
| 617 if (_json.containsKey("youngest")) { |
| 618 youngest = core.DateTime.parse(_json["youngest"]); |
| 619 } |
| 620 } |
| 621 |
| 622 core.Map toJson() { |
| 623 var _json = new core.Map(); |
| 624 if (kind != null) { |
| 625 _json["kind"] = kind; |
| 626 } |
| 627 if (nextPageToken != null) { |
| 628 _json["nextPageToken"] = nextPageToken; |
| 629 } |
| 630 if (oldest != null) { |
| 631 _json["oldest"] = (oldest).toIso8601String(); |
| 632 } |
| 633 if (timeseries != null) { |
| 634 _json["timeseries"] = timeseries.map((value) => (value).toJson()).toList()
; |
| 635 } |
| 636 if (youngest != null) { |
| 637 _json["youngest"] = (youngest).toIso8601String(); |
| 638 } |
| 639 return _json; |
| 640 } |
| 641 } |
| 642 |
| 643 |
| 644 /** |
| 645 * A metricDescriptor defines the name, label keys, and data type of a |
| 646 * particular metric. |
| 647 */ |
| 648 class MetricDescriptor { |
| 649 /** Description of this metric. */ |
| 650 core.String description; |
| 651 |
| 652 /** Labels defined for this metric. */ |
| 653 core.List<MetricDescriptorLabelDescriptor> labels; |
| 654 |
| 655 /** The name of this metric. */ |
| 656 core.String name; |
| 657 |
| 658 /** The project ID to which the metric belongs. */ |
| 659 core.String project; |
| 660 |
| 661 /** Type description for this metric. */ |
| 662 MetricDescriptorTypeDescriptor typeDescriptor; |
| 663 |
| 664 |
| 665 MetricDescriptor(); |
| 666 |
| 667 MetricDescriptor.fromJson(core.Map _json) { |
| 668 if (_json.containsKey("description")) { |
| 669 description = _json["description"]; |
| 670 } |
| 671 if (_json.containsKey("labels")) { |
| 672 labels = _json["labels"].map((value) => new MetricDescriptorLabelDescripto
r.fromJson(value)).toList(); |
| 673 } |
| 674 if (_json.containsKey("name")) { |
| 675 name = _json["name"]; |
| 676 } |
| 677 if (_json.containsKey("project")) { |
| 678 project = _json["project"]; |
| 679 } |
| 680 if (_json.containsKey("typeDescriptor")) { |
| 681 typeDescriptor = new MetricDescriptorTypeDescriptor.fromJson(_json["typeDe
scriptor"]); |
| 682 } |
| 683 } |
| 684 |
| 685 core.Map toJson() { |
| 686 var _json = new core.Map(); |
| 687 if (description != null) { |
| 688 _json["description"] = description; |
| 689 } |
| 690 if (labels != null) { |
| 691 _json["labels"] = labels.map((value) => (value).toJson()).toList(); |
| 692 } |
| 693 if (name != null) { |
| 694 _json["name"] = name; |
| 695 } |
| 696 if (project != null) { |
| 697 _json["project"] = project; |
| 698 } |
| 699 if (typeDescriptor != null) { |
| 700 _json["typeDescriptor"] = (typeDescriptor).toJson(); |
| 701 } |
| 702 return _json; |
| 703 } |
| 704 } |
| 705 |
| 706 |
| 707 /** |
| 708 * A label in a metric is a description of this metric, including the key of |
| 709 * this description (what the description is), and the value for this |
| 710 * description. |
| 711 */ |
| 712 class MetricDescriptorLabelDescriptor { |
| 713 /** Label description. */ |
| 714 core.String description; |
| 715 |
| 716 /** Label key. */ |
| 717 core.String key; |
| 718 |
| 719 |
| 720 MetricDescriptorLabelDescriptor(); |
| 721 |
| 722 MetricDescriptorLabelDescriptor.fromJson(core.Map _json) { |
| 723 if (_json.containsKey("description")) { |
| 724 description = _json["description"]; |
| 725 } |
| 726 if (_json.containsKey("key")) { |
| 727 key = _json["key"]; |
| 728 } |
| 729 } |
| 730 |
| 731 core.Map toJson() { |
| 732 var _json = new core.Map(); |
| 733 if (description != null) { |
| 734 _json["description"] = description; |
| 735 } |
| 736 if (key != null) { |
| 737 _json["key"] = key; |
| 738 } |
| 739 return _json; |
| 740 } |
| 741 } |
| 742 |
| 743 |
| 744 /** |
| 745 * A type in a metric contains information about how the metric is collected and |
| 746 * what its data points look like. |
| 747 */ |
| 748 class MetricDescriptorTypeDescriptor { |
| 749 /** The method of collecting data for the metric. */ |
| 750 core.String metricType; |
| 751 |
| 752 /** |
| 753 * The type of data that is written to a timeseries point for this metric. |
| 754 */ |
| 755 core.String valueType; |
| 756 |
| 757 |
| 758 MetricDescriptorTypeDescriptor(); |
| 759 |
| 760 MetricDescriptorTypeDescriptor.fromJson(core.Map _json) { |
| 761 if (_json.containsKey("metricType")) { |
| 762 metricType = _json["metricType"]; |
| 763 } |
| 764 if (_json.containsKey("valueType")) { |
| 765 valueType = _json["valueType"]; |
| 766 } |
| 767 } |
| 768 |
| 769 core.Map toJson() { |
| 770 var _json = new core.Map(); |
| 771 if (metricType != null) { |
| 772 _json["metricType"] = metricType; |
| 773 } |
| 774 if (valueType != null) { |
| 775 _json["valueType"] = valueType; |
| 776 } |
| 777 return _json; |
| 778 } |
| 779 } |
| 780 |
| 781 |
| 782 /** |
| 783 * Point is a single point in a time series. It consists of a start time, an end |
| 784 * time, and a value. |
| 785 */ |
| 786 class Point { |
| 787 /** The value of this data point. Either "true" or "false". */ |
| 788 core.bool boolValue; |
| 789 |
| 790 /** |
| 791 * The value of this data point as a distribution. A distribution value can |
| 792 * contain a list of buckets and/or an underflowBucket and an overflowBucket. |
| 793 * The values of these points can be used to create a histogram. |
| 794 */ |
| 795 PointDistribution distributionValue; |
| 796 |
| 797 /** |
| 798 * The value of this data point as a double-precision floating-point number. |
| 799 */ |
| 800 core.double doubleValue; |
| 801 |
| 802 /** |
| 803 * The interval [start, end] is the time period to which the point's value |
| 804 * applies. For gauge metrics, whose values are instantaneous measurements, |
| 805 * this interval should be empty (start should equal end). For cumulative |
| 806 * metrics (of which deltas and rates are special cases), the interval should |
| 807 * be non-empty. Both start and end are RFC 3999 strings. |
| 808 */ |
| 809 core.DateTime end; |
| 810 |
| 811 /** The value of this data point as a 64-bit integer. */ |
| 812 core.String int64Value; |
| 813 |
| 814 /** |
| 815 * The interval [start, end] is the time period to which the point's value |
| 816 * applies. For gauge metrics, whose values are instantaneous measurements, |
| 817 * this interval should be empty (start should equal end). For cumulative |
| 818 * metrics (of which deltas and rates are special cases), the interval should |
| 819 * be non-empty. Both start and end are RFC 3999 strings. |
| 820 */ |
| 821 core.DateTime start; |
| 822 |
| 823 /** The value of this data point in string format. */ |
| 824 core.String stringValue; |
| 825 |
| 826 |
| 827 Point(); |
| 828 |
| 829 Point.fromJson(core.Map _json) { |
| 830 if (_json.containsKey("boolValue")) { |
| 831 boolValue = _json["boolValue"]; |
| 832 } |
| 833 if (_json.containsKey("distributionValue")) { |
| 834 distributionValue = new PointDistribution.fromJson(_json["distributionValu
e"]); |
| 835 } |
| 836 if (_json.containsKey("doubleValue")) { |
| 837 doubleValue = _json["doubleValue"]; |
| 838 } |
| 839 if (_json.containsKey("end")) { |
| 840 end = core.DateTime.parse(_json["end"]); |
| 841 } |
| 842 if (_json.containsKey("int64Value")) { |
| 843 int64Value = _json["int64Value"]; |
| 844 } |
| 845 if (_json.containsKey("start")) { |
| 846 start = core.DateTime.parse(_json["start"]); |
| 847 } |
| 848 if (_json.containsKey("stringValue")) { |
| 849 stringValue = _json["stringValue"]; |
| 850 } |
| 851 } |
| 852 |
| 853 core.Map toJson() { |
| 854 var _json = new core.Map(); |
| 855 if (boolValue != null) { |
| 856 _json["boolValue"] = boolValue; |
| 857 } |
| 858 if (distributionValue != null) { |
| 859 _json["distributionValue"] = (distributionValue).toJson(); |
| 860 } |
| 861 if (doubleValue != null) { |
| 862 _json["doubleValue"] = doubleValue; |
| 863 } |
| 864 if (end != null) { |
| 865 _json["end"] = (end).toIso8601String(); |
| 866 } |
| 867 if (int64Value != null) { |
| 868 _json["int64Value"] = int64Value; |
| 869 } |
| 870 if (start != null) { |
| 871 _json["start"] = (start).toIso8601String(); |
| 872 } |
| 873 if (stringValue != null) { |
| 874 _json["stringValue"] = stringValue; |
| 875 } |
| 876 return _json; |
| 877 } |
| 878 } |
| 879 |
| 880 |
| 881 /** |
| 882 * Distribution data point value type. When writing distribution points, try to |
| 883 * be consistent with the boundaries of your buckets. If you must modify the |
| 884 * bucket boundaries, then do so by merging, partitioning, or appending rather |
| 885 * than skewing them. |
| 886 */ |
| 887 class PointDistribution { |
| 888 /** The finite buckets. */ |
| 889 core.List<PointDistributionBucket> buckets; |
| 890 |
| 891 /** The overflow bucket. */ |
| 892 PointDistributionOverflowBucket overflowBucket; |
| 893 |
| 894 /** The underflow bucket. */ |
| 895 PointDistributionUnderflowBucket underflowBucket; |
| 896 |
| 897 |
| 898 PointDistribution(); |
| 899 |
| 900 PointDistribution.fromJson(core.Map _json) { |
| 901 if (_json.containsKey("buckets")) { |
| 902 buckets = _json["buckets"].map((value) => new PointDistributionBucket.from
Json(value)).toList(); |
| 903 } |
| 904 if (_json.containsKey("overflowBucket")) { |
| 905 overflowBucket = new PointDistributionOverflowBucket.fromJson(_json["overf
lowBucket"]); |
| 906 } |
| 907 if (_json.containsKey("underflowBucket")) { |
| 908 underflowBucket = new PointDistributionUnderflowBucket.fromJson(_json["und
erflowBucket"]); |
| 909 } |
| 910 } |
| 911 |
| 912 core.Map toJson() { |
| 913 var _json = new core.Map(); |
| 914 if (buckets != null) { |
| 915 _json["buckets"] = buckets.map((value) => (value).toJson()).toList(); |
| 916 } |
| 917 if (overflowBucket != null) { |
| 918 _json["overflowBucket"] = (overflowBucket).toJson(); |
| 919 } |
| 920 if (underflowBucket != null) { |
| 921 _json["underflowBucket"] = (underflowBucket).toJson(); |
| 922 } |
| 923 return _json; |
| 924 } |
| 925 } |
| 926 |
| 927 |
| 928 /** |
| 929 * The histogram's bucket. Buckets that form the histogram of a distribution |
| 930 * value. If the upper bound of a bucket, say U1, does not equal the lower bound |
| 931 * of the next bucket, say L2, this means that there is no event in [U1, L2). |
| 932 */ |
| 933 class PointDistributionBucket { |
| 934 /** |
| 935 * The number of events whose values are in the interval defined by this |
| 936 * bucket. |
| 937 */ |
| 938 core.String count; |
| 939 |
| 940 /** The lower bound of the value interval of this bucket (inclusive). */ |
| 941 core.double lowerBound; |
| 942 |
| 943 /** The upper bound of the value interval of this bucket (exclusive). */ |
| 944 core.double upperBound; |
| 945 |
| 946 |
| 947 PointDistributionBucket(); |
| 948 |
| 949 PointDistributionBucket.fromJson(core.Map _json) { |
| 950 if (_json.containsKey("count")) { |
| 951 count = _json["count"]; |
| 952 } |
| 953 if (_json.containsKey("lowerBound")) { |
| 954 lowerBound = _json["lowerBound"]; |
| 955 } |
| 956 if (_json.containsKey("upperBound")) { |
| 957 upperBound = _json["upperBound"]; |
| 958 } |
| 959 } |
| 960 |
| 961 core.Map toJson() { |
| 962 var _json = new core.Map(); |
| 963 if (count != null) { |
| 964 _json["count"] = count; |
| 965 } |
| 966 if (lowerBound != null) { |
| 967 _json["lowerBound"] = lowerBound; |
| 968 } |
| 969 if (upperBound != null) { |
| 970 _json["upperBound"] = upperBound; |
| 971 } |
| 972 return _json; |
| 973 } |
| 974 } |
| 975 |
| 976 |
| 977 /** |
| 978 * The overflow bucket is a special bucket that does not have the upperBound |
| 979 * field; it includes all of the events that are no less than its lower bound. |
| 980 */ |
| 981 class PointDistributionOverflowBucket { |
| 982 /** |
| 983 * The number of events whose values are in the interval defined by this |
| 984 * bucket. |
| 985 */ |
| 986 core.String count; |
| 987 |
| 988 /** The lower bound of the value interval of this bucket (inclusive). */ |
| 989 core.double lowerBound; |
| 990 |
| 991 |
| 992 PointDistributionOverflowBucket(); |
| 993 |
| 994 PointDistributionOverflowBucket.fromJson(core.Map _json) { |
| 995 if (_json.containsKey("count")) { |
| 996 count = _json["count"]; |
| 997 } |
| 998 if (_json.containsKey("lowerBound")) { |
| 999 lowerBound = _json["lowerBound"]; |
| 1000 } |
| 1001 } |
| 1002 |
| 1003 core.Map toJson() { |
| 1004 var _json = new core.Map(); |
| 1005 if (count != null) { |
| 1006 _json["count"] = count; |
| 1007 } |
| 1008 if (lowerBound != null) { |
| 1009 _json["lowerBound"] = lowerBound; |
| 1010 } |
| 1011 return _json; |
| 1012 } |
| 1013 } |
| 1014 |
| 1015 |
| 1016 /** |
| 1017 * The underflow bucket is a special bucket that does not have the lowerBound |
| 1018 * field; it includes all of the events that are less than its upper bound. |
| 1019 */ |
| 1020 class PointDistributionUnderflowBucket { |
| 1021 /** |
| 1022 * The number of events whose values are in the interval defined by this |
| 1023 * bucket. |
| 1024 */ |
| 1025 core.String count; |
| 1026 |
| 1027 /** The upper bound of the value interval of this bucket (exclusive). */ |
| 1028 core.double upperBound; |
| 1029 |
| 1030 |
| 1031 PointDistributionUnderflowBucket(); |
| 1032 |
| 1033 PointDistributionUnderflowBucket.fromJson(core.Map _json) { |
| 1034 if (_json.containsKey("count")) { |
| 1035 count = _json["count"]; |
| 1036 } |
| 1037 if (_json.containsKey("upperBound")) { |
| 1038 upperBound = _json["upperBound"]; |
| 1039 } |
| 1040 } |
| 1041 |
| 1042 core.Map toJson() { |
| 1043 var _json = new core.Map(); |
| 1044 if (count != null) { |
| 1045 _json["count"] = count; |
| 1046 } |
| 1047 if (upperBound != null) { |
| 1048 _json["upperBound"] = upperBound; |
| 1049 } |
| 1050 return _json; |
| 1051 } |
| 1052 } |
| 1053 |
| 1054 |
| 1055 /** |
| 1056 * The monitoring data is organized as metrics and stored as data points that |
| 1057 * are recorded over time. Each data point represents information like the CPU |
| 1058 * utilization of your virtual machine. A historical record of these data points |
| 1059 * is called a time series. |
| 1060 */ |
| 1061 class Timeseries { |
| 1062 /** |
| 1063 * The data points of this time series. The points are listed in order of |
| 1064 * their end timestamp, from younger to older. |
| 1065 */ |
| 1066 core.List<Point> points; |
| 1067 |
| 1068 /** The descriptor of this time series. */ |
| 1069 TimeseriesDescriptor timeseriesDesc; |
| 1070 |
| 1071 |
| 1072 Timeseries(); |
| 1073 |
| 1074 Timeseries.fromJson(core.Map _json) { |
| 1075 if (_json.containsKey("points")) { |
| 1076 points = _json["points"].map((value) => new Point.fromJson(value)).toList(
); |
| 1077 } |
| 1078 if (_json.containsKey("timeseriesDesc")) { |
| 1079 timeseriesDesc = new TimeseriesDescriptor.fromJson(_json["timeseriesDesc"]
); |
| 1080 } |
| 1081 } |
| 1082 |
| 1083 core.Map toJson() { |
| 1084 var _json = new core.Map(); |
| 1085 if (points != null) { |
| 1086 _json["points"] = points.map((value) => (value).toJson()).toList(); |
| 1087 } |
| 1088 if (timeseriesDesc != null) { |
| 1089 _json["timeseriesDesc"] = (timeseriesDesc).toJson(); |
| 1090 } |
| 1091 return _json; |
| 1092 } |
| 1093 } |
| 1094 |
| 1095 |
| 1096 /** TimeseriesDescriptor identifies a single time series. */ |
| 1097 class TimeseriesDescriptor { |
| 1098 /** |
| 1099 * The set of key-value pairs that describe this time series, including |
| 1100 * target-specific labels and metric-specific labels. |
| 1101 */ |
| 1102 core.Map<core.String, core.String> labels; |
| 1103 |
| 1104 /** The name of the metric. */ |
| 1105 core.String metric; |
| 1106 |
| 1107 /** |
| 1108 * The Developers Console project number to which this time series belongs. |
| 1109 */ |
| 1110 core.String project; |
| 1111 |
| 1112 |
| 1113 TimeseriesDescriptor(); |
| 1114 |
| 1115 TimeseriesDescriptor.fromJson(core.Map _json) { |
| 1116 if (_json.containsKey("labels")) { |
| 1117 labels = _json["labels"]; |
| 1118 } |
| 1119 if (_json.containsKey("metric")) { |
| 1120 metric = _json["metric"]; |
| 1121 } |
| 1122 if (_json.containsKey("project")) { |
| 1123 project = _json["project"]; |
| 1124 } |
| 1125 } |
| 1126 |
| 1127 core.Map toJson() { |
| 1128 var _json = new core.Map(); |
| 1129 if (labels != null) { |
| 1130 _json["labels"] = labels; |
| 1131 } |
| 1132 if (metric != null) { |
| 1133 _json["metric"] = metric; |
| 1134 } |
| 1135 if (project != null) { |
| 1136 _json["project"] = project; |
| 1137 } |
| 1138 return _json; |
| 1139 } |
| 1140 } |
| 1141 |
| 1142 |
OLD | NEW |