WorkstationConfig

Struct WorkstationConfig 

Source
#[non_exhaustive]
pub struct WorkstationConfig {
Show 20 fields pub name: String, pub display_name: String, pub uid: String, pub reconciling: bool, pub annotations: HashMap<String, String>, pub labels: HashMap<String, String>, pub create_time: Option<Timestamp>, pub update_time: Option<Timestamp>, pub delete_time: Option<Timestamp>, pub etag: String, pub idle_timeout: Option<Duration>, pub running_timeout: Option<Duration>, pub host: Option<Host>, pub persistent_directories: Vec<PersistentDirectory>, pub container: Option<Container>, pub encryption_key: Option<CustomerEncryptionKey>, pub readiness_checks: Vec<ReadinessCheck>, pub replica_zones: Vec<String>, pub degraded: bool, pub conditions: Vec<Status>, /* private fields */
}
Expand description

A workstation configuration resource in the Cloud Workstations API.

Workstation configurations act as templates for workstations. The workstation configuration defines details such as the workstation virtual machine (VM) instance type, persistent storage, container image defining environment, which IDE or Code Editor to use, and more. Administrators and platform teams can also use Identity and Access Management (IAM) rules to grant access to teams or to individual developers.

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.
§name: String

Full name of this workstation configuration.

§display_name: String

Optional. Human-readable name for this workstation configuration.

§uid: String

Output only. A system-assigned unique identifier for this workstation configuration.

§reconciling: bool

Output only. Indicates whether this workstation configuration is currently being updated to match its intended state.

§annotations: HashMap<String, String>

Optional. Client-specified annotations.

§labels: HashMap<String, String>

Optional. Labels that are applied to the workstation configuration and that are also propagated to the underlying Compute Engine resources.

§create_time: Option<Timestamp>

Output only. Time when this workstation configuration was created.

§update_time: Option<Timestamp>

Output only. Time when this workstation configuration was most recently updated.

§delete_time: Option<Timestamp>

Output only. Time when this workstation configuration was soft-deleted.

§etag: String

Optional. Checksum computed by the server. May be sent on update and delete requests to make sure that the client has an up-to-date value before proceeding.

§idle_timeout: Option<Duration>

Optional. Number of seconds to wait before automatically stopping a workstation after it last received user traffic.

A value of "0s" indicates that Cloud Workstations VMs created with this configuration should never time out due to idleness. Provide duration terminated by s for seconds—for example, "7200s" (2 hours). The default is "1200s" (20 minutes).

§running_timeout: Option<Duration>

Optional. Number of seconds that a workstation can run until it is automatically shut down. We recommend that workstations be shut down daily to reduce costs and so that security updates can be applied upon restart. The idle_timeout and running_timeout fields are independent of each other. Note that the running_timeout field shuts down VMs after the specified time, regardless of whether or not the VMs are idle.

Provide duration terminated by s for seconds—for example, "54000s" (15 hours). Defaults to "43200s" (12 hours). A value of "0s" indicates that workstations using this configuration should never time out. If encryption_key is set, it must be greater than "0s" and less than "86400s" (24 hours).

Warning: A value of "0s" indicates that Cloud Workstations VMs created with this configuration have no maximum running time. This is strongly discouraged because you incur costs and will not pick up security updates.

§host: Option<Host>

Optional. Runtime host for the workstation.

§persistent_directories: Vec<PersistentDirectory>

Optional. Directories to persist across workstation sessions.

§container: Option<Container>

Optional. Container that runs upon startup for each workstation using this workstation configuration.

§encryption_key: Option<CustomerEncryptionKey>

Immutable. Encrypts resources of this workstation configuration using a customer-managed encryption key (CMEK).

If specified, the boot disk of the Compute Engine instance and the persistent disk are encrypted using this encryption key. If this field is not set, the disks are encrypted using a generated key. Customer-managed encryption keys do not protect disk metadata.

If the customer-managed encryption key is rotated, when the workstation instance is stopped, the system attempts to recreate the persistent disk with the new version of the key. Be sure to keep older versions of the key until the persistent disk is recreated. Otherwise, data on the persistent disk might be lost.

If the encryption key is revoked, the workstation session automatically stops within 7 hours.

Immutable after the workstation configuration is created.

§readiness_checks: Vec<ReadinessCheck>

Optional. Readiness checks to perform when starting a workstation using this workstation configuration. Mark a workstation as running only after all specified readiness checks return 200 status codes.

§replica_zones: Vec<String>

Optional. Immutable. Specifies the zones used to replicate the VM and disk resources within the region. If set, exactly two zones within the workstation cluster’s region must be specified—for example, ['us-central1-a', 'us-central1-f']. If this field is empty, two default zones within the region are used.

Immutable after the workstation configuration is created.

§degraded: bool

Output only. Whether this resource is degraded, in which case it may require user action to restore full functionality. See also the conditions field.

§conditions: Vec<Status>

Output only. Status conditions describing the current resource state.

Implementations§

Source§

impl WorkstationConfig

Source

pub fn new() -> Self

Source

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

Sets the value of name.

§Example
let x = WorkstationConfig::new().set_name("example");
Source

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

Sets the value of display_name.

§Example
let x = WorkstationConfig::new().set_display_name("example");
Source

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

Sets the value of uid.

§Example
let x = WorkstationConfig::new().set_uid("example");
Source

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

Sets the value of reconciling.

§Example
let x = WorkstationConfig::new().set_reconciling(true);
Source

pub fn set_annotations<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of annotations.

§Example
let x = WorkstationConfig::new().set_annotations([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = WorkstationConfig::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = WorkstationConfig::new().set_create_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = WorkstationConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = WorkstationConfig::new().set_update_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of update_time.

§Example
use wkt::Timestamp;
let x = WorkstationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_update_time(None::<Timestamp>);
Source

pub fn set_delete_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of delete_time.

§Example
use wkt::Timestamp;
let x = WorkstationConfig::new().set_delete_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of delete_time.

§Example
use wkt::Timestamp;
let x = WorkstationConfig::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_delete_time(None::<Timestamp>);
Source

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

Sets the value of etag.

§Example
let x = WorkstationConfig::new().set_etag("example");
Source

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

Sets the value of idle_timeout.

§Example
use wkt::Duration;
let x = WorkstationConfig::new().set_idle_timeout(Duration::default()/* use setters */);
Source

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

Sets or clears the value of idle_timeout.

§Example
use wkt::Duration;
let x = WorkstationConfig::new().set_or_clear_idle_timeout(Some(Duration::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_idle_timeout(None::<Duration>);
Source

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

Sets the value of running_timeout.

§Example
use wkt::Duration;
let x = WorkstationConfig::new().set_running_timeout(Duration::default()/* use setters */);
Source

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

Sets or clears the value of running_timeout.

§Example
use wkt::Duration;
let x = WorkstationConfig::new().set_or_clear_running_timeout(Some(Duration::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_running_timeout(None::<Duration>);
Source

pub fn set_host<T>(self, v: T) -> Self
where T: Into<Host>,

Sets the value of host.

§Example
use google_cloud_workstations_v1::model::workstation_config::Host;
let x = WorkstationConfig::new().set_host(Host::default()/* use setters */);
Source

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

Sets or clears the value of host.

§Example
use google_cloud_workstations_v1::model::workstation_config::Host;
let x = WorkstationConfig::new().set_or_clear_host(Some(Host::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_host(None::<Host>);
Source

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

Sets the value of persistent_directories.

§Example
use google_cloud_workstations_v1::model::workstation_config::PersistentDirectory;
let x = WorkstationConfig::new()
    .set_persistent_directories([
        PersistentDirectory::default()/* use setters */,
        PersistentDirectory::default()/* use (different) setters */,
    ]);
Source

pub fn set_container<T>(self, v: T) -> Self
where T: Into<Container>,

Sets the value of container.

§Example
use google_cloud_workstations_v1::model::workstation_config::Container;
let x = WorkstationConfig::new().set_container(Container::default()/* use setters */);
Source

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

Sets or clears the value of container.

§Example
use google_cloud_workstations_v1::model::workstation_config::Container;
let x = WorkstationConfig::new().set_or_clear_container(Some(Container::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_container(None::<Container>);
Source

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

Sets the value of encryption_key.

§Example
use google_cloud_workstations_v1::model::workstation_config::CustomerEncryptionKey;
let x = WorkstationConfig::new().set_encryption_key(CustomerEncryptionKey::default()/* use setters */);
Source

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

Sets or clears the value of encryption_key.

§Example
use google_cloud_workstations_v1::model::workstation_config::CustomerEncryptionKey;
let x = WorkstationConfig::new().set_or_clear_encryption_key(Some(CustomerEncryptionKey::default()/* use setters */));
let x = WorkstationConfig::new().set_or_clear_encryption_key(None::<CustomerEncryptionKey>);
Source

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

Sets the value of readiness_checks.

§Example
use google_cloud_workstations_v1::model::workstation_config::ReadinessCheck;
let x = WorkstationConfig::new()
    .set_readiness_checks([
        ReadinessCheck::default()/* use setters */,
        ReadinessCheck::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of replica_zones.

§Example
let x = WorkstationConfig::new().set_replica_zones(["a", "b", "c"]);
Source

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

Sets the value of degraded.

§Example
let x = WorkstationConfig::new().set_degraded(true);
Source

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

Sets the value of conditions.

§Example
use rpc::model::Status;
let x = WorkstationConfig::new()
    .set_conditions([
        Status::default()/* use setters */,
        Status::default()/* use (different) setters */,
    ]);

Trait Implementations§

Source§

impl Clone for WorkstationConfig

Source§

fn clone(&self) -> WorkstationConfig

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 WorkstationConfig

Source§

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

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

impl Default for WorkstationConfig

Source§

fn default() -> WorkstationConfig

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

impl Message for WorkstationConfig

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for WorkstationConfig

Source§

fn eq(&self, other: &WorkstationConfig) -> 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 WorkstationConfig

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>,