Compute V1 Client - Class InstancesClient (1.14.0)

Reference documentation and code samples for the Compute V1 Client class InstancesClient.

Service Description: The Instances API.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods.

Namespace

Google \ Cloud \ Compute \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. At the moment, supports only rest. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'rest' => [...], ]; See the Google\ApiCore\Transport\RestTransport::build() method for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

addAccessConfig

Adds an access config to an instance's network interface.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::addAccessConfigAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\AddAccessConfigInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

addResourcePolicies

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.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::addResourcePoliciesAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\AddResourcePoliciesInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

aggregatedList

Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::aggregatedListAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\AggregatedListInstancesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

attachDisk

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, read Adding a persistent disk to your instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::attachDiskAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\AttachDiskInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

bulkInsert

Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::bulkInsertAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\BulkInsertInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

delete

Deletes the specified Instance resource. For more information, see Deleting an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::deleteAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\DeleteInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

deleteAccessConfig

Deletes an access config from an instance's network interface.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::deleteAccessConfigAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\DeleteAccessConfigInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

detachDisk

Detaches a disk from an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::detachDiskAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\DetachDiskInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

get

Returns the specified Instance resource.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\Instance

getEffectiveFirewalls

Returns effective firewalls applied to an interface of the instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getEffectiveFirewallsAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetEffectiveFirewallsInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponse

getGuestAttributes

Returns the specified guest attributes entry.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getGuestAttributesAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetGuestAttributesInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\GuestAttributes

getIamPolicy

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetIamPolicyInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\Policy

getScreenshot

Returns the screenshot from the specified instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getScreenshotAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetScreenshotInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\Screenshot

getSerialPortOutput

Returns the last 1 MB of serial port output from the specified instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getSerialPortOutputAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetSerialPortOutputInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\SerialPortOutput

getShieldedInstanceIdentity

Returns the Shielded Instance Identity of an instance

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::getShieldedInstanceIdentityAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetShieldedInstanceIdentityInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\ShieldedInstanceIdentity

insert

Creates an instance resource in the specified project using the data included in the request.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::insertAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\InsertInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

list

Retrieves the list of instances contained within the specified zone.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::listAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\ListInstancesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listReferrers

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, read Viewing referrers to VM instances.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::listReferrersAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\ListReferrersInstancesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

removeResourcePolicies

Removes resource policies from an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::removeResourcePoliciesAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\RemoveResourcePoliciesInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

reset

Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::resetAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\ResetInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

resume

Resumes an instance that was suspended using the instances().suspend method.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::resumeAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\ResumeInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

sendDiagnosticInterrupt

Sends diagnostic interrupt to the instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::sendDiagnosticInterruptAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceResponse

setDeletionProtection

Sets deletion protection on the instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setDeletionProtectionAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetDeletionProtectionInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setDiskAutoDelete

Sets the auto-delete flag for a disk attached to an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setDiskAutoDeleteAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetDiskAutoDeleteInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetIamPolicyInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\Policy

setLabels

Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setLabelsAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetLabelsInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setMachineResources

Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setMachineResourcesAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMachineResourcesInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setMachineType

Changes the machine type for a stopped instance to the machine type specified in the request.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setMachineTypeAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMachineTypeInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setMetadata

Sets metadata for the specified instance to the data included in the request.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setMetadataAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMetadataInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setMinCpuPlatform

Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setMinCpuPlatformAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMinCpuPlatformInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setName

Sets name of an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setNameAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetNameInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setScheduling

Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setSchedulingAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetSchedulingInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setSecurityPolicy

Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setSecurityPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetSecurityPolicyInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setServiceAccount

Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setServiceAccountAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetServiceAccountInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setShieldedInstanceIntegrityPolicy

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.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setShieldedInstanceIntegrityPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetShieldedInstanceIntegrityPolicyInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

setTags

Sets network tags for the specified instance to the data included in the request.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::setTagsAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetTagsInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

simulateMaintenanceEvent

Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::simulateMaintenanceEventAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SimulateMaintenanceEventInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

start

Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::startAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\StartInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

startWithEncryptionKey

Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::startWithEncryptionKeyAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\StartWithEncryptionKeyInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

stop

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, see Stopping an instance.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::stopAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\StopInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

suspend

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.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::suspendAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\SuspendInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

testIamPermissions

Returns permissions that a caller has on the specified resource.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::testIamPermissionsAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\TestIamPermissionsInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Compute\V1\TestPermissionsResponse

update

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.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::updateAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

updateAccessConfig

Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::updateAccessConfigAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateAccessConfigInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

updateDisplayDevice

Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::updateDisplayDeviceAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateDisplayDeviceInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

updateNetworkInterface

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.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::updateNetworkInterfaceAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateNetworkInterfaceInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

updateShieldedInstanceConfig

Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

The async variant is Google\Cloud\Compute\V1\Client\InstancesClient::updateShieldedInstanceConfigAsync() .

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateShieldedInstanceConfigInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse

addAccessConfigAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\AddAccessConfigInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

addResourcePoliciesAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\AddResourcePoliciesInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

aggregatedListAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\AggregatedListInstancesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

attachDiskAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\AttachDiskInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

bulkInsertAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\BulkInsertInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\DeleteInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteAccessConfigAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\DeleteAccessConfigInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

detachDiskAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\DetachDiskInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getEffectiveFirewallsAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetEffectiveFirewallsInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getGuestAttributesAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetGuestAttributesInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetIamPolicyInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getScreenshotAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetScreenshotInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getSerialPortOutputAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetSerialPortOutputInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getShieldedInstanceIdentityAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\GetShieldedInstanceIdentityInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

insertAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\InsertInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\ListInstancesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listReferrersAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\ListReferrersInstancesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

removeResourcePoliciesAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\RemoveResourcePoliciesInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

resetAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\ResetInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

resumeAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\ResumeInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

sendDiagnosticInterruptAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setDeletionProtectionAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetDeletionProtectionInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setDiskAutoDeleteAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetDiskAutoDeleteInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetIamPolicyInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setLabelsAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetLabelsInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setMachineResourcesAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMachineResourcesInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setMachineTypeAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMachineTypeInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setMetadataAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMetadataInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setMinCpuPlatformAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetMinCpuPlatformInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setNameAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetNameInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setSchedulingAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetSchedulingInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setSecurityPolicyAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetSecurityPolicyInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setServiceAccountAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetServiceAccountInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setShieldedInstanceIntegrityPolicyAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetShieldedInstanceIntegrityPolicyInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setTagsAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SetTagsInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

simulateMaintenanceEventAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SimulateMaintenanceEventInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

startAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\StartInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

startWithEncryptionKeyAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\StartWithEncryptionKeyInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

stopAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\StopInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

suspendAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\SuspendInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

testIamPermissionsAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\TestIamPermissionsInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateAccessConfigAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateAccessConfigInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateDisplayDeviceAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateDisplayDeviceInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateNetworkInterfaceAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateNetworkInterfaceInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateShieldedInstanceConfigAsync

Parameters
NameDescription
request Google\Cloud\Compute\V1\UpdateShieldedInstanceConfigInstanceRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

Return an ZoneOperationsClient object with the same endpoint as $this.

Returns
TypeDescription
Google\Cloud\Compute\V1\ZoneOperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse