Compute Engine v1 API - Class Instance (3.0.0)

public sealed class Instance : IMessage<Instance>, IEquatable<Instance>, IDeepCloneable<Instance>, IBufferMessage, IMessage

Reference documentation and code samples for the Compute Engine v1 API class Instance.

Represents an Instance resource. An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances.

Inheritance

object > Instance

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Constructors

Instance()

public Instance()

Instance(Instance)

public Instance(Instance other)
Parameter
Name Description
other Instance

Properties

AdvancedMachineFeatures

public AdvancedMachineFeatures AdvancedMachineFeatures { get; set; }

Controls for advanced machine-related behavior features.

Property Value
Type Description
AdvancedMachineFeatures

CanIpForward

public bool CanIpForward { get; set; }

Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding .

Property Value
Type Description
bool

ConfidentialInstanceConfig

public ConfidentialInstanceConfig ConfidentialInstanceConfig { get; set; }
Property Value
Type Description
ConfidentialInstanceConfig

CpuPlatform

public string CpuPlatform { get; set; }

[Output Only] The CPU platform used by this instance.

Property Value
Type Description
string

CreationTimestamp

public string CreationTimestamp { get; set; }

[Output Only] Creation timestamp in RFC3339 text format.

Property Value
Type Description
string

DeletionProtection

public bool DeletionProtection { get; set; }

Whether the resource should be protected against deletion.

Property Value
Type Description
bool

Description

public string Description { get; set; }

An optional description of this resource. Provide this property when you create the resource.

Property Value
Type Description
string

Disks

public RepeatedField<AttachedDisk> Disks { get; }

Array of disks associated with this instance. Persistent disks must be created before you can assign them.

Property Value
Type Description
RepeatedFieldAttachedDisk

DisplayDevice

public DisplayDevice DisplayDevice { get; set; }

Enables display device for the instance.

Property Value
Type Description
DisplayDevice

Fingerprint

public string Fingerprint { get; set; }

Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. To see the latest fingerprint, make get() request to the instance.

Property Value
Type Description
string

GuestAccelerators

public RepeatedField<AcceleratorConfig> GuestAccelerators { get; }

A list of the type and count of accelerator cards attached to the instance.

Property Value
Type Description
RepeatedFieldAcceleratorConfig

HasCanIpForward

public bool HasCanIpForward { get; }

Gets whether the "can_ip_forward" field is set

Property Value
Type Description
bool

HasCpuPlatform

public bool HasCpuPlatform { get; }

Gets whether the "cpu_platform" field is set

Property Value
Type Description
bool

HasCreationTimestamp

public bool HasCreationTimestamp { get; }

Gets whether the "creation_timestamp" field is set

Property Value
Type Description
bool

HasDeletionProtection

public bool HasDeletionProtection { get; }

Gets whether the "deletion_protection" field is set

Property Value
Type Description
bool

HasDescription

public bool HasDescription { get; }

Gets whether the "description" field is set

Property Value
Type Description
bool

HasFingerprint

public bool HasFingerprint { get; }

Gets whether the "fingerprint" field is set

Property Value
Type Description
bool

HasHostname

public bool HasHostname { get; }

Gets whether the "hostname" field is set

Property Value
Type Description
bool

HasId

public bool HasId { get; }

Gets whether the "id" field is set

Property Value
Type Description
bool

HasKeyRevocationActionType

public bool HasKeyRevocationActionType { get; }

Gets whether the "key_revocation_action_type" field is set

Property Value
Type Description
bool

HasKind

public bool HasKind { get; }

Gets whether the "kind" field is set

Property Value
Type Description
bool

HasLabelFingerprint

public bool HasLabelFingerprint { get; }

Gets whether the "label_fingerprint" field is set

Property Value
Type Description
bool

HasLastStartTimestamp

public bool HasLastStartTimestamp { get; }

Gets whether the "last_start_timestamp" field is set

Property Value
Type Description
bool

HasLastStopTimestamp

public bool HasLastStopTimestamp { get; }

Gets whether the "last_stop_timestamp" field is set

Property Value
Type Description
bool

HasLastSuspendedTimestamp

public bool HasLastSuspendedTimestamp { get; }

Gets whether the "last_suspended_timestamp" field is set

Property Value
Type Description
bool

HasMachineType

public bool HasMachineType { get; }

Gets whether the "machine_type" field is set

Property Value
Type Description
bool

HasMinCpuPlatform

public bool HasMinCpuPlatform { get; }

Gets whether the "min_cpu_platform" field is set

Property Value
Type Description
bool

HasName

public bool HasName { get; }

Gets whether the "name" field is set

Property Value
Type Description
bool

HasPrivateIpv6GoogleAccess

public bool HasPrivateIpv6GoogleAccess { get; }

Gets whether the "private_ipv6_google_access" field is set

Property Value
Type Description
bool

HasSatisfiesPzi

public bool HasSatisfiesPzi { get; }

Gets whether the "satisfies_pzi" field is set

Property Value
Type Description
bool

HasSatisfiesPzs

public bool HasSatisfiesPzs { get; }

Gets whether the "satisfies_pzs" field is set

Property Value
Type Description
bool
public bool HasSelfLink { get; }

Gets whether the "self_link" field is set

Property Value
Type Description
bool

HasSourceMachineImage

public bool HasSourceMachineImage { get; }

Gets whether the "source_machine_image" field is set

Property Value
Type Description
bool

HasStartRestricted

public bool HasStartRestricted { get; }

Gets whether the "start_restricted" field is set

Property Value
Type Description
bool

HasStatus

public bool HasStatus { get; }

Gets whether the "status" field is set

Property Value
Type Description
bool

HasStatusMessage

public bool HasStatusMessage { get; }

Gets whether the "status_message" field is set

Property Value
Type Description
bool

HasZone

public bool HasZone { get; }

Gets whether the "zone" field is set

Property Value
Type Description
bool

Hostname

public string Hostname { get; set; }

Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS.

Property Value
Type Description
string

Id

public ulong Id { get; set; }

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

Property Value
Type Description
ulong

InstanceEncryptionKey

public CustomerEncryptionKey InstanceEncryptionKey { get; set; }

Encrypts suspended data for an instance with a customer-managed encryption key. If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation. If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation.

Property Value
Type Description
CustomerEncryptionKey

KeyRevocationActionType

public string KeyRevocationActionType { get; set; }

KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. Check the KeyRevocationActionType enum for the list of possible values.

Property Value
Type Description
string

Kind

public string Kind { get; set; }

[Output Only] Type of the resource. Always compute#instance for instances.

Property Value
Type Description
string

LabelFingerprint

public string LabelFingerprint { get; set; }

A fingerprint for this request, which is essentially a hash of the label's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. To see the latest fingerprint, make get() request to the instance.

Property Value
Type Description
string

Labels

public MapField<string, string> Labels { get; }

Labels to apply to this instance. These can be later modified by the setLabels method.

Property Value
Type Description
MapFieldstringstring

LastStartTimestamp

public string LastStartTimestamp { get; set; }

[Output Only] Last start timestamp in RFC3339 text format.

Property Value
Type Description
string

LastStopTimestamp

public string LastStopTimestamp { get; set; }

[Output Only] Last stop timestamp in RFC3339 text format.

Property Value
Type Description
string

LastSuspendedTimestamp

public string LastSuspendedTimestamp { get; set; }

[Output Only] Last suspended timestamp in RFC3339 text format.

Property Value
Type Description
string

MachineType

public string MachineType { get; set; }

Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type: zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): zones/zone/machineTypes/custom-CPUS-MEMORY For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read the Specifications for custom machine types.

Property Value
Type Description
string

Metadata

public Metadata Metadata { get; set; }

The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.

Property Value
Type Description
Metadata

MinCpuPlatform

public string MinCpuPlatform { get; set; }

Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge".

Property Value
Type Description
string

Name

public string Name { get; set; }

The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Property Value
Type Description
string

NetworkInterfaces

public RepeatedField<NetworkInterface> NetworkInterfaces { get; }

An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance.

Property Value
Type Description
RepeatedFieldNetworkInterface

NetworkPerformanceConfig

public NetworkPerformanceConfig NetworkPerformanceConfig { get; set; }
Property Value
Type Description
NetworkPerformanceConfig

Params

public InstanceParams Params { get; set; }

Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload.

Property Value
Type Description
InstanceParams

PrivateIpv6GoogleAccess

public string PrivateIpv6GoogleAccess { get; set; }

The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. Check the PrivateIpv6GoogleAccess enum for the list of possible values.

Property Value
Type Description
string

ReservationAffinity

public ReservationAffinity ReservationAffinity { get; set; }

Specifies the reservations that this instance can consume from.

Property Value
Type Description
ReservationAffinity

ResourcePolicies

public RepeatedField<string> ResourcePolicies { get; }

Resource policies applied to this instance.

Property Value
Type Description
RepeatedFieldstring

ResourceStatus

public ResourceStatus ResourceStatus { get; set; }

[Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field.

Property Value
Type Description
ResourceStatus

SatisfiesPzi

public bool SatisfiesPzi { get; set; }

[Output Only] Reserved for future use.

Property Value
Type Description
bool

SatisfiesPzs

public bool SatisfiesPzs { get; set; }

[Output Only] Reserved for future use.

Property Value
Type Description
bool

Scheduling

public Scheduling Scheduling { get; set; }

Sets the scheduling options for this instance.

Property Value
Type Description
Scheduling
public string SelfLink { get; set; }

[Output Only] Server-defined URL for this resource.

Property Value
Type Description
string

ServiceAccounts

public RepeatedField<ServiceAccount> ServiceAccounts { get; }

A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information.

Property Value
Type Description
RepeatedFieldServiceAccount

ShieldedInstanceConfig

public ShieldedInstanceConfig ShieldedInstanceConfig { get; set; }
Property Value
Type Description
ShieldedInstanceConfig

ShieldedInstanceIntegrityPolicy

public ShieldedInstanceIntegrityPolicy ShieldedInstanceIntegrityPolicy { get; set; }
Property Value
Type Description
ShieldedInstanceIntegrityPolicy

SourceMachineImage

public string SourceMachineImage { get; set; }

Source machine image

Property Value
Type Description
string

SourceMachineImageEncryptionKey

public CustomerEncryptionKey SourceMachineImageEncryptionKey { get; set; }

Source machine image encryption key when creating an instance from a machine image.

Property Value
Type Description
CustomerEncryptionKey

StartRestricted

public bool StartRestricted { get; set; }

[Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity.

Property Value
Type Description
bool

Status

public string Status { get; set; }

[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. Check the Status enum for the list of possible values.

Property Value
Type Description
string

StatusMessage

public string StatusMessage { get; set; }

[Output Only] An optional, human-readable explanation of the status.

Property Value
Type Description
string

Tags

public Tags Tags { get; set; }

Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field.

Property Value
Type Description
Tags

Zone

public string Zone { get; set; }

[Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

Property Value
Type Description
string