Google Anthos Multi Cloud V1 Client - Class AzureClustersClient (1.1.1)

Reference documentation and code samples for the Google Anthos Multi Cloud V1 Client class AzureClustersClient.

Service Description: The AzureClusters API provides a single centrally managed service to create and manage Anthos clusters that run on Azure infrastructure.

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

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

Namespace

Google \ Cloud \ GkeMultiCloud \ V1 \ Client

Methods

__construct

Constructor.

Parameters
Name Description
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

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

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

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

↳ credentialsConfig array

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

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods 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.

createAzureClient

Creates a new AzureClient resource on a given Google Cloud project and region.

AzureClient resources hold client authentication information needed by the Anthos Multicloud API to manage Azure resources on your Azure subscription on your behalf.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

The async variant is AzureClustersClient::createAzureClientAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\CreateAzureClientRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureClient;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\CreateAzureClientRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent          The parent location where this
 *                                         [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] resource will be
 *                                         created.
 *
 *                                         Location names are formatted as `projects/<project-id>/locations/<region>`.
 *
 *                                         See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                         for more details on Google Cloud resource names. Please see
 *                                         {@see AzureClustersClient::locationName()} for help formatting this field.
 * @param string $azureClientTenantId      The Azure Active Directory Tenant ID.
 * @param string $azureClientApplicationId The Azure Active Directory Application ID.
 * @param string $azureClientId            A client provided ID the resource. Must be unique within the
 *                                         parent resource.
 *
 *                                         The provided ID will be part of the
 *                                         [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] resource name
 *                                         formatted as
 *                                         `projects/<project-id>/locations/<region>/azureClients/<client-id>`.
 *
 *                                         Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
 */
function create_azure_client_sample(
    string $formattedParent,
    string $azureClientTenantId,
    string $azureClientApplicationId,
    string $azureClientId
): void {
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $azureClient = (new AzureClient())
        ->setTenantId($azureClientTenantId)
        ->setApplicationId($azureClientApplicationId);
    $request = (new CreateAzureClientRequest())
        ->setParent($formattedParent)
        ->setAzureClient($azureClient)
        ->setAzureClientId($azureClientId);

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

        if ($response->operationSucceeded()) {
            /** @var AzureClient $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } 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
{
    $formattedParent = AzureClustersClient::locationName('[PROJECT]', '[LOCATION]');
    $azureClientTenantId = '[TENANT_ID]';
    $azureClientApplicationId = '[APPLICATION_ID]';
    $azureClientId = '[AZURE_CLIENT_ID]';

    create_azure_client_sample(
        $formattedParent,
        $azureClientTenantId,
        $azureClientApplicationId,
        $azureClientId
    );
}

createAzureCluster

Creates a new AzureCluster resource on a given Google Cloud Platform project and region.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

The async variant is AzureClustersClient::createAzureClusterAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\CreateAzureClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureAuthorization;
use Google\Cloud\GkeMultiCloud\V1\AzureCluster;
use Google\Cloud\GkeMultiCloud\V1\AzureClusterNetworking;
use Google\Cloud\GkeMultiCloud\V1\AzureControlPlane;
use Google\Cloud\GkeMultiCloud\V1\AzureSshConfig;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\CreateAzureClusterRequest;
use Google\Cloud\GkeMultiCloud\V1\Fleet;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                                       The parent location where this
 *                                                                      [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource will be
 *                                                                      created.
 *
 *                                                                      Location names are formatted as `projects/<project-id>/locations/<region>`.
 *
 *                                                                      See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                                                      for more details on Google Cloud resource names. Please see
 *                                                                      {@see AzureClustersClient::locationName()} for help formatting this field.
 * @param string $azureClusterAzureRegion                               The Azure region where the cluster runs.
 *
 *                                                                      Each Google Cloud region supports a subset of nearby Azure regions.
 *                                                                      You can call
 *                                                                      [GetAzureServerConfig][google.cloud.gkemulticloud.v1.AzureClusters.GetAzureServerConfig]
 *                                                                      to list all supported Azure regions within a given Google Cloud region.
 * @param string $azureClusterResourceGroupId                           The ARM ID of the resource group where the cluster resources are
 *                                                                      deployed. For example:
 *                                                                      `/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>`
 * @param string $azureClusterNetworkingVirtualNetworkId                The Azure Resource Manager (ARM) ID of the VNet associated with
 *                                                                      your cluster.
 *
 *                                                                      All components in the cluster (i.e. control plane and node pools) run on a
 *                                                                      single VNet.
 *
 *                                                                      Example:
 *                                                                      `/subscriptions/<subscription-id>/resourceGroups/<resource-group-id>/providers/Microsoft.Network/virtualNetworks/<vnet-id>`
 *
 *                                                                      This field cannot be changed after creation.
 * @param string $azureClusterNetworkingPodAddressCidrBlocksElement     The IP address range of the pods in this cluster, in CIDR
 *                                                                      notation (e.g. `10.96.0.0/14`).
 *
 *                                                                      All pods in the cluster get assigned a unique IPv4 address from these
 *                                                                      ranges. Only a single range is supported.
 *
 *                                                                      This field cannot be changed after creation.
 * @param string $azureClusterNetworkingServiceAddressCidrBlocksElement The IP address range for services in this cluster, in CIDR
 *                                                                      notation (e.g. `10.96.0.0/14`).
 *
 *                                                                      All services in the cluster get assigned a unique IPv4 address from these
 *                                                                      ranges. Only a single range is supported.
 *
 *                                                                      This field cannot be changed after creating a cluster.
 * @param string $azureClusterControlPlaneVersion                       The Kubernetes version to run on control plane replicas
 *                                                                      (e.g. `1.19.10-gke.1000`).
 *
 *                                                                      You can list all supported versions on a given Google Cloud region by
 *                                                                      calling
 *                                                                      [GetAzureServerConfig][google.cloud.gkemulticloud.v1.AzureClusters.GetAzureServerConfig].
 * @param string $azureClusterControlPlaneSshConfigAuthorizedKey        The SSH public key data for VMs managed by Anthos. This accepts
 *                                                                      the authorized_keys file format used in OpenSSH according to the sshd(8)
 *                                                                      manual page.
 * @param string $azureClusterFleetProject                              The name of the Fleet host project where this cluster will be
 *                                                                      registered.
 *
 *                                                                      Project names are formatted as
 *                                                                      `projects/<project-number>`.
 * @param string $azureClusterId                                        A client provided ID the resource. Must be unique within the
 *                                                                      parent resource.
 *
 *                                                                      The provided ID will be part of the
 *                                                                      [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource name
 *                                                                      formatted as
 *                                                                      `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`.
 *
 *                                                                      Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
 */
function create_azure_cluster_sample(
    string $formattedParent,
    string $azureClusterAzureRegion,
    string $azureClusterResourceGroupId,
    string $azureClusterNetworkingVirtualNetworkId,
    string $azureClusterNetworkingPodAddressCidrBlocksElement,
    string $azureClusterNetworkingServiceAddressCidrBlocksElement,
    string $azureClusterControlPlaneVersion,
    string $azureClusterControlPlaneSshConfigAuthorizedKey,
    string $azureClusterFleetProject,
    string $azureClusterId
): void {
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $azureClusterNetworkingPodAddressCidrBlocks = [
        $azureClusterNetworkingPodAddressCidrBlocksElement,
    ];
    $azureClusterNetworkingServiceAddressCidrBlocks = [
        $azureClusterNetworkingServiceAddressCidrBlocksElement,
    ];
    $azureClusterNetworking = (new AzureClusterNetworking())
        ->setVirtualNetworkId($azureClusterNetworkingVirtualNetworkId)
        ->setPodAddressCidrBlocks($azureClusterNetworkingPodAddressCidrBlocks)
        ->setServiceAddressCidrBlocks($azureClusterNetworkingServiceAddressCidrBlocks);
    $azureClusterControlPlaneSshConfig = (new AzureSshConfig())
        ->setAuthorizedKey($azureClusterControlPlaneSshConfigAuthorizedKey);
    $azureClusterControlPlane = (new AzureControlPlane())
        ->setVersion($azureClusterControlPlaneVersion)
        ->setSshConfig($azureClusterControlPlaneSshConfig);
    $azureClusterAuthorization = new AzureAuthorization();
    $azureClusterFleet = (new Fleet())
        ->setProject($azureClusterFleetProject);
    $azureCluster = (new AzureCluster())
        ->setAzureRegion($azureClusterAzureRegion)
        ->setResourceGroupId($azureClusterResourceGroupId)
        ->setNetworking($azureClusterNetworking)
        ->setControlPlane($azureClusterControlPlane)
        ->setAuthorization($azureClusterAuthorization)
        ->setFleet($azureClusterFleet);
    $request = (new CreateAzureClusterRequest())
        ->setParent($formattedParent)
        ->setAzureCluster($azureCluster)
        ->setAzureClusterId($azureClusterId);

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

        if ($response->operationSucceeded()) {
            /** @var AzureCluster $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } 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
{
    $formattedParent = AzureClustersClient::locationName('[PROJECT]', '[LOCATION]');
    $azureClusterAzureRegion = '[AZURE_REGION]';
    $azureClusterResourceGroupId = '[RESOURCE_GROUP_ID]';
    $azureClusterNetworkingVirtualNetworkId = '[VIRTUAL_NETWORK_ID]';
    $azureClusterNetworkingPodAddressCidrBlocksElement = '[POD_ADDRESS_CIDR_BLOCKS]';
    $azureClusterNetworkingServiceAddressCidrBlocksElement = '[SERVICE_ADDRESS_CIDR_BLOCKS]';
    $azureClusterControlPlaneVersion = '[VERSION]';
    $azureClusterControlPlaneSshConfigAuthorizedKey = '[AUTHORIZED_KEY]';
    $azureClusterFleetProject = '[PROJECT]';
    $azureClusterId = '[AZURE_CLUSTER_ID]';

    create_azure_cluster_sample(
        $formattedParent,
        $azureClusterAzureRegion,
        $azureClusterResourceGroupId,
        $azureClusterNetworkingVirtualNetworkId,
        $azureClusterNetworkingPodAddressCidrBlocksElement,
        $azureClusterNetworkingServiceAddressCidrBlocksElement,
        $azureClusterControlPlaneVersion,
        $azureClusterControlPlaneSshConfigAuthorizedKey,
        $azureClusterFleetProject,
        $azureClusterId
    );
}

createAzureNodePool

Creates a new AzureNodePool, attached to a given AzureCluster.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

The async variant is AzureClustersClient::createAzureNodePoolAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\CreateAzureNodePoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureNodeConfig;
use Google\Cloud\GkeMultiCloud\V1\AzureNodePool;
use Google\Cloud\GkeMultiCloud\V1\AzureNodePoolAutoscaling;
use Google\Cloud\GkeMultiCloud\V1\AzureSshConfig;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\CreateAzureNodePoolRequest;
use Google\Cloud\GkeMultiCloud\V1\MaxPodsConstraint;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                              The [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster]
 *                                                             resource where this node pool will be created.
 *
 *                                                             `AzureCluster` names are formatted as
 *                                                             `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`.
 *
 *                                                             See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                                             for more details on Google Cloud resource names. Please see
 *                                                             {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 * @param string $azureNodePoolVersion                         The Kubernetes version (e.g. `1.19.10-gke.1000`) running on this
 *                                                             node pool.
 * @param string $azureNodePoolConfigSshConfigAuthorizedKey    The SSH public key data for VMs managed by Anthos. This accepts
 *                                                             the authorized_keys file format used in OpenSSH according to the sshd(8)
 *                                                             manual page.
 * @param string $azureNodePoolSubnetId                        The ARM ID of the subnet where the node pool VMs run. Make sure
 *                                                             it's a subnet under the virtual network in the cluster configuration.
 * @param int    $azureNodePoolAutoscalingMinNodeCount         Minimum number of nodes in the node pool. Must be greater than or
 *                                                             equal to 1 and less than or equal to max_node_count.
 * @param int    $azureNodePoolAutoscalingMaxNodeCount         Maximum number of nodes in the node pool. Must be greater than or
 *                                                             equal to min_node_count and less than or equal to 50.
 * @param int    $azureNodePoolMaxPodsConstraintMaxPodsPerNode The maximum number of pods to schedule on a single node.
 * @param string $azureNodePoolId                              A client provided ID the resource. Must be unique within the
 *                                                             parent resource.
 *
 *                                                             The provided ID will be part of the
 *                                                             [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource name
 *                                                             formatted as
 *                                                             `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>/azureNodePools/<node-pool-id>`.
 *
 *                                                             Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
 */
function create_azure_node_pool_sample(
    string $formattedParent,
    string $azureNodePoolVersion,
    string $azureNodePoolConfigSshConfigAuthorizedKey,
    string $azureNodePoolSubnetId,
    int $azureNodePoolAutoscalingMinNodeCount,
    int $azureNodePoolAutoscalingMaxNodeCount,
    int $azureNodePoolMaxPodsConstraintMaxPodsPerNode,
    string $azureNodePoolId
): void {
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $azureNodePoolConfigSshConfig = (new AzureSshConfig())
        ->setAuthorizedKey($azureNodePoolConfigSshConfigAuthorizedKey);
    $azureNodePoolConfig = (new AzureNodeConfig())
        ->setSshConfig($azureNodePoolConfigSshConfig);
    $azureNodePoolAutoscaling = (new AzureNodePoolAutoscaling())
        ->setMinNodeCount($azureNodePoolAutoscalingMinNodeCount)
        ->setMaxNodeCount($azureNodePoolAutoscalingMaxNodeCount);
    $azureNodePoolMaxPodsConstraint = (new MaxPodsConstraint())
        ->setMaxPodsPerNode($azureNodePoolMaxPodsConstraintMaxPodsPerNode);
    $azureNodePool = (new AzureNodePool())
        ->setVersion($azureNodePoolVersion)
        ->setConfig($azureNodePoolConfig)
        ->setSubnetId($azureNodePoolSubnetId)
        ->setAutoscaling($azureNodePoolAutoscaling)
        ->setMaxPodsConstraint($azureNodePoolMaxPodsConstraint);
    $request = (new CreateAzureNodePoolRequest())
        ->setParent($formattedParent)
        ->setAzureNodePool($azureNodePool)
        ->setAzureNodePoolId($azureNodePoolId);

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

        if ($response->operationSucceeded()) {
            /** @var AzureNodePool $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } 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
{
    $formattedParent = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );
    $azureNodePoolVersion = '[VERSION]';
    $azureNodePoolConfigSshConfigAuthorizedKey = '[AUTHORIZED_KEY]';
    $azureNodePoolSubnetId = '[SUBNET_ID]';
    $azureNodePoolAutoscalingMinNodeCount = 0;
    $azureNodePoolAutoscalingMaxNodeCount = 0;
    $azureNodePoolMaxPodsConstraintMaxPodsPerNode = 0;
    $azureNodePoolId = '[AZURE_NODE_POOL_ID]';

    create_azure_node_pool_sample(
        $formattedParent,
        $azureNodePoolVersion,
        $azureNodePoolConfigSshConfigAuthorizedKey,
        $azureNodePoolSubnetId,
        $azureNodePoolAutoscalingMinNodeCount,
        $azureNodePoolAutoscalingMaxNodeCount,
        $azureNodePoolMaxPodsConstraintMaxPodsPerNode,
        $azureNodePoolId
    );
}

deleteAzureClient

Deletes a specific AzureClient resource.

If the client is used by one or more clusters, deletion will fail and a FAILED_PRECONDITION error will be returned.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

The async variant is AzureClustersClient::deleteAzureClientAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\DeleteAzureClientRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\DeleteAzureClientRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name the
 *                              [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] to delete.
 *
 *                              [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] names are
 *                              formatted as
 *                              `projects/<project-id>/locations/<region>/azureClients/<client-id>`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud resource names. Please see
 *                              {@see AzureClustersClient::azureClientName()} for help formatting this field.
 */
function delete_azure_client_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new DeleteAzureClientRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $azureClustersClient->deleteAzureClient($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
{
    $formattedName = AzureClustersClient::azureClientName('[PROJECT]', '[LOCATION]', '[AZURE_CLIENT]');

    delete_azure_client_sample($formattedName);
}

deleteAzureCluster

Deletes a specific AzureCluster resource.

Fails if the cluster has one or more associated AzureNodePool resources.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

The async variant is AzureClustersClient::deleteAzureClusterAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\DeleteAzureClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\DeleteAzureClusterRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name the
 *                              [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] to delete.
 *
 *                              `AzureCluster` names are formatted as
 *                              `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud Platform resource names. Please see
 *                              {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 */
function delete_azure_cluster_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new DeleteAzureClusterRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $azureClustersClient->deleteAzureCluster($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
{
    $formattedName = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );

    delete_azure_cluster_sample($formattedName);
}

deleteAzureNodePool

Deletes a specific AzureNodePool resource.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

The async variant is AzureClustersClient::deleteAzureNodePoolAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\DeleteAzureNodePoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\DeleteAzureNodePoolRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name the
 *                              [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] to delete.
 *
 *                              `AzureNodePool` names are formatted as
 *                              `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>/azureNodePools/<node-pool-id>`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud resource names. Please see
 *                              {@see AzureClustersClient::azureNodePoolName()} for help formatting this field.
 */
function delete_azure_node_pool_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new DeleteAzureNodePoolRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $azureClustersClient->deleteAzureNodePool($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
{
    $formattedName = AzureClustersClient::azureNodePoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]',
        '[AZURE_NODE_POOL]'
    );

    delete_azure_node_pool_sample($formattedName);
}

generateAzureAccessToken

Generates a short-lived access token to authenticate to a given AzureCluster resource.

The async variant is AzureClustersClient::generateAzureAccessTokenAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GenerateAzureAccessTokenRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\GenerateAzureAccessTokenResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GenerateAzureAccessTokenRequest;
use Google\Cloud\GkeMultiCloud\V1\GenerateAzureAccessTokenResponse;

/**
 * @param string $formattedAzureCluster The name of the
 *                                      [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource to
 *                                      authenticate to.
 *
 *                                      `AzureCluster` names are formatted as
 *                                      `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`.
 *
 *                                      See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                      for more details on Google Cloud resource names. Please see
 *                                      {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 */
function generate_azure_access_token_sample(string $formattedAzureCluster): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GenerateAzureAccessTokenRequest())
        ->setAzureCluster($formattedAzureCluster);

    // Call the API and handle any network failures.
    try {
        /** @var GenerateAzureAccessTokenResponse $response */
        $response = $azureClustersClient->generateAzureAccessToken($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
{
    $formattedAzureCluster = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );

    generate_azure_access_token_sample($formattedAzureCluster);
}

generateAzureClusterAgentToken

Generates an access token for a cluster agent.

The async variant is AzureClustersClient::generateAzureClusterAgentTokenAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GenerateAzureClusterAgentTokenRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\GenerateAzureClusterAgentTokenResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GenerateAzureClusterAgentTokenRequest;
use Google\Cloud\GkeMultiCloud\V1\GenerateAzureClusterAgentTokenResponse;

/**
 * @param string $formattedAzureCluster Please see
 *                                      {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 * @param string $subjectToken          Required.
 * @param string $subjectTokenType      Required.
 * @param string $version               Required.
 */
function generate_azure_cluster_agent_token_sample(
    string $formattedAzureCluster,
    string $subjectToken,
    string $subjectTokenType,
    string $version
): void {
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GenerateAzureClusterAgentTokenRequest())
        ->setAzureCluster($formattedAzureCluster)
        ->setSubjectToken($subjectToken)
        ->setSubjectTokenType($subjectTokenType)
        ->setVersion($version);

    // Call the API and handle any network failures.
    try {
        /** @var GenerateAzureClusterAgentTokenResponse $response */
        $response = $azureClustersClient->generateAzureClusterAgentToken($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
{
    $formattedAzureCluster = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );
    $subjectToken = '[SUBJECT_TOKEN]';
    $subjectTokenType = '[SUBJECT_TOKEN_TYPE]';
    $version = '[VERSION]';

    generate_azure_cluster_agent_token_sample(
        $formattedAzureCluster,
        $subjectToken,
        $subjectTokenType,
        $version
    );
}

getAzureClient

Describes a specific AzureClient resource.

The async variant is AzureClustersClient::getAzureClientAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureClientRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\AzureClient
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\AzureClient;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GetAzureClientRequest;

/**
 * @param string $formattedName The name of the
 *                              [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] resource to
 *                              describe.
 *
 *                              [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] names are
 *                              formatted as
 *                              `projects/<project-id>/locations/<region>/azureClients/<client-id>`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud resource names. Please see
 *                              {@see AzureClustersClient::azureClientName()} for help formatting this field.
 */
function get_azure_client_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GetAzureClientRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var AzureClient $response */
        $response = $azureClustersClient->getAzureClient($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
{
    $formattedName = AzureClustersClient::azureClientName('[PROJECT]', '[LOCATION]', '[AZURE_CLIENT]');

    get_azure_client_sample($formattedName);
}

getAzureCluster

Describes a specific AzureCluster resource.

The async variant is AzureClustersClient::getAzureClusterAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\AzureCluster
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\AzureCluster;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GetAzureClusterRequest;

/**
 * @param string $formattedName The name of the
 *                              [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resource to
 *                              describe.
 *
 *                              `AzureCluster` names are formatted as
 *                              `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud Platform resource names. Please see
 *                              {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 */
function get_azure_cluster_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GetAzureClusterRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var AzureCluster $response */
        $response = $azureClustersClient->getAzureCluster($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
{
    $formattedName = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );

    get_azure_cluster_sample($formattedName);
}

getAzureJsonWebKeys

Gets the public component of the cluster signing keys in JSON Web Key format.

The async variant is AzureClustersClient::getAzureJsonWebKeysAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureJsonWebKeysRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\AzureJsonWebKeys
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\AzureJsonWebKeys;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GetAzureJsonWebKeysRequest;

/**
 * @param string $formattedAzureCluster The AzureCluster, which owns the JsonWebKeys.
 *                                      Format:
 *                                      `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`
 *                                      Please see {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 */
function get_azure_json_web_keys_sample(string $formattedAzureCluster): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GetAzureJsonWebKeysRequest())
        ->setAzureCluster($formattedAzureCluster);

    // Call the API and handle any network failures.
    try {
        /** @var AzureJsonWebKeys $response */
        $response = $azureClustersClient->getAzureJsonWebKeys($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
{
    $formattedAzureCluster = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );

    get_azure_json_web_keys_sample($formattedAzureCluster);
}

getAzureNodePool

Describes a specific AzureNodePool resource.

The async variant is AzureClustersClient::getAzureNodePoolAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureNodePoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\AzureNodePool
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\AzureNodePool;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GetAzureNodePoolRequest;

/**
 * @param string $formattedName The name of the
 *                              [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resource to
 *                              describe.
 *
 *                              `AzureNodePool` names are formatted as
 *                              `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>/azureNodePools/<node-pool-id>`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud resource names. Please see
 *                              {@see AzureClustersClient::azureNodePoolName()} for help formatting this field.
 */
function get_azure_node_pool_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GetAzureNodePoolRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var AzureNodePool $response */
        $response = $azureClustersClient->getAzureNodePool($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
{
    $formattedName = AzureClustersClient::azureNodePoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]',
        '[AZURE_NODE_POOL]'
    );

    get_azure_node_pool_sample($formattedName);
}

getAzureOpenIdConfig

Gets the OIDC discovery document for the cluster.

See the OpenID Connect Discovery 1.0 specification for details.

The async variant is AzureClustersClient::getAzureOpenIdConfigAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureOpenIdConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\AzureOpenIdConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\AzureOpenIdConfig;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GetAzureOpenIdConfigRequest;

/**
 * @param string $formattedAzureCluster The AzureCluster, which owns the OIDC discovery document.
 *                                      Format:
 *                                      projects/<project-id>/locations/<region>/azureClusters/<cluster-id>
 *                                      Please see {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 */
function get_azure_open_id_config_sample(string $formattedAzureCluster): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GetAzureOpenIdConfigRequest())
        ->setAzureCluster($formattedAzureCluster);

    // Call the API and handle any network failures.
    try {
        /** @var AzureOpenIdConfig $response */
        $response = $azureClustersClient->getAzureOpenIdConfig($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
{
    $formattedAzureCluster = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );

    get_azure_open_id_config_sample($formattedAzureCluster);
}

getAzureServerConfig

Returns information, such as supported Azure regions and Kubernetes versions, on a given Google Cloud location.

The async variant is AzureClustersClient::getAzureServerConfigAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureServerConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\GkeMultiCloud\V1\AzureServerConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\GkeMultiCloud\V1\AzureServerConfig;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\GetAzureServerConfigRequest;

/**
 * @param string $formattedName The name of the
 *                              [AzureServerConfig][google.cloud.gkemulticloud.v1.AzureServerConfig]
 *                              resource to describe.
 *
 *                              `AzureServerConfig` names are formatted as
 *                              `projects/<project-id>/locations/<region>/azureServerConfig`.
 *
 *                              See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                              for more details on Google Cloud resource names. Please see
 *                              {@see AzureClustersClient::azureServerConfigName()} for help formatting this field.
 */
function get_azure_server_config_sample(string $formattedName): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new GetAzureServerConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var AzureServerConfig $response */
        $response = $azureClustersClient->getAzureServerConfig($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
{
    $formattedName = AzureClustersClient::azureServerConfigName('[PROJECT]', '[LOCATION]');

    get_azure_server_config_sample($formattedName);
}

listAzureClients

Lists all AzureClient resources on a given Google Cloud project and region.

The async variant is AzureClustersClient::listAzureClientsAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\ListAzureClientsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureClient;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\ListAzureClientsRequest;

/**
 * @param string $formattedParent The parent location which owns this collection of
 *                                [AzureClient][google.cloud.gkemulticloud.v1.AzureClient] resources.
 *
 *                                Location names are formatted as `projects/<project-id>/locations/<region>`.
 *
 *                                See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                for more details on Google Cloud Platform resource names. Please see
 *                                {@see AzureClustersClient::locationName()} for help formatting this field.
 */
function list_azure_clients_sample(string $formattedParent): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new ListAzureClientsRequest())
        ->setParent($formattedParent);

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

        /** @var AzureClient $element */
        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
{
    $formattedParent = AzureClustersClient::locationName('[PROJECT]', '[LOCATION]');

    list_azure_clients_sample($formattedParent);
}

listAzureClusters

Lists all AzureCluster resources on a given Google Cloud project and region.

The async variant is AzureClustersClient::listAzureClustersAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\ListAzureClustersRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureCluster;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\ListAzureClustersRequest;

/**
 * @param string $formattedParent The parent location which owns this collection of
 *                                [AzureCluster][google.cloud.gkemulticloud.v1.AzureCluster] resources.
 *
 *                                Location names are formatted as `projects/<project-id>/locations/<region>`.
 *
 *                                See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                for more details on Google Cloud Platform resource names. Please see
 *                                {@see AzureClustersClient::locationName()} for help formatting this field.
 */
function list_azure_clusters_sample(string $formattedParent): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new ListAzureClustersRequest())
        ->setParent($formattedParent);

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

        /** @var AzureCluster $element */
        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
{
    $formattedParent = AzureClustersClient::locationName('[PROJECT]', '[LOCATION]');

    list_azure_clusters_sample($formattedParent);
}

listAzureNodePools

Lists all AzureNodePool resources on a given AzureCluster.

The async variant is AzureClustersClient::listAzureNodePoolsAsync() .

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\ListAzureNodePoolsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureNodePool;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\ListAzureNodePoolsRequest;

/**
 * @param string $formattedParent The parent `AzureCluster` which owns this collection of
 *                                [AzureNodePool][google.cloud.gkemulticloud.v1.AzureNodePool] resources.
 *
 *                                `AzureCluster` names are formatted as
 *                                `projects/<project-id>/locations/<region>/azureClusters/<cluster-id>`.
 *
 *                                See [Resource Names](https://cloud.google.com/apis/design/resource_names)
 *                                for more details on Google Cloud resource names. Please see
 *                                {@see AzureClustersClient::azureClusterName()} for help formatting this field.
 */
function list_azure_node_pools_sample(string $formattedParent): void
{
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $request = (new ListAzureNodePoolsRequest())
        ->setParent($formattedParent);

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

        /** @var AzureNodePool $element */
        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
{
    $formattedParent = AzureClustersClient::azureClusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[AZURE_CLUSTER]'
    );

    list_azure_node_pools_sample($formattedParent);
}

updateAzureCluster

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\UpdateAzureClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureAuthorization;
use Google\Cloud\GkeMultiCloud\V1\AzureCluster;
use Google\Cloud\GkeMultiCloud\V1\AzureClusterNetworking;
use Google\Cloud\GkeMultiCloud\V1\AzureControlPlane;
use Google\Cloud\GkeMultiCloud\V1\AzureSshConfig;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\Fleet;
use Google\Cloud\GkeMultiCloud\V1\UpdateAzureClusterRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $azureClusterAzureRegion                               The Azure region where the cluster runs.
 *
 *                                                                      Each Google Cloud region supports a subset of nearby Azure regions.
 *                                                                      You can call
 *                                                                      [GetAzureServerConfig][google.cloud.gkemulticloud.v1.AzureClusters.GetAzureServerConfig]
 *                                                                      to list all supported Azure regions within a given Google Cloud region.
 * @param string $azureClusterResourceGroupId                           The ARM ID of the resource group where the cluster resources are
 *                                                                      deployed. For example:
 *                                                                      `/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>`
 * @param string $azureClusterNetworkingVirtualNetworkId                The Azure Resource Manager (ARM) ID of the VNet associated with
 *                                                                      your cluster.
 *
 *                                                                      All components in the cluster (i.e. control plane and node pools) run on a
 *                                                                      single VNet.
 *
 *                                                                      Example:
 *                                                                      `/subscriptions/<subscription-id>/resourceGroups/<resource-group-id>/providers/Microsoft.Network/virtualNetworks/<vnet-id>`
 *
 *                                                                      This field cannot be changed after creation.
 * @param string $azureClusterNetworkingPodAddressCidrBlocksElement     The IP address range of the pods in this cluster, in CIDR
 *                                                                      notation (e.g. `10.96.0.0/14`).
 *
 *                                                                      All pods in the cluster get assigned a unique IPv4 address from these
 *                                                                      ranges. Only a single range is supported.
 *
 *                                                                      This field cannot be changed after creation.
 * @param string $azureClusterNetworkingServiceAddressCidrBlocksElement The IP address range for services in this cluster, in CIDR
 *                                                                      notation (e.g. `10.96.0.0/14`).
 *
 *                                                                      All services in the cluster get assigned a unique IPv4 address from these
 *                                                                      ranges. Only a single range is supported.
 *
 *                                                                      This field cannot be changed after creating a cluster.
 * @param string $azureClusterControlPlaneVersion                       The Kubernetes version to run on control plane replicas
 *                                                                      (e.g. `1.19.10-gke.1000`).
 *
 *                                                                      You can list all supported versions on a given Google Cloud region by
 *                                                                      calling
 *                                                                      [GetAzureServerConfig][google.cloud.gkemulticloud.v1.AzureClusters.GetAzureServerConfig].
 * @param string $azureClusterControlPlaneSshConfigAuthorizedKey        The SSH public key data for VMs managed by Anthos. This accepts
 *                                                                      the authorized_keys file format used in OpenSSH according to the sshd(8)
 *                                                                      manual page.
 * @param string $azureClusterFleetProject                              The name of the Fleet host project where this cluster will be
 *                                                                      registered.
 *
 *                                                                      Project names are formatted as
 *                                                                      `projects/<project-number>`.
 */
function update_azure_cluster_sample(
    string $azureClusterAzureRegion,
    string $azureClusterResourceGroupId,
    string $azureClusterNetworkingVirtualNetworkId,
    string $azureClusterNetworkingPodAddressCidrBlocksElement,
    string $azureClusterNetworkingServiceAddressCidrBlocksElement,
    string $azureClusterControlPlaneVersion,
    string $azureClusterControlPlaneSshConfigAuthorizedKey,
    string $azureClusterFleetProject
): void {
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $azureClusterNetworkingPodAddressCidrBlocks = [
        $azureClusterNetworkingPodAddressCidrBlocksElement,
    ];
    $azureClusterNetworkingServiceAddressCidrBlocks = [
        $azureClusterNetworkingServiceAddressCidrBlocksElement,
    ];
    $azureClusterNetworking = (new AzureClusterNetworking())
        ->setVirtualNetworkId($azureClusterNetworkingVirtualNetworkId)
        ->setPodAddressCidrBlocks($azureClusterNetworkingPodAddressCidrBlocks)
        ->setServiceAddressCidrBlocks($azureClusterNetworkingServiceAddressCidrBlocks);
    $azureClusterControlPlaneSshConfig = (new AzureSshConfig())
        ->setAuthorizedKey($azureClusterControlPlaneSshConfigAuthorizedKey);
    $azureClusterControlPlane = (new AzureControlPlane())
        ->setVersion($azureClusterControlPlaneVersion)
        ->setSshConfig($azureClusterControlPlaneSshConfig);
    $azureClusterAuthorization = new AzureAuthorization();
    $azureClusterFleet = (new Fleet())
        ->setProject($azureClusterFleetProject);
    $azureCluster = (new AzureCluster())
        ->setAzureRegion($azureClusterAzureRegion)
        ->setResourceGroupId($azureClusterResourceGroupId)
        ->setNetworking($azureClusterNetworking)
        ->setControlPlane($azureClusterControlPlane)
        ->setAuthorization($azureClusterAuthorization)
        ->setFleet($azureClusterFleet);
    $updateMask = new FieldMask();
    $request = (new UpdateAzureClusterRequest())
        ->setAzureCluster($azureCluster)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var AzureCluster $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } 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
{
    $azureClusterAzureRegion = '[AZURE_REGION]';
    $azureClusterResourceGroupId = '[RESOURCE_GROUP_ID]';
    $azureClusterNetworkingVirtualNetworkId = '[VIRTUAL_NETWORK_ID]';
    $azureClusterNetworkingPodAddressCidrBlocksElement = '[POD_ADDRESS_CIDR_BLOCKS]';
    $azureClusterNetworkingServiceAddressCidrBlocksElement = '[SERVICE_ADDRESS_CIDR_BLOCKS]';
    $azureClusterControlPlaneVersion = '[VERSION]';
    $azureClusterControlPlaneSshConfigAuthorizedKey = '[AUTHORIZED_KEY]';
    $azureClusterFleetProject = '[PROJECT]';

    update_azure_cluster_sample(
        $azureClusterAzureRegion,
        $azureClusterResourceGroupId,
        $azureClusterNetworkingVirtualNetworkId,
        $azureClusterNetworkingPodAddressCidrBlocksElement,
        $azureClusterNetworkingServiceAddressCidrBlocksElement,
        $azureClusterControlPlaneVersion,
        $azureClusterControlPlaneSshConfigAuthorizedKey,
        $azureClusterFleetProject
    );
}

updateAzureNodePool

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\UpdateAzureNodePoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\GkeMultiCloud\V1\AzureNodeConfig;
use Google\Cloud\GkeMultiCloud\V1\AzureNodePool;
use Google\Cloud\GkeMultiCloud\V1\AzureNodePoolAutoscaling;
use Google\Cloud\GkeMultiCloud\V1\AzureSshConfig;
use Google\Cloud\GkeMultiCloud\V1\Client\AzureClustersClient;
use Google\Cloud\GkeMultiCloud\V1\MaxPodsConstraint;
use Google\Cloud\GkeMultiCloud\V1\UpdateAzureNodePoolRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $azureNodePoolVersion                         The Kubernetes version (e.g. `1.19.10-gke.1000`) running on this
 *                                                             node pool.
 * @param string $azureNodePoolConfigSshConfigAuthorizedKey    The SSH public key data for VMs managed by Anthos. This accepts
 *                                                             the authorized_keys file format used in OpenSSH according to the sshd(8)
 *                                                             manual page.
 * @param string $azureNodePoolSubnetId                        The ARM ID of the subnet where the node pool VMs run. Make sure
 *                                                             it's a subnet under the virtual network in the cluster configuration.
 * @param int    $azureNodePoolAutoscalingMinNodeCount         Minimum number of nodes in the node pool. Must be greater than or
 *                                                             equal to 1 and less than or equal to max_node_count.
 * @param int    $azureNodePoolAutoscalingMaxNodeCount         Maximum number of nodes in the node pool. Must be greater than or
 *                                                             equal to min_node_count and less than or equal to 50.
 * @param int    $azureNodePoolMaxPodsConstraintMaxPodsPerNode The maximum number of pods to schedule on a single node.
 */
function update_azure_node_pool_sample(
    string $azureNodePoolVersion,
    string $azureNodePoolConfigSshConfigAuthorizedKey,
    string $azureNodePoolSubnetId,
    int $azureNodePoolAutoscalingMinNodeCount,
    int $azureNodePoolAutoscalingMaxNodeCount,
    int $azureNodePoolMaxPodsConstraintMaxPodsPerNode
): void {
    // Create a client.
    $azureClustersClient = new AzureClustersClient();

    // Prepare the request message.
    $azureNodePoolConfigSshConfig = (new AzureSshConfig())
        ->setAuthorizedKey($azureNodePoolConfigSshConfigAuthorizedKey);
    $azureNodePoolConfig = (new AzureNodeConfig())
        ->setSshConfig($azureNodePoolConfigSshConfig);
    $azureNodePoolAutoscaling = (new AzureNodePoolAutoscaling())
        ->setMinNodeCount($azureNodePoolAutoscalingMinNodeCount)
        ->setMaxNodeCount($azureNodePoolAutoscalingMaxNodeCount);
    $azureNodePoolMaxPodsConstraint = (new MaxPodsConstraint())
        ->setMaxPodsPerNode($azureNodePoolMaxPodsConstraintMaxPodsPerNode);
    $azureNodePool = (new AzureNodePool())
        ->setVersion($azureNodePoolVersion)
        ->setConfig($azureNodePoolConfig)
        ->setSubnetId($azureNodePoolSubnetId)
        ->setAutoscaling($azureNodePoolAutoscaling)
        ->setMaxPodsConstraint($azureNodePoolMaxPodsConstraint);
    $updateMask = new FieldMask();
    $request = (new UpdateAzureNodePoolRequest())
        ->setAzureNodePool($azureNodePool)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var AzureNodePool $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } 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
{
    $azureNodePoolVersion = '[VERSION]';
    $azureNodePoolConfigSshConfigAuthorizedKey = '[AUTHORIZED_KEY]';
    $azureNodePoolSubnetId = '[SUBNET_ID]';
    $azureNodePoolAutoscalingMinNodeCount = 0;
    $azureNodePoolAutoscalingMaxNodeCount = 0;
    $azureNodePoolMaxPodsConstraintMaxPodsPerNode = 0;

    update_azure_node_pool_sample(
        $azureNodePoolVersion,
        $azureNodePoolConfigSshConfigAuthorizedKey,
        $azureNodePoolSubnetId,
        $azureNodePoolAutoscalingMinNodeCount,
        $azureNodePoolAutoscalingMaxNodeCount,
        $azureNodePoolMaxPodsConstraintMaxPodsPerNode
    );
}

createAzureClientAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\CreateAzureClientRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

createAzureClusterAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\CreateAzureClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

createAzureNodePoolAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\CreateAzureNodePoolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteAzureClientAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\DeleteAzureClientRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteAzureClusterAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\DeleteAzureClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

deleteAzureNodePoolAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\DeleteAzureNodePoolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

generateAzureAccessTokenAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GenerateAzureAccessTokenRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\GenerateAzureAccessTokenResponse>

generateAzureClusterAgentTokenAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GenerateAzureClusterAgentTokenRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\GenerateAzureClusterAgentTokenResponse>

getAzureClientAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureClientRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\AzureClient>

getAzureClusterAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\AzureCluster>

getAzureJsonWebKeysAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureJsonWebKeysRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\AzureJsonWebKeys>

getAzureNodePoolAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureNodePoolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\AzureNodePool>

getAzureOpenIdConfigAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureOpenIdConfigRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\AzureOpenIdConfig>

getAzureServerConfigAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\GetAzureServerConfigRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\GkeMultiCloud\V1\AzureServerConfig>

listAzureClientsAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\ListAzureClientsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAzureClustersAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\ListAzureClustersRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listAzureNodePoolsAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\ListAzureNodePoolsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

updateAzureClusterAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\UpdateAzureClusterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

updateAzureNodePoolAsync

Parameters
Name Description
request Google\Cloud\GkeMultiCloud\V1\UpdateAzureNodePoolRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse>

getOperationsClient

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

Returns
Type Description
Google\LongRunning\Client\OperationsClient

resumeOperation

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

Parameters
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::azureClientName

Formats a string containing the fully-qualified path to represent a azure_client resource.

Parameters
Name Description
project string
location string
azureClient string
Returns
Type Description
string The formatted azure_client resource.

static::azureClusterName

Formats a string containing the fully-qualified path to represent a azure_cluster resource.

Parameters
Name Description
project string
location string
azureCluster string
Returns
Type Description
string The formatted azure_cluster resource.

static::azureNodePoolName

Formats a string containing the fully-qualified path to represent a azure_node_pool resource.

Parameters
Name Description
project string
location string
azureCluster string
azureNodePool string
Returns
Type Description
string The formatted azure_node_pool resource.

static::azureServerConfigName

Formats a string containing the fully-qualified path to represent a azure_server_config resource.

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted azure_server_config resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted location resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • azureClient: projects/{project}/locations/{location}/azureClients/{azure_client}
  • azureCluster: projects/{project}/locations/{location}/azureClusters/{azure_cluster}
  • azureNodePool: projects/{project}/locations/{location}/azureClusters/{azure_cluster}/azureNodePools/{azure_node_pool}
  • azureServerConfig: projects/{project}/locations/{location}/azureServerConfig
  • location: projects/{project}/locations/{location}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
Name Description
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
Type Description
array An associative array from name component IDs to component values.