stop method

  1. @override
Future<Operation> stop(
  1. StopInstanceRequest request
)
override

Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, seeStopping an instance.

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> stop(StopInstanceRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_stop case final stop?) {
    return stop(request);
  }
  throw UnsupportedError('stop');
}