patch method
Updates an instance configuration.
The returned long-running operation can be used to track the progress of
updating the instance. If the named instance configuration does not exist,
returns NOT_FOUND
. Only user-managed configurations can be updated.
Immediately after the request returns: * The instance configuration's
reconciling field is set to true. While the operation is pending: *
Cancelling the operation sets its metadata's cancel_time. The operation is
guaranteed to succeed at undoing all changes, after which point it
terminates with a CANCELLED
status. * All other attempts to modify the
instance configuration are rejected. * Reading the instance configuration
via the API continues to give the pre-request values. Upon completion of
the returned operation: * Creating instances using the instance
configuration uses the new values. * The new values of the instance
configuration are readable via the API. * The instance configuration's
reconciling field becomes false. The returned long-running operation will
have a name of the format /operations/
and can be used to track the
instance configuration modification. The metadata field type is
UpdateInstanceConfigMetadata. The response field type is InstanceConfig,
if successful. Authorization requires spanner.instanceConfigs.update
permission on the resource name.
request
- The metadata request object.
Request parameters:
name
- A unique identifier for the instance configuration. Values are of
the form projects//instanceConfigs/a-z*
. User instance configuration
must start with custom-
.
Value must have pattern ^projects/\[^/\]+/instanceConfigs/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
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<Operation> patch(
UpdateInstanceConfigRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}