Instances class final
The Instances API.
- Implementers
Constructors
- Instances({required Client client, Uri? endPoint, String? gcclVersion})
-
Creates a
Instancesusingclientfor transport. - Instances.fromApiKey([String? apiKey])
-
Creates a
Instancesthat does authentication through an API key.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAccessConfig(
AddAccessConfigInstanceRequest request) → Future< Operation> - Adds an access config to an instance's network interface.
-
addNetworkInterface(
AddNetworkInterfaceInstanceRequest request) → Future< Operation> - Adds one dynamic network interface to an active instance.
-
addResourcePolicies(
AddResourcePoliciesInstanceRequest request) → Future< Operation> - Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.
-
aggregatedList(
AggregatedListInstancesRequest request) → Future< InstanceAggregatedList> - Retrieves an aggregated list of all of the instances in your project across all regions and zones.
-
attachDisk(
AttachDiskInstanceRequest request) → Future< Operation> - Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, readAdding a persistent disk to your instance.
-
bulkInsert(
BulkInsertInstanceRequest request) → Future< Operation> - Creates multiple instances. Count specifies the number of instances to create. For more information, seeAbout bulk creation of VMs.
-
close(
) → void - Closes the client and cleans up any resources associated with it.
-
delete(
DeleteInstanceRequest request) → Future< Operation> - Deletes the specified Instance resource. For more information, seeDeleting an instance.
-
deleteAccessConfig(
DeleteAccessConfigInstanceRequest request) → Future< Operation> - Deletes an access config from an instance's network interface.
-
deleteNetworkInterface(
DeleteNetworkInterfaceInstanceRequest request) → Future< Operation> - Deletes one dynamic network interface from an active instance. InstancesDeleteNetworkInterfaceRequest indicates:
-
detachDisk(
DetachDiskInstanceRequest request) → Future< Operation> - Detaches a disk from an instance.
-
get(
GetInstanceRequest request) → Future< Instance> - Returns the specified Instance resource.
-
getEffectiveFirewalls(
GetEffectiveFirewallsInstanceRequest request) → Future< InstancesGetEffectiveFirewallsResponse> - Returns effective firewalls applied to an interface of the instance.
-
getGuestAttributes(
GetGuestAttributesInstanceRequest request) → Future< GuestAttributes> - Returns the specified guest attributes entry.
-
getIamPolicy(
GetIamPolicyInstanceRequest request) → Future< Policy> - Gets the access control policy for a resource. May be empty if no such policy or resource exists.
-
getScreenshot(
GetScreenshotInstanceRequest request) → Future< Screenshot> - Returns the screenshot from the specified instance.
-
getSerialPortOutput(
GetSerialPortOutputInstanceRequest request) → Future< SerialPortOutput> - Returns the last 1 MB of serial port output from the specified instance.
-
getShieldedInstanceIdentity(
GetShieldedInstanceIdentityInstanceRequest request) → Future< ShieldedInstanceIdentity> - Returns the Shielded Instance Identity of an instance
-
insert(
InsertInstanceRequest request) → Future< Operation> - Creates an instance resource in the specified project using the data included in the request.
-
list(
ListInstancesRequest request) → Future< InstanceList> - Retrieves the list of instances contained within the specified zone.
-
listReferrers(
ListReferrersInstancesRequest request) → Future< InstanceListReferrers> - Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, readViewing referrers to VM instances.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
performMaintenance(
PerformMaintenanceInstanceRequest request) → Future< Operation> - Perform a manual maintenance on the instance.
-
removeResourcePolicies(
RemoveResourcePoliciesInstanceRequest request) → Future< Operation> - Removes resource policies from an instance.
-
reportHostAsFaulty(
ReportHostAsFaultyInstanceRequest request) → Future< Operation> - Mark the host as faulty and try to restart the instance on a new host.
-
reset(
ResetInstanceRequest request) → Future< Operation> - Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, seeResetting an instance.
-
resume(
ResumeInstanceRequest request) → Future< Operation> - Resumes an instance that was suspended using theinstances().suspend method.
-
sendDiagnosticInterrupt(
SendDiagnosticInterruptInstanceRequest request) → Future< SendDiagnosticInterruptInstanceResponse> - Sends diagnostic interrupt to the instance.
-
setDeletionProtection(
SetDeletionProtectionInstanceRequest request) → Future< Operation> - Sets deletion protection on the instance.
-
setDiskAutoDelete(
SetDiskAutoDeleteInstanceRequest request) → Future< Operation> - Sets the auto-delete flag for a disk attached to an instance.
-
setIamPolicy(
SetIamPolicyInstanceRequest request) → Future< Policy> - Sets the access control policy on the specified resource. Replaces any existing policy.
-
setLabels(
SetLabelsInstanceRequest request) → Future< Operation> - Sets labels on an instance. To learn more about labels, read theLabeling Resources documentation.
-
setMachineResources(
SetMachineResourcesInstanceRequest request) → Future< Operation> - Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
-
setMachineType(
SetMachineTypeInstanceRequest request) → Future< Operation> - Changes the machine type for a stopped instance to the machine type specified in the request.
-
setMetadata(
SetMetadataInstanceRequest request) → Future< Operation> - Sets metadata for the specified instance to the data included in the request.
-
setMinCpuPlatform(
SetMinCpuPlatformInstanceRequest request) → Future< Operation> - Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, readSpecifying a Minimum CPU Platform.
-
setName(
SetNameInstanceRequest request) → Future< Operation> - Sets name of an instance.
-
setScheduling(
SetSchedulingInstanceRequest request) → Future< Operation> -
Sets an instance's scheduling options. You can only call this method on astopped instance,
that is, a VM instance that is in a
TERMINATEDstate. SeeInstance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, seeSet VM host maintenance policy. -
setSecurityPolicy(
SetSecurityPolicyInstanceRequest request) → Future< Operation> - Sets the Google Cloud Armor security policy for the specified instance. For more information, seeGoogle Cloud Armor Overview
-
setServiceAccount(
SetServiceAccountInstanceRequest request) → Future< Operation> - Sets the service account on the instance. For more information, readChanging the service account and access scopes for an instance.
-
setShieldedInstanceIntegrityPolicy(
SetShieldedInstanceIntegrityPolicyInstanceRequest request) → Future< Operation> - Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
-
setTags(
SetTagsInstanceRequest request) → Future< Operation> - Sets network tags for the specified instance to the data included in the request.
-
simulateMaintenanceEvent(
SimulateMaintenanceEventInstanceRequest request) → Future< Operation> - Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.
-
start(
StartInstanceRequest request) → Future< Operation> - Starts an instance that was stopped using theinstances().stop method. For more information, seeRestart an instance.
-
startWithEncryptionKey(
StartWithEncryptionKeyInstanceRequest request) → Future< Operation> - Starts an instance that was stopped using theinstances().stop method. For more information, seeRestart an instance.
-
stop(
StopInstanceRequest request) → Future< Operation> - Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, seeStopping an instance.
-
suspend(
SuspendInstanceRequest request) → Future< Operation> - This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.
-
testIamPermissions(
TestIamPermissionsInstanceRequest request) → Future< TestPermissionsResponse> - Returns permissions that a caller has on the specified resource.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
UpdateInstanceRequest request) → Future< Operation> - Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.
-
updateAccessConfig(
UpdateAccessConfigInstanceRequest request) → Future< Operation> - Updates the specified access config from an instance's network interface with the data included in the request. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
-
updateDisplayDevice(
UpdateDisplayDeviceInstanceRequest request) → Future< Operation> - Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
-
updateNetworkInterface(
UpdateNetworkInterfaceInstanceRequest request) → Future< Operation> - Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.
-
updateShieldedInstanceConfig(
UpdateShieldedInstanceConfigInstanceRequest request) → Future< Operation> - Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supportsPATCH semantics and uses theJSON merge patch format and processing rules.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited