setScheduling method
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
Future<Operation> setScheduling(SetSchedulingInstanceRequest request) async {
final url = _endPoint.replace(
path:
'/compute/v1/projects/${request.project}/zones/${request.zone}/instances/${request.instance}/setScheduling',
queryParameters: {'requestId': ?request.requestId},
);
final response = await _client.post(url, body: request.schedulingResource);
return Operation.fromJson(response);
}