get method
Gets details of a single Cluster.
Request parameters:
name
- Required. The name of the resource. For the required format, see
the comment on the Cluster.name field.
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/clusters/\[^/\]+$
.
view
- Optional. The view of the cluster to return. Returns all default
fields if not set.
Possible string values are:
- "CLUSTER_VIEW_UNSPECIFIED" : CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
- "CLUSTER_VIEW_BASIC" : BASIC server responses include all the relevant cluster details, excluding Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific fields. The default value.
- "CLUSTER_VIEW_CONTINUOUS_BACKUP" : CONTINUOUS_BACKUP response returns all the fields from BASIC plus the earliest restorable time if continuous backups are enabled. May increase latency.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Cluster.
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<Cluster> get(
core.String name, {
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Cluster.fromJson(response_ as core.Map<core.String, core.dynamic>);
}