Instance class final

Represents an Instance resource.

An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, readVirtual Machine Instances.

Constructors

Instance({AdvancedMachineFeatures? advancedMachineFeatures, bool? canIpForward, ConfidentialInstanceConfig? confidentialInstanceConfig, String? cpuPlatform, String? creationTimestamp, bool? deletionProtection, String? description, List<AttachedDisk> disks = const [], DisplayDevice? displayDevice, String? fingerprint, List<AcceleratorConfig> guestAccelerators = const [], String? hostname, BigInt? id, CustomerEncryptionKey? instanceEncryptionKey, String? keyRevocationActionType, String? kind, String? labelFingerprint, Map<String, String> labels = const {}, String? lastStartTimestamp, String? lastStopTimestamp, String? lastSuspendedTimestamp, String? localSsdEncryptionMode, String? machineType, Metadata? metadata, String? minCpuPlatform, String? name, List<NetworkInterface> networkInterfaces = const [], NetworkPerformanceConfig? networkPerformanceConfig, InstanceParams? params, String? privateIpv6GoogleAccess, ReservationAffinity? reservationAffinity, List<String> resourcePolicies = const [], ResourceStatus? resourceStatus, bool? satisfiesPzi, bool? satisfiesPzs, Scheduling? scheduling, String? selfLink, List<ServiceAccount> serviceAccounts = const [], ShieldedInstanceConfig? shieldedInstanceConfig, ShieldedInstanceIntegrityPolicy? shieldedInstanceIntegrityPolicy, String? sourceMachineImage, CustomerEncryptionKey? sourceMachineImageEncryptionKey, bool? startRestricted, String? status, String? statusMessage, Tags? tags, WorkloadIdentityConfig? workloadIdentityConfig, String? zone})
Instance.fromJson(Object? j)
factory

Properties

advancedMachineFeatures AdvancedMachineFeatures?
Controls for advanced machine-related behavior features.
final
canIpForward bool?
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, seeEnabling IP Forwarding.
final
confidentialInstanceConfig ConfidentialInstanceConfig?
final
cpuPlatform String?
Output only. Output Only The CPU platform used by this instance.
final
creationTimestamp String?
Output only. Output Only Creation timestamp inRFC3339 text format.
final
deletionProtection bool?
Whether the resource should be protected against deletion.
final
description String?
An optional description of this resource. Provide this property when you create the resource.
final
disks List<AttachedDisk>
Array of disks associated with this instance. Persistent disks must be created before you can assign them.
final
displayDevice DisplayDevice?
Enables display device for the instance.
final
fingerprint String?
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.
final
guestAccelerators List<AcceleratorConfig>
A list of the type and count of accelerator cards attached to the instance.
final
hashCode int
The hash code for this object.
no setterinherited
hostname String?
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.
final
id BigInt?
Output only. Output Only The unique identifier for the resource. This identifier is defined by the server.
final
instanceEncryptionKey CustomerEncryptionKey?
Encrypts suspended data for an instance with acustomer-managed encryption key.
final
keyRevocationActionType String?
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.
final
kind String?
Output only. Output Only Type of the resource. Always compute#instance for instances.
final
labelFingerprint String?
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.
final
labels Map<String, String>
Labels to apply to this instance. These can be later modified by the setLabels method.
final
lastStartTimestamp String?
Output only. Output Only Last start timestamp inRFC3339 text format.
final
lastStopTimestamp String?
Output only. Output Only Last stop timestamp inRFC3339 text format.
final
lastSuspendedTimestamp String?
Output only. Output Only Last suspended timestamp inRFC3339 text format.
final
localSsdEncryptionMode String?
Specifies which method should be used for encrypting the Local SSDs attached to the VM. Check the LocalSsdEncryptionMode enum for the list of possible values.
final
machineType String?
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:
final
metadata Metadata?
The metadata key/value pairs assigned to this instance. This includes metadata keys that were explicitly defined for the instance.
final
minCpuPlatform String?
Specifies aminimum 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".
final
name String?
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 withRFC1035. 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.
final
networkInterfaces List<NetworkInterface>
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.
final
networkPerformanceConfig NetworkPerformanceConfig?
final
params InstanceParams?
Input only. Input Only Additional params passed with the request, but not persisted as part of resource payload.
final
privateIpv6GoogleAccess String?
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.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
reservationAffinity ReservationAffinity?
Specifies the reservations that this instance can consume from.
final
resourcePolicies List<String>
Resource policies applied to this instance.
final
resourceStatus ResourceStatus?
Output only. Output Only Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
satisfiesPzi bool?
Output only. Output Only Reserved for future use.
final
satisfiesPzs bool?
Output only. Output Only Reserved for future use.
final
scheduling Scheduling?
Sets the scheduling options for this instance.
final
Output only. Output Only Server-defined URL for this resource.
final
serviceAccounts List<ServiceAccount>
A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.
final
shieldedInstanceConfig ShieldedInstanceConfig?
final
shieldedInstanceIntegrityPolicy ShieldedInstanceIntegrityPolicy?
final
sourceMachineImage String?
Source machine image
final
sourceMachineImageEncryptionKey CustomerEncryptionKey?
Source machine image encryption key when creating an instance from a machine image.
final
startRestricted bool?
Output only. Output Only Whether a VM has been restricted for start because Compute Engine has detected suspicious activity.
final
status String?
Output only. Output Only The status of the instance. One of the following values: PROVISIONING, STAGING,RUNNING, STOPPING, SUSPENDING,SUSPENDED, REPAIRING, andTERMINATED. For more information about the status of the instance, see Instance life cycle. Check the Status enum for the list of possible values.
final
statusMessage String?
Output only. Output Only An optional, human-readable explanation of the status.
final
tags Tags?
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 withRFC1035. Multiple tags can be specified via the 'tags.items' field.
final
workloadIdentityConfig WorkloadIdentityConfig?
final
zone String?
Output only. 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.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

fullyQualifiedName → const String