get method

Future<Instance> get(
  1. String name, {
  2. String? view,
  3. String? $fields,
})

Gets details of a single Instance.

Request parameters:

name - Required. The name of the resource. For the required format, see the comment on the Instance.name field. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/clusters/\[^/\]+/instances/\[^/\]+$.

view - The view of the instance to return. Possible string values are:

  • "INSTANCE_VIEW_UNSPECIFIED" : INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC.
  • "INSTANCE_VIEW_BASIC" : BASIC server responses for a primary or read instance include all the relevant instance details, excluding the details of each node in the instance. The default value.
  • "INSTANCE_VIEW_FULL" : FULL response is equivalent to BASIC for primary instance (for now). For read pool instance, this includes details of each node in the pool.

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

Completes with a Instance.

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<Instance> 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 Instance.fromJson(response_ as core.Map<core.String, core.dynamic>);
}