list method

Future<ListClustersResponse> list(
  1. String projectId,
  2. String region, {
  3. String? filter,
  4. int? pageSize,
  5. String? pageToken,
  6. String? $fields,
})

Lists all regions/{region}/clusters in a project alphabetically.

Request parameters:

projectId - Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region - Required. The Dataproc region in which to handle the request.

filter - Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, UPDATING, STOPPING, or STOPPED. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING, ERROR, STOPPING, and STOPPED states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

pageSize - Optional. The standard List page size.

pageToken - Optional. The standard List page token.

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

Completes with a ListClustersResponse.

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<ListClustersResponse> list(
  core.String projectId,
  core.String region, {
  core.String? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (filter != null) 'filter': [filter],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/projects/' +
      commons.escapeVariable('$projectId') +
      '/regions/' +
      commons.escapeVariable('$region') +
      '/clusters';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListClustersResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}