deleteInstances method
Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of thedeleting action 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.
You can specify a maximum of 1000 instances with this method per request.
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> deleteInstances(
DeleteInstancesRegionInstanceGroupManagerRequest request,
) async {
if (isClosed) throw StateError('Service is closed');
if (_deleteInstances case final deleteInstances?) {
return deleteInstances(request);
}
throw UnsupportedError('deleteInstances');
}