#[non_exhaustive]pub struct Scheduling {Show 15 fields
pub automatic_restart: Option<bool>,
pub availability_domain: Option<i32>,
pub host_error_timeout_seconds: Option<i32>,
pub instance_termination_action: Option<InstanceTerminationAction>,
pub local_ssd_recovery_timeout: Option<Duration>,
pub location_hint: Option<String>,
pub max_run_duration: Option<Duration>,
pub min_node_cpus: Option<i32>,
pub node_affinities: Vec<SchedulingNodeAffinity>,
pub on_host_maintenance: Option<OnHostMaintenance>,
pub on_instance_stop_action: Option<SchedulingOnInstanceStopAction>,
pub preemptible: Option<bool>,
pub provisioning_model: Option<ProvisioningModel>,
pub skip_guest_os_shutdown: Option<bool>,
pub termination_time: Option<String>,
/* private fields */
}instance-templates or instances or machine-images or region-instance-templates or region-instances only.Expand description
Sets the scheduling options for an Instance.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.automatic_restart: Option<bool>Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances.Preemptible instances cannot be automatically restarted.
By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine.
availability_domain: Option<i32>Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance.
host_error_timeout_seconds: Option<i32>Specify the time in seconds for host error detection, the value must be within the range of [90, 330] with the increment of 30, if unset, the default behavior of host error recovery will be used.
instance_termination_action: Option<InstanceTerminationAction>Specifies the termination action for the instance.
local_ssd_recovery_timeout: Option<Duration>Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour.
location_hint: Option<String>An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API.
max_run_duration: Option<Duration>Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration.
min_node_cpus: Option<i32>The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.
node_affinities: Vec<SchedulingNodeAffinity>A set of node affinity and anti-affinity configurations. Refer toConfiguring node affinity for more information. Overrides reservationAffinity.
on_host_maintenance: Option<OnHostMaintenance>Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. Forpreemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy.
on_instance_stop_action: Option<SchedulingOnInstanceStopAction>§preemptible: Option<bool>Defines whether the instance is preemptible. This can only be set during
instance creation or while the instance isstopped and
therefore, in a TERMINATED state. SeeInstance Life
Cycle for more information on the possible instance states.
provisioning_model: Option<ProvisioningModel>Specifies the provisioning model of the instance.
skip_guest_os_shutdown: Option<bool>Default is false and there will be 120 seconds between GCE ACPI G2 Soft Off and ACPI G3 Mechanical Off for Standard VMs and 30 seconds for Spot VMs.
termination_time: Option<String>Specifies the timestamp, when the instance will be terminated, inRFC3339 text format. If specified, the instance termination action will be performed at the termination time.
Implementations§
Source§impl Scheduling
impl Scheduling
pub fn new() -> Self
Sourcepub fn set_automatic_restart<T>(self, v: T) -> Self
pub fn set_automatic_restart<T>(self, v: T) -> Self
Sets the value of automatic_restart.
§Example
let x = Scheduling::new().set_automatic_restart(true);Sourcepub fn set_or_clear_automatic_restart<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_automatic_restart<T>(self, v: Option<T>) -> Self
Sets or clears the value of automatic_restart.
§Example
let x = Scheduling::new().set_or_clear_automatic_restart(Some(false));
let x = Scheduling::new().set_or_clear_automatic_restart(None::<bool>);Sourcepub fn set_availability_domain<T>(self, v: T) -> Self
pub fn set_availability_domain<T>(self, v: T) -> Self
Sets the value of availability_domain.
§Example
let x = Scheduling::new().set_availability_domain(42);Sourcepub fn set_or_clear_availability_domain<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_availability_domain<T>(self, v: Option<T>) -> Self
Sets or clears the value of availability_domain.
§Example
let x = Scheduling::new().set_or_clear_availability_domain(Some(42));
let x = Scheduling::new().set_or_clear_availability_domain(None::<i32>);Sourcepub fn set_host_error_timeout_seconds<T>(self, v: T) -> Self
pub fn set_host_error_timeout_seconds<T>(self, v: T) -> Self
Sets the value of host_error_timeout_seconds.
§Example
let x = Scheduling::new().set_host_error_timeout_seconds(42);Sourcepub fn set_or_clear_host_error_timeout_seconds<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_host_error_timeout_seconds<T>(self, v: Option<T>) -> Self
Sets or clears the value of host_error_timeout_seconds.
§Example
let x = Scheduling::new().set_or_clear_host_error_timeout_seconds(Some(42));
let x = Scheduling::new().set_or_clear_host_error_timeout_seconds(None::<i32>);Sourcepub fn set_instance_termination_action<T>(self, v: T) -> Selfwhere
T: Into<InstanceTerminationAction>,
pub fn set_instance_termination_action<T>(self, v: T) -> Selfwhere
T: Into<InstanceTerminationAction>,
Sets the value of instance_termination_action.
§Example
use google_cloud_compute_v1::model::scheduling::InstanceTerminationAction;
let x0 = Scheduling::new().set_instance_termination_action(InstanceTerminationAction::Unspecified);
let x1 = Scheduling::new().set_instance_termination_action(InstanceTerminationAction::Stop);Sourcepub fn set_or_clear_instance_termination_action<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceTerminationAction>,
pub fn set_or_clear_instance_termination_action<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceTerminationAction>,
Sets or clears the value of instance_termination_action.
§Example
use google_cloud_compute_v1::model::scheduling::InstanceTerminationAction;
let x0 = Scheduling::new().set_or_clear_instance_termination_action(Some(InstanceTerminationAction::Unspecified));
let x1 = Scheduling::new().set_or_clear_instance_termination_action(Some(InstanceTerminationAction::Stop));
let x_none = Scheduling::new().set_or_clear_instance_termination_action(None::<InstanceTerminationAction>);Sourcepub fn set_local_ssd_recovery_timeout<T>(self, v: T) -> Self
pub fn set_local_ssd_recovery_timeout<T>(self, v: T) -> Self
Sets the value of local_ssd_recovery_timeout.
§Example
use google_cloud_compute_v1::model::Duration;
let x = Scheduling::new().set_local_ssd_recovery_timeout(Duration::default()/* use setters */);Sourcepub fn set_or_clear_local_ssd_recovery_timeout<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_local_ssd_recovery_timeout<T>(self, v: Option<T>) -> Self
Sets or clears the value of local_ssd_recovery_timeout.
§Example
use google_cloud_compute_v1::model::Duration;
let x = Scheduling::new().set_or_clear_local_ssd_recovery_timeout(Some(Duration::default()/* use setters */));
let x = Scheduling::new().set_or_clear_local_ssd_recovery_timeout(None::<Duration>);Sourcepub fn set_location_hint<T>(self, v: T) -> Self
pub fn set_location_hint<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_location_hint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_location_hint<T>(self, v: Option<T>) -> Self
Sets or clears the value of location_hint.
§Example
let x = Scheduling::new().set_or_clear_location_hint(Some("example"));
let x = Scheduling::new().set_or_clear_location_hint(None::<String>);Sourcepub fn set_max_run_duration<T>(self, v: T) -> Self
pub fn set_max_run_duration<T>(self, v: T) -> Self
Sets the value of max_run_duration.
§Example
use google_cloud_compute_v1::model::Duration;
let x = Scheduling::new().set_max_run_duration(Duration::default()/* use setters */);Sourcepub fn set_or_clear_max_run_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_run_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_run_duration.
§Example
use google_cloud_compute_v1::model::Duration;
let x = Scheduling::new().set_or_clear_max_run_duration(Some(Duration::default()/* use setters */));
let x = Scheduling::new().set_or_clear_max_run_duration(None::<Duration>);Sourcepub fn set_min_node_cpus<T>(self, v: T) -> Self
pub fn set_min_node_cpus<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_min_node_cpus<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_min_node_cpus<T>(self, v: Option<T>) -> Self
Sets or clears the value of min_node_cpus.
§Example
let x = Scheduling::new().set_or_clear_min_node_cpus(Some(42));
let x = Scheduling::new().set_or_clear_min_node_cpus(None::<i32>);Sourcepub fn set_node_affinities<T, V>(self, v: T) -> Self
pub fn set_node_affinities<T, V>(self, v: T) -> Self
Sets the value of node_affinities.
§Example
use google_cloud_compute_v1::model::SchedulingNodeAffinity;
let x = Scheduling::new()
.set_node_affinities([
SchedulingNodeAffinity::default()/* use setters */,
SchedulingNodeAffinity::default()/* use (different) setters */,
]);Sourcepub fn set_on_host_maintenance<T>(self, v: T) -> Selfwhere
T: Into<OnHostMaintenance>,
pub fn set_on_host_maintenance<T>(self, v: T) -> Selfwhere
T: Into<OnHostMaintenance>,
Sets the value of on_host_maintenance.
§Example
use google_cloud_compute_v1::model::scheduling::OnHostMaintenance;
let x0 = Scheduling::new().set_on_host_maintenance(OnHostMaintenance::Terminate);Sourcepub fn set_or_clear_on_host_maintenance<T>(self, v: Option<T>) -> Selfwhere
T: Into<OnHostMaintenance>,
pub fn set_or_clear_on_host_maintenance<T>(self, v: Option<T>) -> Selfwhere
T: Into<OnHostMaintenance>,
Sets or clears the value of on_host_maintenance.
§Example
use google_cloud_compute_v1::model::scheduling::OnHostMaintenance;
let x0 = Scheduling::new().set_or_clear_on_host_maintenance(Some(OnHostMaintenance::Terminate));
let x_none = Scheduling::new().set_or_clear_on_host_maintenance(None::<OnHostMaintenance>);Sourcepub fn set_on_instance_stop_action<T>(self, v: T) -> Selfwhere
T: Into<SchedulingOnInstanceStopAction>,
pub fn set_on_instance_stop_action<T>(self, v: T) -> Selfwhere
T: Into<SchedulingOnInstanceStopAction>,
Sets the value of on_instance_stop_action.
§Example
use google_cloud_compute_v1::model::SchedulingOnInstanceStopAction;
let x = Scheduling::new().set_on_instance_stop_action(SchedulingOnInstanceStopAction::default()/* use setters */);Sourcepub fn set_or_clear_on_instance_stop_action<T>(self, v: Option<T>) -> Selfwhere
T: Into<SchedulingOnInstanceStopAction>,
pub fn set_or_clear_on_instance_stop_action<T>(self, v: Option<T>) -> Selfwhere
T: Into<SchedulingOnInstanceStopAction>,
Sets or clears the value of on_instance_stop_action.
§Example
use google_cloud_compute_v1::model::SchedulingOnInstanceStopAction;
let x = Scheduling::new().set_or_clear_on_instance_stop_action(Some(SchedulingOnInstanceStopAction::default()/* use setters */));
let x = Scheduling::new().set_or_clear_on_instance_stop_action(None::<SchedulingOnInstanceStopAction>);Sourcepub fn set_preemptible<T>(self, v: T) -> Self
pub fn set_preemptible<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_preemptible<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_preemptible<T>(self, v: Option<T>) -> Self
Sets or clears the value of preemptible.
§Example
let x = Scheduling::new().set_or_clear_preemptible(Some(false));
let x = Scheduling::new().set_or_clear_preemptible(None::<bool>);Sourcepub fn set_provisioning_model<T>(self, v: T) -> Selfwhere
T: Into<ProvisioningModel>,
pub fn set_provisioning_model<T>(self, v: T) -> Selfwhere
T: Into<ProvisioningModel>,
Sets the value of provisioning_model.
§Example
use google_cloud_compute_v1::model::scheduling::ProvisioningModel;
let x0 = Scheduling::new().set_provisioning_model(ProvisioningModel::ReservationBound);
let x1 = Scheduling::new().set_provisioning_model(ProvisioningModel::Spot);
let x2 = Scheduling::new().set_provisioning_model(ProvisioningModel::Standard);Sourcepub fn set_or_clear_provisioning_model<T>(self, v: Option<T>) -> Selfwhere
T: Into<ProvisioningModel>,
pub fn set_or_clear_provisioning_model<T>(self, v: Option<T>) -> Selfwhere
T: Into<ProvisioningModel>,
Sets or clears the value of provisioning_model.
§Example
use google_cloud_compute_v1::model::scheduling::ProvisioningModel;
let x0 = Scheduling::new().set_or_clear_provisioning_model(Some(ProvisioningModel::ReservationBound));
let x1 = Scheduling::new().set_or_clear_provisioning_model(Some(ProvisioningModel::Spot));
let x2 = Scheduling::new().set_or_clear_provisioning_model(Some(ProvisioningModel::Standard));
let x_none = Scheduling::new().set_or_clear_provisioning_model(None::<ProvisioningModel>);Sourcepub fn set_skip_guest_os_shutdown<T>(self, v: T) -> Self
pub fn set_skip_guest_os_shutdown<T>(self, v: T) -> Self
Sets the value of skip_guest_os_shutdown.
§Example
let x = Scheduling::new().set_skip_guest_os_shutdown(true);Sourcepub fn set_or_clear_skip_guest_os_shutdown<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_skip_guest_os_shutdown<T>(self, v: Option<T>) -> Self
Sets or clears the value of skip_guest_os_shutdown.
§Example
let x = Scheduling::new().set_or_clear_skip_guest_os_shutdown(Some(false));
let x = Scheduling::new().set_or_clear_skip_guest_os_shutdown(None::<bool>);Sourcepub fn set_termination_time<T>(self, v: T) -> Self
pub fn set_termination_time<T>(self, v: T) -> Self
Sets the value of termination_time.
§Example
let x = Scheduling::new().set_termination_time("example");Sourcepub fn set_or_clear_termination_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_termination_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of termination_time.
§Example
let x = Scheduling::new().set_or_clear_termination_time(Some("example"));
let x = Scheduling::new().set_or_clear_termination_time(None::<String>);Trait Implementations§
Source§impl Clone for Scheduling
impl Clone for Scheduling
Source§fn clone(&self) -> Scheduling
fn clone(&self) -> Scheduling
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more