setScheduling method

  1. @override
Future<Operation> setScheduling(
  1. SetSchedulingInstanceRequest request
)
override

Sets an instance's scheduling options. You can only call this method on astopped instance, that is, a VM instance that is in a TERMINATED state. SeeInstance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, seeSet VM host maintenance policy.

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

  if (_setScheduling case final setScheduling?) {
    return setScheduling(request);
  }
  throw UnsupportedError('setScheduling');
}