Skip to main content

Scheduling

Struct Scheduling 

Source
#[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 */
}
Available on crate features 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Source

pub fn new() -> Self

Source

pub fn set_automatic_restart<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of automatic_restart.

§Example
let x = Scheduling::new().set_automatic_restart(true);
Source

pub fn set_or_clear_automatic_restart<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

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>);
Source

pub fn set_availability_domain<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of availability_domain.

§Example
let x = Scheduling::new().set_availability_domain(42);
Source

pub fn set_or_clear_availability_domain<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

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>);
Source

pub fn set_host_error_timeout_seconds<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of host_error_timeout_seconds.

§Example
let x = Scheduling::new().set_host_error_timeout_seconds(42);
Source

pub fn set_or_clear_host_error_timeout_seconds<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

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>);
Source

pub fn set_instance_termination_action<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_instance_termination_action<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_local_ssd_recovery_timeout<T>(self, v: T) -> Self
where T: Into<Duration>,

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 */);
Source

pub fn set_or_clear_local_ssd_recovery_timeout<T>(self, v: Option<T>) -> Self
where T: Into<Duration>,

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>);
Source

pub fn set_location_hint<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of location_hint.

§Example
let x = Scheduling::new().set_location_hint("example");
Source

pub fn set_or_clear_location_hint<T>(self, v: Option<T>) -> Self
where T: Into<String>,

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>);
Source

pub fn set_max_run_duration<T>(self, v: T) -> Self
where T: Into<Duration>,

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 */);
Source

pub fn set_or_clear_max_run_duration<T>(self, v: Option<T>) -> Self
where T: Into<Duration>,

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>);
Source

pub fn set_min_node_cpus<T>(self, v: T) -> Self
where T: Into<i32>,

Sets the value of min_node_cpus.

§Example
let x = Scheduling::new().set_min_node_cpus(42);
Source

pub fn set_or_clear_min_node_cpus<T>(self, v: Option<T>) -> Self
where T: Into<i32>,

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>);
Source

pub fn set_node_affinities<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<SchedulingNodeAffinity>,

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 */,
    ]);
Source

pub fn set_on_host_maintenance<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_on_host_maintenance<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_on_instance_stop_action<T>(self, v: T) -> Self

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 */);
Source

pub fn set_or_clear_on_instance_stop_action<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_preemptible<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of preemptible.

§Example
let x = Scheduling::new().set_preemptible(true);
Source

pub fn set_or_clear_preemptible<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

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>);
Source

pub fn set_provisioning_model<T>(self, v: T) -> Self

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);
Source

pub fn set_or_clear_provisioning_model<T>(self, v: Option<T>) -> Self

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>);
Source

pub fn set_skip_guest_os_shutdown<T>(self, v: T) -> Self
where T: Into<bool>,

Sets the value of skip_guest_os_shutdown.

§Example
let x = Scheduling::new().set_skip_guest_os_shutdown(true);
Source

pub fn set_or_clear_skip_guest_os_shutdown<T>(self, v: Option<T>) -> Self
where T: Into<bool>,

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>);
Source

pub fn set_termination_time<T>(self, v: T) -> Self
where T: Into<String>,

Sets the value of termination_time.

§Example
let x = Scheduling::new().set_termination_time("example");
Source

pub fn set_or_clear_termination_time<T>(self, v: Option<T>) -> Self
where T: Into<String>,

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

Source§

fn clone(&self) -> Scheduling

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Scheduling

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Scheduling

Source§

fn default() -> Scheduling

Returns the “default value” for a type. Read more
Source§

impl Message for Scheduling

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Scheduling

Source§

fn eq(&self, other: &Scheduling) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Scheduling

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,