removeInstances method

Removes one or more instances from the specified instance group, but does not delete those instances.

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 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

Future<Operation> removeInstances(
  RemoveInstancesInstanceGroupRequest request,
) async {
  final url = _endPoint.replace(
    path:
        '/compute/v1/projects/${request.project}/zones/${request.zone}/instanceGroups/${request.instanceGroup}/removeInstances',
    queryParameters: {'requestId': ?request.requestId},
  );
  final response = await _client.post(
    url,
    body: request.instanceGroupsRemoveInstancesRequestResource,
  );
  return Operation.fromJson(response);
}