# Compute V1 Client - Class InstanceGroupManagersClient (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.0 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|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` 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` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\Compute\V1\InstanceGroupManagersClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new InstanceGroupManagersClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ 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()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_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|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` 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](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) 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()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_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. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### 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 thetargetSize of the managed instance group by the
number of instances that you abandon. This operation is marked asDONE 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 thelistmanagedinstances
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 [InstanceGroupManagersClient::abandonInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__abandonInstancesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AbandonInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\AbandonInstancesInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function abandon_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest();
        $request = (new AbandonInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersAbandonInstancesRequestResource(
                $instanceGroupManagersAbandonInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->abandonInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        abandon_instances_sample($instanceGroupManager, $project, $zone);
    }

### 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 [InstanceGroupManagersClient::aggregatedListAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__aggregatedListAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AggregatedListInstanceGroupManagersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Compute\V1\AggregatedListInstanceGroupManagersRequest;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;

    /**
     * @param string $project Project ID for this request.
     */
    function aggregated_list_sample(string $project): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new AggregatedListInstanceGroupManagersRequest())
            ->setProject($project);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $instanceGroupManagersClient->aggregatedList($request);

            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $project = '[PROJECT]';

        aggregated_list_sample($project);
    }

### 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
[InstanceGroupManagersClient::applyUpdatesToInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__applyUpdatesToInstancesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ApplyUpdatesToInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\ApplyUpdatesToInstancesInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group, should conform to RFC1035.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone
     *                                     where the managed instance group is located. Should conform to RFC1035.
     */
    function apply_updates_to_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest();
        $request = (new ApplyUpdatesToInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersApplyUpdatesRequestResource(
                $instanceGroupManagersApplyUpdatesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->applyUpdatesToInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        apply_updates_to_instances_sample($instanceGroupManager, $project, $zone);
    }

### createInstances

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

The async variant is [InstanceGroupManagersClient::createInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__createInstancesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.CreateInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\CreateInstancesInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     *                                     It should conform to RFC1035.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone
     *                                     where the managed instance group is located.
     *                                     It should conform to RFC1035.
     */
    function create_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest();
        $request = (new CreateInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersCreateInstancesRequestResource(
                $instanceGroupManagersCreateInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->createInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        create_instances_sample($instanceGroupManager, $project, $zone);
    }

### 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 [InstanceGroupManagersClient::deleteAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__deleteAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.DeleteInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\DeleteInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group to delete.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function delete_sample(string $instanceGroupManager, string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new DeleteInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->delete($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        delete_sample($instanceGroupManager, $project, $zone);
    }

### 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 thetargetSize 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 thelistmanagedinstances
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 [InstanceGroupManagersClient::deleteInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__deleteInstancesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.DeleteInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\DeleteInstancesInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function delete_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest();
        $request = (new DeleteInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersDeleteInstancesRequestResource(
                $instanceGroupManagersDeleteInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->deleteInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        delete_instances_sample($instanceGroupManager, $project, $zone);
    }

### deletePerInstanceConfigs

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

The async variant is
[InstanceGroupManagersClient::deletePerInstanceConfigsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__deletePerInstanceConfigsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.DeletePerInstanceConfigsInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\DeletePerInstanceConfigsInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     *                                     It should conform to RFC1035.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone
     *                                     where the managed instance
     *                                     group is located.
     *                                     It should conform to RFC1035.
     */
    function delete_per_instance_configs_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq();
        $request = (new DeletePerInstanceConfigsInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersDeletePerInstanceConfigsReqResource(
                $instanceGroupManagersDeletePerInstanceConfigsReqResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->deletePerInstanceConfigs($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        delete_per_instance_configs_sample($instanceGroupManager, $project, $zone);
    }

### get

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

The async variant is [InstanceGroupManagersClient::getAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__getAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.GetInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.InstanceGroupManager` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\GetInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\InstanceGroupManager;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function get_sample(string $instanceGroupManager, string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new GetInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var InstanceGroupManager $response */
            $response = $instanceGroupManagersClient->get($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        get_sample($instanceGroupManager, $project, $zone);
    }

### 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 thelistmanagedinstances
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 [InstanceGroupManagersClient::insertAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__insertAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.InsertInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InsertInstanceGroupManagerRequest;
    use Google\Cloud\Compute\V1\InstanceGroupManager;
    use Google\Rpc\Status;

    /**
     * @param string $project Project ID for this request.
     * @param string $zone    The name of the zone
     *                        where you want to create the managed instance group.
     */
    function insert_sample(string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagerResource = new InstanceGroupManager();
        $request = (new InsertInstanceGroupManagerRequest())
            ->setInstanceGroupManagerResource($instanceGroupManagerResource)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->insert($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        insert_sample($project, $zone);
    }

### list

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

The async variant is [InstanceGroupManagersClient::listAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__listAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListInstanceGroupManagersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\ListInstanceGroupManagersRequest;

    /**
     * @param string $project Project ID for this request.
     * @param string $zone    The name of thezone where the managed
     *                        instance group is located.
     */
    function list_sample(string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new ListInstanceGroupManagersRequest())
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $instanceGroupManagersClient->list($request);

            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        list_sample($project, $zone);
    }

### 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 [InstanceGroupManagersClient::listErrorsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__listErrorsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListErrorsInstanceGroupManagersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\ListErrorsInstanceGroupManagersRequest;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     *                                     It must be a string that meets the requirements in RFC1035, or an
     *                                     unsigned long integer: must match regexp pattern:
     *                                     (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     *                                     It should conform to RFC1035.
     */
    function list_errors_sample(string $instanceGroupManager, string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new ListErrorsInstanceGroupManagersRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $instanceGroupManagersClient->listErrors($request);

            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        list_errors_sample($instanceGroupManager, $project, $zone);
    }

### 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
[InstanceGroupManagersClient::listManagedInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__listManagedInstancesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListManagedInstancesInstanceGroupManagersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\ListManagedInstancesInstanceGroupManagersRequest;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function list_managed_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new ListManagedInstancesInstanceGroupManagersRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $instanceGroupManagersClient->listManagedInstances($request);

            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        list_managed_instances_sample($instanceGroupManager, $project, $zone);
    }

### 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
[InstanceGroupManagersClient::listPerInstanceConfigsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__listPerInstanceConfigsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListPerInstanceConfigsInstanceGroupManagersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\ListPerInstanceConfigsInstanceGroupManagersRequest;

    /**
     * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone
     *                                     where the managed instance group is located.
     *                                     It should conform to RFC1035.
     */
    function list_per_instance_configs_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new ListPerInstanceConfigsInstanceGroupManagersRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $instanceGroupManagersClient->listPerInstanceConfigs($request);

            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        list_per_instance_configs_sample($instanceGroupManager, $project, $zone);
    }

### 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 thelistManagedInstances
method. This method supportsPATCH
semantics and uses theJSON 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, seeUpdating instances in
a MIG.

The async variant is [InstanceGroupManagersClient::patchAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__patchAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.PatchInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManager;
    use Google\Cloud\Compute\V1\PatchInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the instance group manager.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of the zone where
     *                                     you want to create the managed instance group.
     */
    function patch_sample(string $instanceGroupManager, string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagerResource = new InstanceGroupManager();
        $request = (new PatchInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagerResource($instanceGroupManagerResource)
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->patch($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        patch_sample($instanceGroupManager, $project, $zone);
    }

### 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
[InstanceGroupManagersClient::patchPerInstanceConfigsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__patchPerInstanceConfigsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.PatchPerInstanceConfigsInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq;
    use Google\Cloud\Compute\V1\PatchPerInstanceConfigsInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     *                                     It should conform to RFC1035.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone
     *                                     where the managed instance group is located.
     *                                     It should conform to RFC1035.
     */
    function patch_per_instance_configs_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq();
        $request = (new PatchPerInstanceConfigsInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersPatchPerInstanceConfigsReqResource(
                $instanceGroupManagersPatchPerInstanceConfigsReqResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->patchPerInstanceConfigs($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        patch_per_instance_configs_sample($instanceGroupManager, $project, $zone);
    }

### 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 itscurrentAction 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
[InstanceGroupManagersClient::recreateInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__recreateInstancesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.RecreateInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest;
    use Google\Cloud\Compute\V1\RecreateInstancesInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function recreate_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest();
        $request = (new RecreateInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersRecreateInstancesRequestResource(
                $instanceGroupManagersRecreateInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->recreateInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        recreate_instances_sample($instanceGroupManager, $project, $zone);
    }

### 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 markedDONE 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 thelistmanagedinstances
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 [InstanceGroupManagersClient::resizeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__resizeAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ResizeInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\ResizeInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param int    $size                 The number of running instances that the managed instance group should
     *                                     maintain at any given time. The group automatically adds or removes
     *                                     instances to maintain the number of instances specified by this parameter.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function resize_sample(
        string $instanceGroupManager,
        string $project,
        int $size,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $request = (new ResizeInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setProject($project)
            ->setSize($size)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->resize($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $size = 0;
        $zone = '[ZONE]';

        resize_sample($instanceGroupManager, $project, $size, $zone);
    }

### resumeInstances

Flags the specified instances in the managed instance group to be
resumed. This method increases thetargetSize and decreases the targetSuspendedSize
of the managed instance group by the number of instances that you resume.

The resumeInstances operation is marked DONE if
the resumeInstances request is successful. The underlying
actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
method.

In this request, you can only specify instances that are suspended. For
example, if an instance was previously suspended using the suspendInstances
method, it can be resumed using the resumeInstances method.

If a health check is attached to the managed instance group, the specified
instances will be verified as healthy after they are resumed.

You can specify a maximum of 1000 instances with this method per request.

The async variant is [InstanceGroupManagersClient::resumeInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__resumeInstancesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ResumeInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersResumeInstancesRequest;
    use Google\Cloud\Compute\V1\ResumeInstancesInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function resume_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest();
        $request = (new ResumeInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersResumeInstancesRequestResource(
                $instanceGroupManagersResumeInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->resumeInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        resume_instances_sample($instanceGroupManager, $project, $zone);
    }

### 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, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.

The async variant is
[InstanceGroupManagersClient::setInstanceTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__setInstanceTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SetInstanceTemplateInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest;
    use Google\Cloud\Compute\V1\SetInstanceTemplateInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function set_instance_template_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest();
        $request = (new SetInstanceTemplateInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersSetInstanceTemplateRequestResource(
                $instanceGroupManagersSetInstanceTemplateRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->setInstanceTemplate($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        set_instance_template_sample($instanceGroupManager, $project, $zone);
    }

### 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 markedDONE 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 [InstanceGroupManagersClient::setTargetPoolsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__setTargetPoolsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SetTargetPoolsInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest;
    use Google\Cloud\Compute\V1\SetTargetPoolsInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function set_target_pools_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest();
        $request = (new SetTargetPoolsInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersSetTargetPoolsRequestResource(
                $instanceGroupManagersSetTargetPoolsRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->setTargetPools($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        set_target_pools_sample($instanceGroupManager, $project, $zone);
    }

### startInstances

Flags the specified instances in the managed instance group to be
started. This method increases thetargetSize and decreases the targetStoppedSize
of the managed instance group by the number of instances that you start.

The startInstances operation is marked DONE if
the startInstances request is successful. The underlying
actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
method.

In this request, you can only specify instances that are stopped. For
example, if an instance was previously stopped using the stopInstances
method, it can be started using the startInstances method.

If a health check is attached to the managed instance group, the specified
instances will be verified as healthy after they are started.

You can specify a maximum of 1000 instances with this method per request.

The async variant is [InstanceGroupManagersClient::startInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__startInstancesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.StartInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersStartInstancesRequest;
    use Google\Cloud\Compute\V1\StartInstancesInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function start_instances_sample(string $instanceGroupManager, string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest();
        $request = (new StartInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersStartInstancesRequestResource(
                $instanceGroupManagersStartInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->startInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        start_instances_sample($instanceGroupManager, $project, $zone);
    }

### stopInstances

Flags the specified instances in the managed instance group to be
immediately stopped. You can only specify instances that are running in
this request. This method reduces thetargetSize and increases the targetStoppedSize
of the managed instance group by the number of instances that you stop.

The stopInstances operation is marked DONE if
the stopInstances request is successful. The underlying
actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
method.

If the standbyPolicy.initialDelaySec field is set, the group
delays stopping the instances until initialDelaySec have
passed from instance.creationTimestamp (that is, when the
instance was created). This delay gives your application time to
set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
will be zero delay.

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 stopped.

Stopped instances can be started using the startInstances
method.

You can specify a maximum of 1000 instances with this method per request.

The async variant is [InstanceGroupManagersClient::stopInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__stopInstancesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.StopInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersStopInstancesRequest;
    use Google\Cloud\Compute\V1\StopInstancesInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function stop_instances_sample(string $instanceGroupManager, string $project, string $zone): void
    {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest();
        $request = (new StopInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersStopInstancesRequestResource(
                $instanceGroupManagersStopInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->stopInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        stop_instances_sample($instanceGroupManager, $project, $zone);
    }

### suspendInstances

Flags the specified instances in the managed instance group to be
immediately suspended. You can only specify instances that are running in
this request. This method reduces thetargetSize and increases the targetSuspendedSize
of the managed instance group by the number of instances that you suspend.

The suspendInstances operation is marked DONE if
the suspendInstances request is successful. The underlying
actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
method.

If the standbyPolicy.initialDelaySec field is set, the group
delays suspension of the instances until initialDelaySec have
passed from instance.creationTimestamp (that is, when the
instance was created). This delay gives your application time to
set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
will be zero delay.

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 suspended.

Suspended instances can be resumed using the resumeInstances
method.

You can specify a maximum of 1000 instances with this method per request.

The async variant is [InstanceGroupManagersClient::suspendInstancesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__suspendInstancesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SuspendInstancesInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersSuspendInstancesRequest;
    use Google\Cloud\Compute\V1\SuspendInstancesInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone where the managed
     *                                     instance group is located.
     */
    function suspend_instances_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest();
        $request = (new SuspendInstancesInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersSuspendInstancesRequestResource(
                $instanceGroupManagersSuspendInstancesRequestResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->suspendInstances($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        suspend_instances_sample($instanceGroupManager, $project, $zone);
    }

### 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
[InstanceGroupManagersClient::updatePerInstanceConfigsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.InstanceGroupManagersClient#_Google_Cloud_Compute_V1_Client_InstanceGroupManagersClient__updatePerInstanceConfigsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.UpdatePerInstanceConfigsInstanceGroupManagerRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient;
    use Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq;
    use Google\Cloud\Compute\V1\UpdatePerInstanceConfigsInstanceGroupManagerRequest;
    use Google\Rpc\Status;

    /**
     * @param string $instanceGroupManager The name of the managed instance group.
     *                                     It should conform to RFC1035.
     * @param string $project              Project ID for this request.
     * @param string $zone                 The name of thezone
     *                                     where the managed instance group is located.
     *                                     It should conform to RFC1035.
     */
    function update_per_instance_configs_sample(
        string $instanceGroupManager,
        string $project,
        string $zone
    ): void {
        // Create a client.
        $instanceGroupManagersClient = new InstanceGroupManagersClient();

        // Prepare the request message.
        $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq();
        $request = (new UpdatePerInstanceConfigsInstanceGroupManagerRequest())
            ->setInstanceGroupManager($instanceGroupManager)
            ->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource(
                $instanceGroupManagersUpdatePerInstanceConfigsReqResource
            )
            ->setProject($project)
            ->setZone($zone);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $instanceGroupManagersClient->updatePerInstanceConfigs($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample has been automatically generated and should be regarded as a code
     * template only. It will require modifications to work:
     *  - It may require correct/in-range values for request initialization.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]';
        $project = '[PROJECT]';
        $zone = '[ZONE]';

        update_per_instance_configs_sample($instanceGroupManager, $project, $zone);
    }

### abandonInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AbandonInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### aggregatedListAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AggregatedListInstanceGroupManagersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### applyUpdatesToInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ApplyUpdatesToInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### createInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.CreateInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### deleteAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.DeleteInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### deleteInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.DeleteInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### deletePerInstanceConfigsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.DeletePerInstanceConfigsInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### getAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.GetInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.InstanceGroupManager>` |   |

### insertAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.InsertInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### listAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListInstanceGroupManagersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listErrorsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListErrorsInstanceGroupManagersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listManagedInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListManagedInstancesInstanceGroupManagersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listPerInstanceConfigsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ListPerInstanceConfigsInstanceGroupManagersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### patchAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.PatchInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### patchPerInstanceConfigsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.PatchPerInstanceConfigsInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### recreateInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.RecreateInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### resizeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ResizeInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### resumeInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ResumeInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### setInstanceTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SetInstanceTemplateInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### setTargetPoolsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SetTargetPoolsInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### startInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.StartInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### stopInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.StopInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### suspendInstancesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SuspendInstancesInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### updatePerInstanceConfigsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.UpdatePerInstanceConfigsInstanceGroupManagerRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### getOperationsClient

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.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** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |