Compute V1 Client - Class InstanceGroupManagersClient (1.16.2)

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

Service Description: The InstanceGroupManagers 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
Name Description
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.

abandonInstances

Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::abandonInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\AbandonInstancesInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

aggregatedList

Retrieves the list of managed instance groups and groups them by zone. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

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

Parameters
Name Description
request Google\Cloud\Compute\V1\AggregatedListInstanceGroupManagersRequest

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
Type Description
Google\ApiCore\PagedListResponse

applyUpdatesToInstances

Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::applyUpdatesToInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\ApplyUpdatesToInstancesInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

createInstances

Creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::createInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\CreateInstancesInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

delete

Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.

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

Parameters
Name Description
request Google\Cloud\Compute\V1\DeleteInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

deleteInstances

Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::deleteInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\DeleteInstancesInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

deletePerInstanceConfigs

Deletes selected per-instance configurations for the managed instance group.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::deletePerInstanceConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\DeletePerInstanceConfigsInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

get

Returns all of the details about the specified managed instance group.

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

Parameters
Name Description
request Google\Cloud\Compute\V1\GetInstanceGroupManagerRequest

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
Type Description
Google\Cloud\Compute\V1\InstanceGroupManager

insert

Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.

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

Parameters
Name Description
request Google\Cloud\Compute\V1\InsertInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

list

Retrieves a list of managed instance groups that are contained within the specified project and zone.

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

Parameters
Name Description
request Google\Cloud\Compute\V1\ListInstanceGroupManagersRequest

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
Type Description
Google\ApiCore\PagedListResponse

listErrors

Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::listErrorsAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\ListErrorsInstanceGroupManagersRequest

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
Type Description
Google\ApiCore\PagedListResponse

listManagedInstances

Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group's listManagedInstancesResults field is set to PAGINATED.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::listManagedInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\ListManagedInstancesInstanceGroupManagersRequest

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
Type Description
Google\ApiCore\PagedListResponse

listPerInstanceConfigs

Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::listPerInstanceConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\ListPerInstanceConfigsInstanceGroupManagersRequest

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
Type Description
Google\ApiCore\PagedListResponse

patch

Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::patchAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\PatchInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

patchPerInstanceConfigs

Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::patchPerInstanceConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\PatchPerInstanceConfigsInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

recreateInstances

Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::recreateInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\RecreateInstancesInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

resize

Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::resizeAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\ResizeInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

setInstanceTemplate

Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::setInstanceTemplateAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\SetInstanceTemplateInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

setTargetPools

Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::setTargetPoolsAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\SetTargetPoolsInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

updatePerInstanceConfigs

Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.

The async variant is Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient::updatePerInstanceConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Compute\V1\UpdatePerInstanceConfigsInstanceGroupManagerRequest

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
Type Description
Google\ApiCore\OperationResponse

abandonInstancesAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\AbandonInstancesInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

aggregatedListAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\AggregatedListInstanceGroupManagersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

applyUpdatesToInstancesAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\ApplyUpdatesToInstancesInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createInstancesAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\CreateInstancesInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\DeleteInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteInstancesAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\DeleteInstancesInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deletePerInstanceConfigsAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\DeletePerInstanceConfigsInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\GetInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

insertAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\InsertInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\ListInstanceGroupManagersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listErrorsAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\ListErrorsInstanceGroupManagersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listManagedInstancesAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\ListManagedInstancesInstanceGroupManagersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listPerInstanceConfigsAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\ListPerInstanceConfigsInstanceGroupManagersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

patchAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\PatchInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

patchPerInstanceConfigsAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\PatchPerInstanceConfigsInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

recreateInstancesAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\RecreateInstancesInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

resizeAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\ResizeInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

setInstanceTemplateAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\SetInstanceTemplateInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

setTargetPoolsAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\SetTargetPoolsInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updatePerInstanceConfigsAsync

Parameters
Name Description
request Google\Cloud\Compute\V1\UpdatePerInstanceConfigsInstanceGroupManagerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

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

Returns
Type Description
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
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse