list method

Future<ListMonitoredResourceDescriptorsResponse> list (
  1. String name,
  2. {String filter,
  3. String pageToken,
  4. int pageSize,
  5. String $fields}
)

Lists monitored resource descriptors that match a filter. This method does not require a Workspace.

Request parameters:

name - Required. The project on which to execute the request. The format is: projects/PROJECT_ID_OR_NUMBER

Value must have pattern "^projects/^/+$".

filter - An optional filter (https://cloud.google.com/monitoring/api/v3/filters) describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: resource.type = starts_with("gce_") AND resource.label:id

pageToken - 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.

pageSize - A positive number that is the maximum number of results to return.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListMonitoredResourceDescriptorsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ListMonitoredResourceDescriptorsResponse> list(core.String name,
    {core.String filter,
    core.String pageToken,
    core.int pageSize,
    core.String $fields}) {
  var _url;
  var _queryParams = new core.Map<core.String, core.List<core.String>>();
  var _uploadMedia;
  var _uploadOptions;
  var _downloadOptions = commons.DownloadOptions.Metadata;
  var _body;

  if (name == null) {
    throw new core.ArgumentError("Parameter name is required.");
  }
  if (filter != null) {
    _queryParams["filter"] = [filter];
  }
  if (pageToken != null) {
    _queryParams["pageToken"] = [pageToken];
  }
  if (pageSize != null) {
    _queryParams["pageSize"] = ["${pageSize}"];
  }
  if ($fields != null) {
    _queryParams["fields"] = [$fields];
  }

  _url = 'v3/' +
      commons.Escaper.ecapeVariableReserved('$name') +
      '/monitoredResourceDescriptors';

  var _response = _requester.request(_url, "GET",
      body: _body,
      queryParams: _queryParams,
      uploadOptions: _uploadOptions,
      uploadMedia: _uploadMedia,
      downloadOptions: _downloadOptions);
  return _response.then(
      (data) => new ListMonitoredResourceDescriptorsResponse.fromJson(data));
}