Skip to main content

Instance

Struct Instance 

Source
pub struct Instance {
Show 16 fields pub name: String, pub instance_type: String, pub image: String, pub image_family: String, pub key_pair: String, pub login_user: String, pub boot_volume: Option<BootVolume>, pub network_interfaces: Vec<String>, pub state: i32, pub state_reason: String, pub health: Option<InstanceHealth>, pub create_time: Option<Timestamp>, pub creator: String, pub tags: BTreeMap<String, String>, pub interface_addresses: Vec<InterfaceAddresses>, pub service_account: String,
}
Expand description

A virtual machine in one zone.

Fields§

§name: String

The instance’s resource name.

§instance_type: String

The instance type by its full name, //compute.origincloudapis.eu/instanceTypes/{instance_type}, such as //compute.origincloudapis.eu/instanceTypes/gp1.core.2: one whose available is true. Changing it needs the instance instance::State::Stopped.

§image: String

The full name of the image the boot volume is created from, in the instance’s zone: one of the project’s own, //compute.origincloudapis.eu/projects/{project}/zones/{zone}/images/{image}, or a public one, //compute.origincloudapis.eu/zones/{zone}/images/{image}. Set exactly one of image and image_family; launched from a family, this is the public image the family resolved to.

§image_family: String

The full name of the image family to launch the current public image of, //compute.origincloudapis.eu/imageFamilies/{image_family}. Set exactly one of image and image_family. Empty when the instance was launched from an image.

§key_pair: String

The full name of the key pair whose public key is installed for login_user, in the instance’s project.

§login_user: String

The account to log in as: a user created at first boot that holds the key pair. A POSIX user name of at most 32 lowercase letters, digits, underscores and hyphens, starting with a letter or an underscore, and not root. The image’s default_user when left empty.

§boot_volume: Option<BootVolume>

The boot volume: its size and storage class at launch, and the volume. The image’s size on the default storage class when left out.

§network_interfaces: Vec<String>

The network interfaces’ full names, in device order, the boot interface first; exactly one today. Each is an existing interface in the instance’s project and zone that nothing else holds, created with the network service: its subnet and security groups are the instance’s. Terminating the instance releases it, and it stays. An instance launched from a recipe with an interface spec, or before interfaces were named at launch, shows the interface created for it once it exists, which is deleted with the instance.

§state: i32

Where the instance is in its lifecycle.

§state_reason: String

Why the instance is instance::State::Failed, or why a instance::State::Stopped instance went down when the machine it ran on failed; empty otherwise.

§health: Option<InstanceHealth>

Whether the platform can currently confirm the instance is working, which state doesn’t say: a instance::State::Running instance on a machine that stopped answering is still instance::State::Running.

§create_time: Option<Timestamp>

When the instance was launched.

§creator: String

The principal that launched the instance, by its full name on iam: //iam.origincloudapis.eu/users/{user}, //iam.origincloudapis.eu/organizations/{organization}/serviceAccounts/{service_account}, or a platform service agent’s or service’s name when the platform did.

§tags: BTreeMap<String, String>

Labels of your own, at most 50. The origin:name tag is the name the console shows.

§interface_addresses: Vec<InterfaceAddresses>

Each network interface’s private addresses, in the order of network_interfaces; an interface not attached yet has none.

§service_account: String

The full name of the service account the instance runs as, //iam.origincloudapis.eu/organizations/{organization}/serviceAccounts/{service_account}: a WORKLOAD service account of the instance’s organization that isn’t deleted. Launching with one, or updating the instance to one, needs iam.service_account.act_as on the organization as well; an update that leaves it empty removes it, and a terminated instance’s can’t change. Empty for an instance that runs as none.

Implementations§

Source§

impl Instance

Source

pub fn state(&self) -> State

Returns the enum value of state, or the default if the field is set to an invalid enum value.

Source

pub fn set_state(&mut self, value: State)

Sets state to the provided enum value.

Trait Implementations§

Source§

impl Clone for Instance

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Instance

Source§

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

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

impl Default for Instance

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Instance

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Message for Instance

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Instance

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Instance

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Instance

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> MaybeSend for T
where T: Send + ?Sized,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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: Sized + 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 = !

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

fn try_from(value: U) -> Result<T, !>

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