resize method
Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances.
The resize operation is marked DONE if theresize request is successful. The underlying actions take additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Throws a http.ClientException if there were problems communicating with
the API service. Throws a ServiceException if the API method failed for
any reason.
Implementation
@override
Future<Operation> resize(
ResizeRegionInstanceGroupManagerRequest request,
) async {
if (isClosed) throw StateError('Service is closed');
if (_resize case final resize?) {
return resize(request);
}
throw UnsupportedError('resize');
}