Skip to main content

GetInstanceResource

Type Alias GetInstanceResource 

Source
pub type GetInstanceResource = Instance;

Aliased Type§

pub struct GetInstanceResource {
Show 18 fields pub id: String, pub crn: String, pub name: String, pub description: Option<String>, pub task_state: Option<Nullable<String>>, pub flavor: ResourceRef, pub image: InstanceImage, pub user_data: Option<String>, pub iam_role: InstanceIamRole, pub metadata: Option<BTreeMap<String, String>>, pub tags: Option<BTreeMap<String, String>>, pub faults: Vec<Fault>, pub created_at: String, pub updated_at: String, pub launched_at: Option<Nullable<String>>, pub terminated_at: Option<Nullable<String>>, pub desired_state: InstanceDesiredState, pub current_state: CurrentState,
}

Fields§

§id: String§crn: String

Cloud Resource Name

§name: String

Resource names must not start with the literal crn: prefix or be UUIDs (canonical, compact, braced, or urn:uuid: forms, in either case).

§description: Option<String>§task_state: Option<Nullable<String>>

In-flight transition, if any; null when settled.

§flavor: ResourceRef

Flavor identity. Every instance has a flavor; query the flavor resource for CPU and RAM.

§image: InstanceImage

Pinned source image identity, or null for a volume-only boot.

§user_data: Option<String>

Base64-encoded cloud-init user-data supplied at launch.

§iam_role: InstanceIamRole

Attached IAM role identity, or null when no role is attached. Deleted roles retain their identity without name.

§metadata: Option<BTreeMap<String, String>>§tags: Option<BTreeMap<String, String>>§faults: Vec<Fault>

Active faults ordered by last_at descending, then internal history id descending for a stable tie-breaker. Healthy resources return [].

§created_at: String§updated_at: String§launched_at: Option<Nullable<String>>§terminated_at: Option<Nullable<String>>§desired_state: InstanceDesiredState

What was asked for. Only three values, because there are only three things you can ask an instance to be: Create/Start/Reboot ask for running, Stop for stopped, Delete for deleted.

§current_state: CurrentState

Where the instance actually is. Read this one to answer “is it up” — the transitional states live here, not on desired_state, because nobody asks for stopping. desired_state=running with current_state=stopped is an instance that was asked to start and has not come up yet.