list method

Future<ListClustersResponse> list(
  1. String parent, {
  2. String? pageToken,
  3. String? $fields,
})

Lists information about clusters in an instance.

Request parameters:

parent - Required. The unique name of the instance for which a list of clusters is requested. Values are of the form projects/{project}/instances/{instance}. Use {instance} = '-' to list Clusters for all Instances in a project, e.g., projects/myproject/instances/-. Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+$.

pageToken - DEPRECATED: This field is unused and ignored.

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

  final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/clusters';

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