Google Cloud Vmware Engine V1 Client - Class VmwareEngineClient (0.3.3)

Reference documentation and code samples for the Google Cloud Vmware Engine V1 Client class VmwareEngineClient.

Service Description: VMwareEngine manages VMware's private clusters in the Cloud.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

$vmwareEngineClient = new VmwareEngineClient();
try {
    $formattedParent = $vmwareEngineClient->privateCloudName('[PROJECT]', '[LOCATION]', '[PRIVATE_CLOUD]');
    $clusterId = 'cluster_id';
    $cluster = new Cluster();
    $operationResponse = $vmwareEngineClient->createCluster($formattedParent, $clusterId, $cluster);
    $operationResponse->pollUntilComplete();
    if ($operationResponse->operationSucceeded()) {
        $result = $operationResponse->getResult();
    // doSomethingWith($result)
    } else {
        $error = $operationResponse->getError();
        // handleError($error)
    }
    // Alternatively:
    // start the operation, keep the operation name, and resume later
    $operationResponse = $vmwareEngineClient->createCluster($formattedParent, $clusterId, $cluster);
    $operationName = $operationResponse->getName();
    // ... do other work
    $newOperationResponse = $vmwareEngineClient->resumeOperation($operationName, 'createCluster');
    while (!$newOperationResponse->isDone()) {
        // ... do other work
        $newOperationResponse->reload();
    }
    if ($newOperationResponse->operationSucceeded()) {
        $result = $newOperationResponse->getResult();
    // doSomethingWith($result)
    } else {
        $error = $newOperationResponse->getError();
        // handleError($error)
    }
} finally {
    $vmwareEngineClient->close();
}

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.

This service has a new (beta) implementation. See Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient to use the new surface.

Namespace

Google \ Cloud \ VmwareEngine \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

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

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

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

↳ credentialsConfig array

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

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

The transport used for executing network requests. 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.

createCluster

Creates a new cluster in a given private cloud.

Creating a new cluster provides additional nodes for use in the parent private cloud and requires sufficient node quota.

Parameters
NameDescription
parent string

Required. The resource name of the private cloud to create a new cluster in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

clusterId string

Required. The user-provided identifier of the new Cluster. This identifier must be unique among clusters within the parent and becomes the final token in the name URI. The identifier must meet the following requirements:

  • Only contains 1-63 alphanumeric characters and hyphens
  • Begins with an alphabetical character
  • Ends with a non-hyphen character
  • Not formatted as a UUID
  • Complies with RFC 1034 (section 3.5)
cluster Google\Cloud\VmwareEngine\V1\Cluster

Required. The initial description of the new cluster.

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ validateOnly bool

Optional. True if you want the request to be validated and not executed; false otherwise.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Cluster;
use Google\Cloud\VmwareEngine\V1\CreateClusterRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The resource name of the private cloud to create a new cluster
 *                                in. Resource names are schemeless URIs that follow the conventions in
 *                                https://cloud.google.com/apis/design/resource_names.
 *                                For example:
 *                                `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 * @param string $clusterId       The user-provided identifier of the new `Cluster`.
 *                                This identifier must be unique among clusters within the parent and becomes
 *                                the final token in the name URI.
 *                                The identifier must meet the following requirements:
 *
 *                                * Only contains 1-63 alphanumeric characters and hyphens
 *                                * Begins with an alphabetical character
 *                                * Ends with a non-hyphen character
 *                                * Not formatted as a UUID
 *                                * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
 *                                (section 3.5)
 */
function create_cluster_sample(string $formattedParent, string $clusterId): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $clusterNodeTypeConfigs = [];
    $cluster = (new Cluster())
        ->setNodeTypeConfigs($clusterNodeTypeConfigs);
    $request = (new CreateClusterRequest())
        ->setParent($formattedParent)
        ->setClusterId($clusterId)
        ->setCluster($cluster);

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

        if ($response->operationSucceeded()) {
            /** @var Cluster $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 = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );
    $clusterId = '[CLUSTER_ID]';

    create_cluster_sample($formattedParent, $clusterId);
}

createHcxActivationKey

Creates a new HCX activation key in a given private cloud.

Parameters
NameDescription
parent string

Required. The resource name of the private cloud to create the key for. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/privateClouds/my-cloud

hcxActivationKey Google\Cloud\VmwareEngine\V1\HcxActivationKey

Required. The initial description of a new HCX activation key. When creating a new key, this field must be an empty object.

hcxActivationKeyId string

Required. The user-provided identifier of the HcxActivationKey to be created. This identifier must be unique among HcxActivationKey resources within the parent and becomes the final token in the name URI. The identifier must meet the following requirements:

  • Only contains 1-63 alphanumeric characters and hyphens
  • Begins with an alphabetical character
  • Ends with a non-hyphen character
  • Not formatted as a UUID
  • Complies with RFC 1034 (section 3.5)
optionalArgs array

Optional.

↳ requestId string

A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\CreateHcxActivationKeyRequest;
use Google\Cloud\VmwareEngine\V1\HcxActivationKey;
use Google\Rpc\Status;

/**
 * @param string $formattedParent    The resource name of the private cloud to create the key for.
 *                                   Resource names are schemeless URIs that follow the conventions in
 *                                   https://cloud.google.com/apis/design/resource_names.
 *                                   For example:
 *                                   `projects/my-project/locations/us-central1/privateClouds/my-cloud`
 *                                   Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 * @param string $hcxActivationKeyId The user-provided identifier of the `HcxActivationKey` to be
 *                                   created. This identifier must be unique among `HcxActivationKey` resources
 *                                   within the parent and becomes the final token in the name URI.
 *                                   The identifier must meet the following requirements:
 *
 *                                   * Only contains 1-63 alphanumeric characters and hyphens
 *                                   * Begins with an alphabetical character
 *                                   * Ends with a non-hyphen character
 *                                   * Not formatted as a UUID
 *                                   * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
 *                                   (section 3.5)
 */
function create_hcx_activation_key_sample(
    string $formattedParent,
    string $hcxActivationKeyId
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $hcxActivationKey = new HcxActivationKey();
    $request = (new CreateHcxActivationKeyRequest())
        ->setParent($formattedParent)
        ->setHcxActivationKey($hcxActivationKey)
        ->setHcxActivationKeyId($hcxActivationKeyId);

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

        if ($response->operationSucceeded()) {
            /** @var HcxActivationKey $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 = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );
    $hcxActivationKeyId = '[HCX_ACTIVATION_KEY_ID]';

    create_hcx_activation_key_sample($formattedParent, $hcxActivationKeyId);
}

createNetworkPolicy

Creates a new network policy in a given VMware Engine network of a project and location (region). A new network policy cannot be created if another network policy already exists in the same scope.

Parameters
NameDescription
parent string

Required. The resource name of the location (region) to create the new network policy in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1

networkPolicyId string

Required. The user-provided identifier of the network policy to be created. This identifier must be unique within parent projects/{my-project}/locations/{us-central1}/networkPolicies and becomes the final token in the name URI. The identifier must meet the following requirements:

  • Only contains 1-63 alphanumeric characters and hyphens
  • Begins with an alphabetical character
  • Ends with a non-hyphen character
  • Not formatted as a UUID
  • Complies with RFC 1034 (section 3.5)
networkPolicy Google\Cloud\VmwareEngine\V1\NetworkPolicy

Required. The network policy configuration to use in the request.

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\CreateNetworkPolicyRequest;
use Google\Cloud\VmwareEngine\V1\NetworkPolicy;
use Google\Rpc\Status;

/**
 * @param string $formattedParent               The resource name of the location (region)
 *                                              to create the new network policy in.
 *                                              Resource names are schemeless URIs that follow the conventions in
 *                                              https://cloud.google.com/apis/design/resource_names.
 *                                              For example:
 *                                              `projects/my-project/locations/us-central1`
 *                                              Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 * @param string $networkPolicyId               The user-provided identifier of the network policy to be created.
 *                                              This identifier must be unique within parent
 *                                              `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
 *                                              the final token in the name URI.
 *                                              The identifier must meet the following requirements:
 *
 *                                              * Only contains 1-63 alphanumeric characters and hyphens
 *                                              * Begins with an alphabetical character
 *                                              * Ends with a non-hyphen character
 *                                              * Not formatted as a UUID
 *                                              * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
 *                                              (section 3.5)
 * @param string $networkPolicyEdgeServicesCidr IP address range in CIDR notation used to create internet access
 *                                              and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
 *                                              required. The range cannot overlap with any prefixes either in the consumer
 *                                              VPC network or in use by the private clouds attached to that VPC network.
 */
function create_network_policy_sample(
    string $formattedParent,
    string $networkPolicyId,
    string $networkPolicyEdgeServicesCidr
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $networkPolicy = (new NetworkPolicy())
        ->setEdgeServicesCidr($networkPolicyEdgeServicesCidr);
    $request = (new CreateNetworkPolicyRequest())
        ->setParent($formattedParent)
        ->setNetworkPolicyId($networkPolicyId)
        ->setNetworkPolicy($networkPolicy);

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

        if ($response->operationSucceeded()) {
            /** @var NetworkPolicy $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');
    $networkPolicyId = '[NETWORK_POLICY_ID]';
    $networkPolicyEdgeServicesCidr = '[EDGE_SERVICES_CIDR]';

    create_network_policy_sample($formattedParent, $networkPolicyId, $networkPolicyEdgeServicesCidr);
}

createPrivateCloud

Creates a new PrivateCloud resource in a given project and location.

Private clouds can only be created in zones, regional private clouds are not supported.

Creating a private cloud also creates a management cluster for that private cloud.

Parameters
NameDescription
parent string

Required. The resource name of the location to create the new private cloud in. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a

privateCloudId string

Required. The user-provided identifier of the private cloud to be created. This identifier must be unique among each PrivateCloud within the parent and becomes the final token in the name URI. The identifier must meet the following requirements:

  • Only contains 1-63 alphanumeric characters and hyphens
  • Begins with an alphabetical character
  • Ends with a non-hyphen character
  • Not formatted as a UUID
  • Complies with RFC 1034 (section 3.5)
privateCloud Google\Cloud\VmwareEngine\V1\PrivateCloud

Required. The initial description of the new private cloud.

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ validateOnly bool

Optional. True if you want the request to be validated and not executed; false otherwise.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\CreatePrivateCloudRequest;
use Google\Cloud\VmwareEngine\V1\NetworkConfig;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;
use Google\Cloud\VmwareEngine\V1\PrivateCloud\ManagementCluster;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                         The resource name of the location to create the new
 *                                                        private cloud in. Resource names are schemeless URIs that follow the
 *                                                        conventions in https://cloud.google.com/apis/design/resource_names.
 *                                                        For example:
 *                                                        `projects/my-project/locations/us-central1-a`
 *                                                        Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 * @param string $privateCloudId                          The user-provided identifier of the private cloud to be created.
 *                                                        This identifier must be unique among each `PrivateCloud` within the parent
 *                                                        and becomes the final token in the name URI.
 *                                                        The identifier must meet the following requirements:
 *
 *                                                        * Only contains 1-63 alphanumeric characters and hyphens
 *                                                        * Begins with an alphabetical character
 *                                                        * Ends with a non-hyphen character
 *                                                        * Not formatted as a UUID
 *                                                        * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
 *                                                        (section 3.5)
 * @param string $privateCloudNetworkConfigManagementCidr Management CIDR used by VMware management appliances.
 * @param string $privateCloudManagementClusterClusterId  The user-provided identifier of the new `Cluster`.
 *                                                        The identifier must meet the following requirements:
 *
 *                                                        * Only contains 1-63 alphanumeric characters and hyphens
 *                                                        * Begins with an alphabetical character
 *                                                        * Ends with a non-hyphen character
 *                                                        * Not formatted as a UUID
 *                                                        * Complies with [RFC
 *                                                        1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
 */
function create_private_cloud_sample(
    string $formattedParent,
    string $privateCloudId,
    string $privateCloudNetworkConfigManagementCidr,
    string $privateCloudManagementClusterClusterId
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $privateCloudNetworkConfig = (new NetworkConfig())
        ->setManagementCidr($privateCloudNetworkConfigManagementCidr);
    $privateCloudManagementClusterNodeTypeConfigs = [];
    $privateCloudManagementCluster = (new ManagementCluster())
        ->setClusterId($privateCloudManagementClusterClusterId)
        ->setNodeTypeConfigs($privateCloudManagementClusterNodeTypeConfigs);
    $privateCloud = (new PrivateCloud())
        ->setNetworkConfig($privateCloudNetworkConfig)
        ->setManagementCluster($privateCloudManagementCluster);
    $request = (new CreatePrivateCloudRequest())
        ->setParent($formattedParent)
        ->setPrivateCloudId($privateCloudId)
        ->setPrivateCloud($privateCloud);

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

        if ($response->operationSucceeded()) {
            /** @var PrivateCloud $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');
    $privateCloudId = '[PRIVATE_CLOUD_ID]';
    $privateCloudNetworkConfigManagementCidr = '[MANAGEMENT_CIDR]';
    $privateCloudManagementClusterClusterId = '[CLUSTER_ID]';

    create_private_cloud_sample(
        $formattedParent,
        $privateCloudId,
        $privateCloudNetworkConfigManagementCidr,
        $privateCloudManagementClusterClusterId
    );
}

createPrivateConnection

Creates a new private connection that can be used for accessing private Clouds.

Parameters
NameDescription
parent string

Required. The resource name of the location to create the new private connection in. Private connection is a regional resource. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1

privateConnectionId string

Required. The user-provided identifier of the new private connection. This identifier must be unique among private connection resources within the parent and becomes the final token in the name URI. The identifier must meet the following requirements:

  • Only contains 1-63 alphanumeric characters and hyphens
  • Begins with an alphabetical character
  • Ends with a non-hyphen character
  • Not formatted as a UUID
  • Complies with RFC 1034 (section 3.5)
privateConnection Google\Cloud\VmwareEngine\V1\PrivateConnection

Required. The initial description of the new private connection.

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\CreatePrivateConnectionRequest;
use Google\Cloud\VmwareEngine\V1\PrivateConnection;
use Google\Cloud\VmwareEngine\V1\PrivateConnection\Type;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                               The resource name of the location to create the new private
 *                                                              connection in. Private connection is a regional resource.
 *                                                              Resource names are schemeless URIs that follow the conventions in
 *                                                              https://cloud.google.com/apis/design/resource_names. For example:
 *                                                              `projects/my-project/locations/us-central1`
 *                                                              Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 * @param string $privateConnectionId                           The user-provided identifier of the new private connection.
 *                                                              This identifier must be unique among private connection resources
 *                                                              within the parent and becomes the final token in the name URI. The
 *                                                              identifier must meet the following requirements:
 *
 *                                                              * Only contains 1-63 alphanumeric characters and hyphens
 *                                                              * Begins with an alphabetical character
 *                                                              * Ends with a non-hyphen character
 *                                                              * Not formatted as a UUID
 *                                                              * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
 *                                                              (section 3.5)
 * @param string $formattedPrivateConnectionVmwareEngineNetwork The relative resource name of Legacy VMware Engine network.
 *                                                              Specify the name in the following form:
 *                                                              `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
 *                                                              where `{project}`, `{location}` will be same as specified in private
 *                                                              connection resource name and `{vmware_engine_network_id}` will be in the
 *                                                              form of `{location}`-default e.g.
 *                                                              projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default. Please see
 *                                                              {@see VmwareEngineClient::vmwareEngineNetworkName()} for help formatting this field.
 * @param int    $privateConnectionType                         Private connection type.
 * @param string $formattedPrivateConnectionServiceNetwork      Service network to create private connection.
 *                                                              Specify the name in the following form:
 *                                                              `projects/{project}/global/networks/{network_id}`
 *                                                              For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
 *                                                              VPC, e.g. projects/project-tp/global/networks/servicenetworking.
 *                                                              For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
 *                                                              e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
 *                                                              For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
 *                                                              projects/project-tp/global/networks/dell-tenant-vpc.
 *                                                              For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
 *                                                              any other producer VPC to which the VMware Engine Network needs to be
 *                                                              connected, e.g. projects/project/global/networks/vpc. Please see
 *                                                              {@see VmwareEngineClient::networkName()} for help formatting this field.
 */
function create_private_connection_sample(
    string $formattedParent,
    string $privateConnectionId,
    string $formattedPrivateConnectionVmwareEngineNetwork,
    int $privateConnectionType,
    string $formattedPrivateConnectionServiceNetwork
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $privateConnection = (new PrivateConnection())
        ->setVmwareEngineNetwork($formattedPrivateConnectionVmwareEngineNetwork)
        ->setType($privateConnectionType)
        ->setServiceNetwork($formattedPrivateConnectionServiceNetwork);
    $request = (new CreatePrivateConnectionRequest())
        ->setParent($formattedParent)
        ->setPrivateConnectionId($privateConnectionId)
        ->setPrivateConnection($privateConnection);

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

        if ($response->operationSucceeded()) {
            /** @var PrivateConnection $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');
    $privateConnectionId = '[PRIVATE_CONNECTION_ID]';
    $formattedPrivateConnectionVmwareEngineNetwork = VmwareEngineClient::vmwareEngineNetworkName(
        '[PROJECT]',
        '[LOCATION]',
        '[VMWARE_ENGINE_NETWORK]'
    );
    $privateConnectionType = Type::TYPE_UNSPECIFIED;
    $formattedPrivateConnectionServiceNetwork = VmwareEngineClient::networkName(
        '[PROJECT]',
        '[NETWORK]'
    );

    create_private_connection_sample(
        $formattedParent,
        $privateConnectionId,
        $formattedPrivateConnectionVmwareEngineNetwork,
        $privateConnectionType,
        $formattedPrivateConnectionServiceNetwork
    );
}

createVmwareEngineNetwork

Creates a new VMware Engine network that can be used by a private cloud.

Parameters
NameDescription
parent string

Required. The resource name of the location to create the new VMware Engine network in. A VMware Engine network of type LEGACY is a regional resource, and a VMware Engine network of type STANDARD is a global resource. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/global

vmwareEngineNetworkId string

Required. The user-provided identifier of the new VMware Engine network. This identifier must be unique among VMware Engine network resources within the parent and becomes the final token in the name URI. The identifier must meet the following requirements:

  • For networks of type LEGACY, adheres to the format: {region-id}-default. Replace {region-id} with the region where you want to create the VMware Engine network. For example, "us-central1-default".
  • Only contains 1-63 alphanumeric characters and hyphens
  • Begins with an alphabetical character
  • Ends with a non-hyphen character
  • Not formatted as a UUID
  • Complies with RFC 1034 (section 3.5)
vmwareEngineNetwork Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork

Required. The initial description of the new VMware Engine network.

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\CreateVmwareEngineNetworkRequest;
use Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork;
use Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork\Type;
use Google\Rpc\Status;

/**
 * @param string $formattedParent         The resource name of the location to create the new VMware Engine
 *                                        network in. A VMware Engine network of type
 *                                        `LEGACY` is a regional resource, and a VMware
 *                                        Engine network of type `STANDARD` is a global resource.
 *                                        Resource names are schemeless URIs that follow the conventions in
 *                                        https://cloud.google.com/apis/design/resource_names. For example:
 *                                        `projects/my-project/locations/global`
 *                                        Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 * @param string $vmwareEngineNetworkId   The user-provided identifier of the new VMware Engine network.
 *                                        This identifier must be unique among VMware Engine network resources
 *                                        within the parent and becomes the final token in the name URI. The
 *                                        identifier must meet the following requirements:
 *
 *                                        * For networks of type LEGACY, adheres to the format:
 *                                        `{region-id}-default`. Replace `{region-id}` with the region where you want
 *                                        to create the VMware Engine network. For example, "us-central1-default".
 *                                        * Only contains 1-63 alphanumeric characters and hyphens
 *                                        * Begins with an alphabetical character
 *                                        * Ends with a non-hyphen character
 *                                        * Not formatted as a UUID
 *                                        * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
 *                                        (section 3.5)
 * @param int    $vmwareEngineNetworkType VMware Engine network type.
 */
function create_vmware_engine_network_sample(
    string $formattedParent,
    string $vmwareEngineNetworkId,
    int $vmwareEngineNetworkType
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $vmwareEngineNetwork = (new VmwareEngineNetwork())
        ->setType($vmwareEngineNetworkType);
    $request = (new CreateVmwareEngineNetworkRequest())
        ->setParent($formattedParent)
        ->setVmwareEngineNetworkId($vmwareEngineNetworkId)
        ->setVmwareEngineNetwork($vmwareEngineNetwork);

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

        if ($response->operationSucceeded()) {
            /** @var VmwareEngineNetwork $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');
    $vmwareEngineNetworkId = '[VMWARE_ENGINE_NETWORK_ID]';
    $vmwareEngineNetworkType = Type::TYPE_UNSPECIFIED;

    create_vmware_engine_network_sample(
        $formattedParent,
        $vmwareEngineNetworkId,
        $vmwareEngineNetworkType
    );
}

deleteCluster

Deletes a Cluster resource. To avoid unintended data loss, migrate or gracefully shut down any workloads running on the cluster before deletion.

You cannot delete the management cluster of a private cloud using this method.

Parameters
NameDescription
name string

Required. The resource name of the cluster to delete. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\DeleteClusterRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the cluster to delete.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
 *                              Please see {@see VmwareEngineClient::clusterName()} for help formatting this field.
 */
function delete_cluster_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmwareEngineClient->deleteCluster($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 = VmwareEngineClient::clusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]',
        '[CLUSTER]'
    );

    delete_cluster_sample($formattedName);
}

deleteNetworkPolicy

Deletes a NetworkPolicy resource. A network policy cannot be deleted when NetworkService.state is set to RECONCILING for either its external IP or internet access service.

Parameters
NameDescription
name string

Required. The resource name of the network policy to delete. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/networkPolicies/my-network-policy

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\DeleteNetworkPolicyRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the network policy to delete.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
 *                              Please see {@see VmwareEngineClient::networkPolicyName()} for help formatting this field.
 */
function delete_network_policy_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmwareEngineClient->deleteNetworkPolicy($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 = VmwareEngineClient::networkPolicyName(
        '[PROJECT]',
        '[LOCATION]',
        '[NETWORK_POLICY]'
    );

    delete_network_policy_sample($formattedName);
}

deletePrivateCloud

Schedules a PrivateCloud resource for deletion.

A PrivateCloud resource scheduled for deletion has PrivateCloud.state set to DELETED and expireTime set to the time when deletion is final and can no longer be reversed. The delete operation is marked as done as soon as the PrivateCloud is successfully scheduled for deletion (this also applies when delayHours is set to zero), and the operation is not kept in pending state until PrivateCloud is purged. PrivateCloud can be restored using UndeletePrivateCloud method before the expireTime elapses. When expireTime is reached, deletion is final and all private cloud resources are irreversibly removed and billing stops. During the final removal process, PrivateCloud.state is set to PURGING. PrivateCloud can be polled using standard GET method for the whole period of deletion and purging. It will not be returned only when it is completely purged.

Parameters
NameDescription
name string

Required. The resource name of the private cloud to delete. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ force bool

Optional. If set to true, cascade delete is enabled and all children of this private cloud resource are also deleted. When this flag is set to false, the private cloud will not be deleted if there are any children other than the management cluster. The management cluster is always deleted.

↳ delayHours int

Optional. Time delay of the deletion specified in hours. The default value is 3. Specifying a non-zero value for this field changes the value of PrivateCloud.state to DELETED and sets expire_time to the planned deletion time. Deletion can be cancelled before expire_time elapses using VmwareEngine.UndeletePrivateCloud. Specifying a value of 0 for this field instead begins the deletion process and ceases billing immediately. During the final deletion process, the value of PrivateCloud.state becomes PURGING.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\DeletePrivateCloudRequest;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the private cloud to delete.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                              Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function delete_private_cloud_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var PrivateCloud $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
{
    $formattedName = VmwareEngineClient::privateCloudName('[PROJECT]', '[LOCATION]', '[PRIVATE_CLOUD]');

    delete_private_cloud_sample($formattedName);
}

deletePrivateConnection

Deletes a PrivateConnection resource. When a private connection is deleted for a VMware Engine network, the connected network becomes inaccessible to that VMware Engine network.

Parameters
NameDescription
name string

Required. The resource name of the private connection to be deleted. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/privateConnections/my-connection

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\DeletePrivateConnectionRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the private connection to be deleted.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1/privateConnections/my-connection`
 *                              Please see {@see VmwareEngineClient::privateConnectionName()} for help formatting this field.
 */
function delete_private_connection_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmwareEngineClient->deletePrivateConnection($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 = VmwareEngineClient::privateConnectionName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CONNECTION]'
    );

    delete_private_connection_sample($formattedName);
}

deleteVmwareEngineNetwork

Deletes a VmwareEngineNetwork resource. You can only delete a VMware Engine network after all resources that refer to it are deleted. For example, a private cloud, a network peering, and a network policy can all refer to the same VMware Engine network.

Parameters
NameDescription
name string

Required. The resource name of the VMware Engine network to be deleted. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/global/vmwareEngineNetworks/my-network

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ etag string

Optional. Checksum used to ensure that the user-provided value is up to date before the server processes the request. The server compares provided checksum with the current checksum of the resource. If the user-provided value is out of date, this request returns an ABORTED error.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\DeleteVmwareEngineNetworkRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the VMware Engine network to be deleted.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
 *                              Please see {@see VmwareEngineClient::vmwareEngineNetworkName()} for help formatting this field.
 */
function delete_vmware_engine_network_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmwareEngineClient->deleteVmwareEngineNetwork($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 = VmwareEngineClient::vmwareEngineNetworkName(
        '[PROJECT]',
        '[LOCATION]',
        '[VMWARE_ENGINE_NETWORK]'
    );

    delete_vmware_engine_network_sample($formattedName);
}

getCluster

Retrieves a Cluster resource by its resource name.

Parameters
NameDescription
name string

Required. The cluster resource name to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\Cluster
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Cluster;
use Google\Cloud\VmwareEngine\V1\GetClusterRequest;

/**
 * @param string $formattedName The cluster resource name to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
 *                              Please see {@see VmwareEngineClient::clusterName()} for help formatting this field.
 */
function get_cluster_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Cluster $response */
        $response = $vmwareEngineClient->getCluster($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 = VmwareEngineClient::clusterName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]',
        '[CLUSTER]'
    );

    get_cluster_sample($formattedName);
}

getHcxActivationKey

Retrieves a HcxActivationKey resource by its resource name.

Parameters
NameDescription
name string

Required. The resource name of the HCX activation key to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\HcxActivationKey
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetHcxActivationKeyRequest;
use Google\Cloud\VmwareEngine\V1\HcxActivationKey;

/**
 * @param string $formattedName The resource name of the HCX activation key to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
 *                              Please see {@see VmwareEngineClient::hcxActivationKeyName()} for help formatting this field.
 */
function get_hcx_activation_key_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var HcxActivationKey $response */
        $response = $vmwareEngineClient->getHcxActivationKey($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 = VmwareEngineClient::hcxActivationKeyName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]',
        '[HCX_ACTIVATION_KEY]'
    );

    get_hcx_activation_key_sample($formattedName);
}

getNetworkPolicy

Retrieves a NetworkPolicy resource by its resource name.

Parameters
NameDescription
name string

Required. The resource name of the network policy to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/networkPolicies/my-network-policy

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\NetworkPolicy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetNetworkPolicyRequest;
use Google\Cloud\VmwareEngine\V1\NetworkPolicy;

/**
 * @param string $formattedName The resource name of the network policy to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
 *                              Please see {@see VmwareEngineClient::networkPolicyName()} for help formatting this field.
 */
function get_network_policy_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var NetworkPolicy $response */
        $response = $vmwareEngineClient->getNetworkPolicy($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 = VmwareEngineClient::networkPolicyName(
        '[PROJECT]',
        '[LOCATION]',
        '[NETWORK_POLICY]'
    );

    get_network_policy_sample($formattedName);
}

getNodeType

Gets details of a single NodeType.

Parameters
NameDescription
name string

Required. The resource name of the node type to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-proj/locations/us-central1-a/nodeTypes/standard-72

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\NodeType
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetNodeTypeRequest;
use Google\Cloud\VmwareEngine\V1\NodeType;

/**
 * @param string $formattedName The resource name of the node type to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
 *                              Please see {@see VmwareEngineClient::nodeTypeName()} for help formatting this field.
 */
function get_node_type_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var NodeType $response */
        $response = $vmwareEngineClient->getNodeType($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 = VmwareEngineClient::nodeTypeName('[PROJECT]', '[LOCATION]', '[NODE_TYPE]');

    get_node_type_sample($formattedName);
}

getPrivateCloud

Retrieves a PrivateCloud resource by its resource name.

Parameters
NameDescription
name string

Required. The resource name of the private cloud to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\PrivateCloud
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetPrivateCloudRequest;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;

/**
 * @param string $formattedName The resource name of the private cloud to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                              Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function get_private_cloud_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var PrivateCloud $response */
        $response = $vmwareEngineClient->getPrivateCloud($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 = VmwareEngineClient::privateCloudName('[PROJECT]', '[LOCATION]', '[PRIVATE_CLOUD]');

    get_private_cloud_sample($formattedName);
}

getPrivateConnection

Retrieves a PrivateConnection resource by its resource name. The resource contains details of the private connection, such as connected network, routing mode and state.

Parameters
NameDescription
name string

Required. The resource name of the private connection to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/privateConnections/my-connection

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\PrivateConnection
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetPrivateConnectionRequest;
use Google\Cloud\VmwareEngine\V1\PrivateConnection;

/**
 * @param string $formattedName The resource name of the private connection to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1/privateConnections/my-connection`
 *                              Please see {@see VmwareEngineClient::privateConnectionName()} for help formatting this field.
 */
function get_private_connection_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var PrivateConnection $response */
        $response = $vmwareEngineClient->getPrivateConnection($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 = VmwareEngineClient::privateConnectionName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CONNECTION]'
    );

    get_private_connection_sample($formattedName);
}

getSubnet

Gets details of a single subnet.

Parameters
NameDescription
name string

Required. The resource name of the subnet to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\Subnet
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetSubnetRequest;
use Google\Cloud\VmwareEngine\V1\Subnet;

/**
 * @param string $formattedName The resource name of the subnet to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
 *                              Please see {@see VmwareEngineClient::subnetName()} for help formatting this field.
 */
function get_subnet_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Subnet $response */
        $response = $vmwareEngineClient->getSubnet($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 = VmwareEngineClient::subnetName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]',
        '[SUBNET]'
    );

    get_subnet_sample($formattedName);
}

getVmwareEngineNetwork

Retrieves a VmwareEngineNetwork resource by its resource name. The resource contains details of the VMware Engine network, such as its VMware Engine network type, peered networks in a service project, and state (for example, CREATING, ACTIVE, DELETING).

Parameters
NameDescription
name string

Required. The resource name of the VMware Engine network to retrieve. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/global/vmwareEngineNetworks/my-network

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\GetVmwareEngineNetworkRequest;
use Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork;

/**
 * @param string $formattedName The resource name of the VMware Engine network to retrieve.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
 *                              Please see {@see VmwareEngineClient::vmwareEngineNetworkName()} for help formatting this field.
 */
function get_vmware_engine_network_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var VmwareEngineNetwork $response */
        $response = $vmwareEngineClient->getVmwareEngineNetwork($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 = VmwareEngineClient::vmwareEngineNetworkName(
        '[PROJECT]',
        '[LOCATION]',
        '[VMWARE_ENGINE_NETWORK]'
    );

    get_vmware_engine_network_sample($formattedName);
}

listClusters

Lists Cluster resources in a given private cloud.

Parameters
NameDescription
parent string

Required. The resource name of the private cloud to query for clusters. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

To filter on multiple expressions, provide each separate expression within parentheses. For example: (name = "example-cluster") (nodeCount = "3") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (name = "example-cluster-1") AND (createTime > "2021-04-12T08:15:10.40Z") OR (name = "example-cluster-2")

↳ orderBy string

Sorts list results by a certain order. By default, returned results are ordered by name in ascending order. You can also sort results in descending order based on the name value using orderBy="name desc". Currently, only ordering by name is supported.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Cluster;
use Google\Cloud\VmwareEngine\V1\ListClustersRequest;

/**
 * @param string $formattedParent The resource name of the private cloud to query for clusters.
 *                                Resource names are schemeless URIs that follow the conventions in
 *                                https://cloud.google.com/apis/design/resource_names.
 *                                For example:
 *                                `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function list_clusters_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var Cluster $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 = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    list_clusters_sample($formattedParent);
}

listHcxActivationKeys

Lists HcxActivationKey resources in a given private cloud.

Parameters
NameDescription
parent string

Required. The resource name of the private cloud to be queried for HCX activation keys. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/privateClouds/my-cloud

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\HcxActivationKey;
use Google\Cloud\VmwareEngine\V1\ListHcxActivationKeysRequest;

/**
 * @param string $formattedParent The resource name of the private cloud
 *                                to be queried for HCX activation keys.
 *                                Resource names are schemeless URIs that follow the conventions in
 *                                https://cloud.google.com/apis/design/resource_names.
 *                                For example:
 *                                `projects/my-project/locations/us-central1/privateClouds/my-cloud`
 *                                Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function list_hcx_activation_keys_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var HcxActivationKey $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 = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    list_hcx_activation_keys_sample($formattedParent);
}

listNetworkPolicies

Lists NetworkPolicy resources in a specified project and location.

Parameters
NameDescription
parent string

Required. The resource name of the location (region) to query for network policies. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter expression that matches resources returned in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =, !=, >, or <. For example, if you are filtering a list of network policies, you can exclude the ones named example-policy by specifying name != "example-policy". To filter on multiple expressions, provide each separate expression within parentheses. For example: (name = "example-policy") (createTime > "2021-04-12T08:15:10.40Z") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (name = "example-policy-1") AND (createTime > "2021-04-12T08:15:10.40Z") OR (name = "example-policy-2")

↳ orderBy string

Sorts list results by a certain order. By default, returned results are ordered by name in ascending order. You can also sort results in descending order based on the name value using orderBy="name desc". Currently, only ordering by name is supported.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListNetworkPoliciesRequest;
use Google\Cloud\VmwareEngine\V1\NetworkPolicy;

/**
 * @param string $formattedParent The resource name of the location (region) to query for
 *                                network policies. Resource names are schemeless URIs that follow the
 *                                conventions in https://cloud.google.com/apis/design/resource_names. For
 *                                example: `projects/my-project/locations/us-central1`
 *                                Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 */
function list_network_policies_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var NetworkPolicy $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');

    list_network_policies_sample($formattedParent);
}

listNodeTypes

Lists node types

Parameters
NameDescription
parent string

Required. The resource name of the location to be queried for node types. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter expression that matches resources returned in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =, !=, >, or <. For example, if you are filtering a list of node types, you can exclude the ones named standard-72 by specifying name != "standard-72". To filter on multiple expressions, provide each separate expression within parentheses. For example: (name = "standard-72") (virtual_cpu_count > 2) By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (name = "standard-96") AND (virtual_cpu_count > 2) OR (name = "standard-72")

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListNodeTypesRequest;
use Google\Cloud\VmwareEngine\V1\NodeType;

/**
 * @param string $formattedParent The resource name of the location to be queried for node types.
 *                                Resource names are schemeless URIs that follow the conventions in
 *                                https://cloud.google.com/apis/design/resource_names.
 *                                For example:
 *                                `projects/my-project/locations/us-central1-a`
 *                                Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 */
function list_node_types_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var NodeType $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');

    list_node_types_sample($formattedParent);
}

listPrivateClouds

Lists PrivateCloud resources in a given project and location.

Parameters
NameDescription
parent string

Required. The resource name of the private cloud to be queried for clusters. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter expression that matches resources returned in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =, !=, >, or <. For example, if you are filtering a list of private clouds, you can exclude the ones named example-pc by specifying name != "example-pc". You can also filter nested fields. For example, you could specify networkConfig.managementCidr = "192.168.0.0/24" to include private clouds only if they have a matching address in their network configuration. To filter on multiple expressions, provide each separate expression within parentheses. For example: (name = "example-pc") (createTime > "2021-04-12T08:15:10.40Z") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (name = "private-cloud-1") AND (createTime > "2021-04-12T08:15:10.40Z") OR (name = "private-cloud-2")

↳ orderBy string

Sorts list results by a certain order. By default, returned results are ordered by name in ascending order. You can also sort results in descending order based on the name value using orderBy="name desc". Currently, only ordering by name is supported.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListPrivateCloudsRequest;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;

/**
 * @param string $formattedParent The resource name of the private cloud to be queried for
 *                                clusters. Resource names are schemeless URIs that follow the conventions in
 *                                https://cloud.google.com/apis/design/resource_names.
 *                                For example:
 *                                `projects/my-project/locations/us-central1-a`
 *                                Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 */
function list_private_clouds_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var PrivateCloud $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');

    list_private_clouds_sample($formattedParent);
}

listPrivateConnectionPeeringRoutes

Lists the private connection routes exchanged over a peering connection.

Parameters
NameDescription
parent string

Required. The resource name of the private connection to retrieve peering routes from. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-west1/privateConnections/my-connection

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListPrivateConnectionPeeringRoutesRequest;
use Google\Cloud\VmwareEngine\V1\PeeringRoute;

/**
 * @param string $formattedParent The resource name of the private connection to retrieve peering
 *                                routes from. Resource names are schemeless URIs that follow the conventions
 *                                in https://cloud.google.com/apis/design/resource_names. For example:
 *                                `projects/my-project/locations/us-west1/privateConnections/my-connection`
 *                                Please see {@see VmwareEngineClient::privateConnectionName()} for help formatting this field.
 */
function list_private_connection_peering_routes_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var PeeringRoute $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 = VmwareEngineClient::privateConnectionName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CONNECTION]'
    );

    list_private_connection_peering_routes_sample($formattedParent);
}

listPrivateConnections

Lists PrivateConnection resources in a given project and location.

Parameters
NameDescription
parent string

Required. The resource name of the location to query for private connections. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter expression that matches resources returned in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =, !=, >, or <. For example, if you are filtering a list of private connections, you can exclude the ones named example-connection by specifying name != "example-connection". To filter on multiple expressions, provide each separate expression within parentheses. For example: (name = "example-connection") (createTime > "2022-09-22T08:15:10.40Z") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (name = "example-connection-1") AND (createTime > "2021-04-12T08:15:10.40Z") OR (name = "example-connection-2")

↳ orderBy string

Sorts list results by a certain order. By default, returned results are ordered by name in ascending order. You can also sort results in descending order based on the name value using orderBy="name desc". Currently, only ordering by name is supported.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListPrivateConnectionsRequest;
use Google\Cloud\VmwareEngine\V1\PrivateConnection;

/**
 * @param string $formattedParent The resource name of the location to query for
 *                                private connections. Resource names are schemeless URIs that follow the
 *                                conventions in https://cloud.google.com/apis/design/resource_names. For
 *                                example: `projects/my-project/locations/us-central1`
 *                                Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 */
function list_private_connections_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var PrivateConnection $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');

    list_private_connections_sample($formattedParent);
}

listSubnets

Lists subnets in a given private cloud.

Parameters
NameDescription
parent string

Required. The resource name of the private cloud to be queried for subnets. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListSubnetsRequest;
use Google\Cloud\VmwareEngine\V1\Subnet;

/**
 * @param string $formattedParent The resource name of the private cloud to be queried for
 *                                subnets.
 *                                Resource names are schemeless URIs that follow the conventions in
 *                                https://cloud.google.com/apis/design/resource_names.
 *                                For example:
 *                                `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function list_subnets_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var Subnet $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 = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    list_subnets_sample($formattedParent);
}

listVmwareEngineNetworks

Lists VmwareEngineNetwork resources in a given project and location.

Parameters
NameDescription
parent string

Required. The resource name of the location to query for VMware Engine networks. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/global

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

A filter expression that matches resources returned in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =, !=, >, or <. For example, if you are filtering a list of network peerings, you can exclude the ones named example-network by specifying name != "example-network". To filter on multiple expressions, provide each separate expression within parentheses. For example: (name = "example-network") (createTime > "2021-04-12T08:15:10.40Z") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (name = "example-network-1") AND (createTime > "2021-04-12T08:15:10.40Z") OR (name = "example-network-2")

↳ orderBy string

Sorts list results by a certain order. By default, returned results are ordered by name in ascending order. You can also sort results in descending order based on the name value using orderBy="name desc". Currently, only ordering by name is supported.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\ListVmwareEngineNetworksRequest;
use Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork;

/**
 * @param string $formattedParent The resource name of the location to query for
 *                                VMware Engine networks. Resource names are schemeless URIs that follow the
 *                                conventions in https://cloud.google.com/apis/design/resource_names. For
 *                                example: `projects/my-project/locations/global`
 *                                Please see {@see VmwareEngineClient::locationName()} for help formatting this field.
 */
function list_vmware_engine_networks_sample(string $formattedParent): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        /** @var VmwareEngineNetwork $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 = VmwareEngineClient::locationName('[PROJECT]', '[LOCATION]');

    list_vmware_engine_networks_sample($formattedParent);
}

resetNsxCredentials

Resets credentials of the NSX appliance.

Parameters
NameDescription
privateCloud string

Required. The resource name of the private cloud to reset credentials for. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;
use Google\Cloud\VmwareEngine\V1\ResetNsxCredentialsRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedPrivateCloud The resource name of the private cloud
 *                                      to reset credentials for.
 *                                      Resource names are schemeless URIs that follow the conventions in
 *                                      https://cloud.google.com/apis/design/resource_names.
 *                                      For example:
 *                                      `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                      Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function reset_nsx_credentials_sample(string $formattedPrivateCloud): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = (new ResetNsxCredentialsRequest())
        ->setPrivateCloud($formattedPrivateCloud);

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

        if ($response->operationSucceeded()) {
            /** @var PrivateCloud $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
{
    $formattedPrivateCloud = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    reset_nsx_credentials_sample($formattedPrivateCloud);
}

resetVcenterCredentials

Resets credentials of the Vcenter appliance.

Parameters
NameDescription
privateCloud string

Required. The resource name of the private cloud to reset credentials for. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;
use Google\Cloud\VmwareEngine\V1\ResetVcenterCredentialsRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedPrivateCloud The resource name of the private cloud
 *                                      to reset credentials for.
 *                                      Resource names are schemeless URIs that follow the conventions in
 *                                      https://cloud.google.com/apis/design/resource_names.
 *                                      For example:
 *                                      `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                      Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function reset_vcenter_credentials_sample(string $formattedPrivateCloud): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = (new ResetVcenterCredentialsRequest())
        ->setPrivateCloud($formattedPrivateCloud);

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

        if ($response->operationSucceeded()) {
            /** @var PrivateCloud $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
{
    $formattedPrivateCloud = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    reset_vcenter_credentials_sample($formattedPrivateCloud);
}

showNsxCredentials

Gets details of credentials for NSX appliance.

Parameters
NameDescription
privateCloud string

Required. The resource name of the private cloud to be queried for credentials. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\Credentials
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Credentials;
use Google\Cloud\VmwareEngine\V1\ShowNsxCredentialsRequest;

/**
 * @param string $formattedPrivateCloud The resource name of the private cloud
 *                                      to be queried for credentials.
 *                                      Resource names are schemeless URIs that follow the conventions in
 *                                      https://cloud.google.com/apis/design/resource_names.
 *                                      For example:
 *                                      `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                      Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function show_nsx_credentials_sample(string $formattedPrivateCloud): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = (new ShowNsxCredentialsRequest())
        ->setPrivateCloud($formattedPrivateCloud);

    // Call the API and handle any network failures.
    try {
        /** @var Credentials $response */
        $response = $vmwareEngineClient->showNsxCredentials($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
{
    $formattedPrivateCloud = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    show_nsx_credentials_sample($formattedPrivateCloud);
}

showVcenterCredentials

Gets details of credentials for Vcenter appliance.

Parameters
NameDescription
privateCloud string

Required. The resource name of the private cloud to be queried for credentials. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VmwareEngine\V1\Credentials
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Credentials;
use Google\Cloud\VmwareEngine\V1\ShowVcenterCredentialsRequest;

/**
 * @param string $formattedPrivateCloud The resource name of the private cloud
 *                                      to be queried for credentials.
 *                                      Resource names are schemeless URIs that follow the conventions in
 *                                      https://cloud.google.com/apis/design/resource_names.
 *                                      For example:
 *                                      `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                                      Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function show_vcenter_credentials_sample(string $formattedPrivateCloud): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = (new ShowVcenterCredentialsRequest())
        ->setPrivateCloud($formattedPrivateCloud);

    // Call the API and handle any network failures.
    try {
        /** @var Credentials $response */
        $response = $vmwareEngineClient->showVcenterCredentials($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
{
    $formattedPrivateCloud = VmwareEngineClient::privateCloudName(
        '[PROJECT]',
        '[LOCATION]',
        '[PRIVATE_CLOUD]'
    );

    show_vcenter_credentials_sample($formattedPrivateCloud);
}

undeletePrivateCloud

Restores a private cloud that was previously scheduled for deletion by DeletePrivateCloud. A PrivateCloud resource scheduled for deletion has PrivateCloud.state set to DELETED and PrivateCloud.expireTime set to the time when deletion can no longer be reversed.

Parameters
NameDescription
name string

Required. The resource name of the private cloud scheduled for deletion. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1-a/privateClouds/my-cloud

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;
use Google\Cloud\VmwareEngine\V1\UndeletePrivateCloudRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name of the private cloud scheduled for deletion.
 *                              Resource names are schemeless URIs that follow the conventions in
 *                              https://cloud.google.com/apis/design/resource_names.
 *                              For example:
 *                              `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
 *                              Please see {@see VmwareEngineClient::privateCloudName()} for help formatting this field.
 */
function undelete_private_cloud_sample(string $formattedName): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var PrivateCloud $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
{
    $formattedName = VmwareEngineClient::privateCloudName('[PROJECT]', '[LOCATION]', '[PRIVATE_CLOUD]');

    undelete_private_cloud_sample($formattedName);
}

updateCluster

Modifies a Cluster resource. Only the following fields can be updated: node_type_configs.*.node_count. Only fields specified in updateMask are applied.

During operation processing, the resource is temporarily in the ACTIVE state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Field mask is used to specify the fields to be overwritten in the Cluster resource by the update. The fields specified in the updateMask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

cluster Google\Cloud\VmwareEngine\V1\Cluster

Required. The description of the cluster.

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ validateOnly bool

Optional. True if you want the request to be validated and not executed; false otherwise.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Cluster;
use Google\Cloud\VmwareEngine\V1\UpdateClusterRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * 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 update_cluster_sample(): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $clusterNodeTypeConfigs = [];
    $cluster = (new Cluster())
        ->setNodeTypeConfigs($clusterNodeTypeConfigs);
    $request = (new UpdateClusterRequest())
        ->setUpdateMask($updateMask)
        ->setCluster($cluster);

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

        if ($response->operationSucceeded()) {
            /** @var Cluster $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());
    }
}

updateNetworkPolicy

Modifies a NetworkPolicy resource. Only the following fields can be updated: internet_access, external_ip, edge_services_cidr.

Only fields specified in updateMask are applied. When updating a network policy, the external IP network service can only be disabled if there are no external IP addresses present in the scope of the policy. Also, a NetworkService cannot be updated when NetworkService.state is set to RECONCILING.

During operation processing, the resource is temporarily in the ACTIVE state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.

Parameters
NameDescription
networkPolicy Google\Cloud\VmwareEngine\V1\NetworkPolicy

Required. Network policy description.

updateMask Google\Protobuf\FieldMask

Required. Field mask is used to specify the fields to be overwritten in the NetworkPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\NetworkPolicy;
use Google\Cloud\VmwareEngine\V1\UpdateNetworkPolicyRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $networkPolicyEdgeServicesCidr IP address range in CIDR notation used to create internet access
 *                                              and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
 *                                              required. The range cannot overlap with any prefixes either in the consumer
 *                                              VPC network or in use by the private clouds attached to that VPC network.
 */
function update_network_policy_sample(string $networkPolicyEdgeServicesCidr): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $networkPolicy = (new NetworkPolicy())
        ->setEdgeServicesCidr($networkPolicyEdgeServicesCidr);
    $updateMask = new FieldMask();
    $request = (new UpdateNetworkPolicyRequest())
        ->setNetworkPolicy($networkPolicy)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var NetworkPolicy $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
{
    $networkPolicyEdgeServicesCidr = '[EDGE_SERVICES_CIDR]';

    update_network_policy_sample($networkPolicyEdgeServicesCidr);
}

updatePrivateCloud

Modifies a PrivateCloud resource. Only the following fields can be updated: description.

Only fields specified in updateMask are applied.

During operation processing, the resource is temporarily in the ACTIVE state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.

Parameters
NameDescription
privateCloud Google\Cloud\VmwareEngine\V1\PrivateCloud

Required. Private cloud description.

updateMask Google\Protobuf\FieldMask

Required. Field mask is used to specify the fields to be overwritten in the PrivateCloud resource by the update. The fields specified in updateMask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

optionalArgs array

Optional.

↳ requestId string

Optional. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\NetworkConfig;
use Google\Cloud\VmwareEngine\V1\PrivateCloud;
use Google\Cloud\VmwareEngine\V1\PrivateCloud\ManagementCluster;
use Google\Cloud\VmwareEngine\V1\UpdatePrivateCloudRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $privateCloudNetworkConfigManagementCidr Management CIDR used by VMware management appliances.
 * @param string $privateCloudManagementClusterClusterId  The user-provided identifier of the new `Cluster`.
 *                                                        The identifier must meet the following requirements:
 *
 *                                                        * Only contains 1-63 alphanumeric characters and hyphens
 *                                                        * Begins with an alphabetical character
 *                                                        * Ends with a non-hyphen character
 *                                                        * Not formatted as a UUID
 *                                                        * Complies with [RFC
 *                                                        1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
 */
function update_private_cloud_sample(
    string $privateCloudNetworkConfigManagementCidr,
    string $privateCloudManagementClusterClusterId
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $privateCloudNetworkConfig = (new NetworkConfig())
        ->setManagementCidr($privateCloudNetworkConfigManagementCidr);
    $privateCloudManagementClusterNodeTypeConfigs = [];
    $privateCloudManagementCluster = (new ManagementCluster())
        ->setClusterId($privateCloudManagementClusterClusterId)
        ->setNodeTypeConfigs($privateCloudManagementClusterNodeTypeConfigs);
    $privateCloud = (new PrivateCloud())
        ->setNetworkConfig($privateCloudNetworkConfig)
        ->setManagementCluster($privateCloudManagementCluster);
    $updateMask = new FieldMask();
    $request = (new UpdatePrivateCloudRequest())
        ->setPrivateCloud($privateCloud)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var PrivateCloud $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
{
    $privateCloudNetworkConfigManagementCidr = '[MANAGEMENT_CIDR]';
    $privateCloudManagementClusterClusterId = '[CLUSTER_ID]';

    update_private_cloud_sample(
        $privateCloudNetworkConfigManagementCidr,
        $privateCloudManagementClusterClusterId
    );
}

updatePrivateConnection

Modifies a PrivateConnection resource. Only description and routing_mode fields can be updated. Only fields specified in updateMask are applied.

Parameters
NameDescription
privateConnection Google\Cloud\VmwareEngine\V1\PrivateConnection

Required. Private connection description.

updateMask Google\Protobuf\FieldMask

Required. Field mask is used to specify the fields to be overwritten in the PrivateConnection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\PrivateConnection;
use Google\Cloud\VmwareEngine\V1\PrivateConnection\Type;
use Google\Cloud\VmwareEngine\V1\UpdatePrivateConnectionRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $formattedPrivateConnectionVmwareEngineNetwork The relative resource name of Legacy VMware Engine network.
 *                                                              Specify the name in the following form:
 *                                                              `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
 *                                                              where `{project}`, `{location}` will be same as specified in private
 *                                                              connection resource name and `{vmware_engine_network_id}` will be in the
 *                                                              form of `{location}`-default e.g.
 *                                                              projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default. Please see
 *                                                              {@see VmwareEngineClient::vmwareEngineNetworkName()} for help formatting this field.
 * @param int    $privateConnectionType                         Private connection type.
 * @param string $formattedPrivateConnectionServiceNetwork      Service network to create private connection.
 *                                                              Specify the name in the following form:
 *                                                              `projects/{project}/global/networks/{network_id}`
 *                                                              For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
 *                                                              VPC, e.g. projects/project-tp/global/networks/servicenetworking.
 *                                                              For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
 *                                                              e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
 *                                                              For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
 *                                                              projects/project-tp/global/networks/dell-tenant-vpc.
 *                                                              For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
 *                                                              any other producer VPC to which the VMware Engine Network needs to be
 *                                                              connected, e.g. projects/project/global/networks/vpc. Please see
 *                                                              {@see VmwareEngineClient::networkName()} for help formatting this field.
 */
function update_private_connection_sample(
    string $formattedPrivateConnectionVmwareEngineNetwork,
    int $privateConnectionType,
    string $formattedPrivateConnectionServiceNetwork
): void {
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $privateConnection = (new PrivateConnection())
        ->setVmwareEngineNetwork($formattedPrivateConnectionVmwareEngineNetwork)
        ->setType($privateConnectionType)
        ->setServiceNetwork($formattedPrivateConnectionServiceNetwork);
    $updateMask = new FieldMask();
    $request = (new UpdatePrivateConnectionRequest())
        ->setPrivateConnection($privateConnection)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var PrivateConnection $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
{
    $formattedPrivateConnectionVmwareEngineNetwork = VmwareEngineClient::vmwareEngineNetworkName(
        '[PROJECT]',
        '[LOCATION]',
        '[VMWARE_ENGINE_NETWORK]'
    );
    $privateConnectionType = Type::TYPE_UNSPECIFIED;
    $formattedPrivateConnectionServiceNetwork = VmwareEngineClient::networkName(
        '[PROJECT]',
        '[NETWORK]'
    );

    update_private_connection_sample(
        $formattedPrivateConnectionVmwareEngineNetwork,
        $privateConnectionType,
        $formattedPrivateConnectionServiceNetwork
    );
}

updateSubnet

Updates the parameters of a single subnet. Only fields specified in update_mask are applied.

Note: This API is synchronous and always returns a successful google.longrunning.Operation (LRO). The returned LRO will only have done and response fields.

Parameters
NameDescription
updateMask Google\Protobuf\FieldMask

Required. Field mask is used to specify the fields to be overwritten in the Subnet resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

subnet Google\Cloud\VmwareEngine\V1\Subnet

Required. Subnet description.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\Subnet;
use Google\Cloud\VmwareEngine\V1\UpdateSubnetRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * 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 update_subnet_sample(): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $updateMask = new FieldMask();
    $subnet = new Subnet();
    $request = (new UpdateSubnetRequest())
        ->setUpdateMask($updateMask)
        ->setSubnet($subnet);

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

        if ($response->operationSucceeded()) {
            /** @var Subnet $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());
    }
}

updateVmwareEngineNetwork

Modifies a VMware Engine network resource. Only the following fields can be updated: description. Only fields specified in updateMask are applied.

Parameters
NameDescription
vmwareEngineNetwork Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork

Required. VMware Engine network description.

updateMask Google\Protobuf\FieldMask

Required. Field mask is used to specify the fields to be overwritten in the VMware Engine network resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. Only the following fields can be updated: description.

optionalArgs array

Optional.

↳ requestId string

Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server guarantees that a request doesn't result in creation of duplicate commitments for at least 60 minutes. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;
use Google\Cloud\VmwareEngine\V1\UpdateVmwareEngineNetworkRequest;
use Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork;
use Google\Cloud\VmwareEngine\V1\VmwareEngineNetwork\Type;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param int $vmwareEngineNetworkType VMware Engine network type.
 */
function update_vmware_engine_network_sample(int $vmwareEngineNetworkType): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $vmwareEngineNetwork = (new VmwareEngineNetwork())
        ->setType($vmwareEngineNetworkType);
    $updateMask = new FieldMask();
    $request = (new UpdateVmwareEngineNetworkRequest())
        ->setVmwareEngineNetwork($vmwareEngineNetwork)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var VmwareEngineNetwork $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
{
    $vmwareEngineNetworkType = Type::TYPE_UNSPECIFIED;

    update_vmware_engine_network_sample($vmwareEngineNetworkType);
}

getLocation

Gets information about a location.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

Resource name for the location.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;

/**
 * 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 get_location_sample(): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = new GetLocationRequest();

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

listLocations

Lists information about the supported locations for this service.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

The resource that owns the locations collection, if applicable.

↳ filter string

The standard list filter.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;

/**
 * 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 list_locations_sample(): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = new ListLocationsRequest();

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

        /** @var Location $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());
    }
}

getIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

optionalArgs array

Optional.

↳ options GetPolicyOptions

OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being requested.
 *                         See the operation documentation for the appropriate value for this field.
 */
function get_iam_policy_sample(string $resource): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $request = (new GetIamPolicyRequest())
        ->setResource($resource);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $vmwareEngineClient->getIamPolicy($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
{
    $resource = '[RESOURCE]';

    get_iam_policy_sample($resource);
}

setIamPolicy

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Google\Cloud\Iam\V1\Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

optionalArgs array

Optional.

↳ updateMask FieldMask

OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: paths: "bindings, etag"

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being specified.
 *                         See the operation documentation for the appropriate value for this field.
 */
function set_iam_policy_sample(string $resource): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $policy = new Policy();
    $request = (new SetIamPolicyRequest())
        ->setResource($resource)
        ->setPolicy($policy);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $vmwareEngineClient->setIamPolicy($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
{
    $resource = '[RESOURCE]';

    set_iam_policy_sample($resource);
}

testIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions string[]

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient;

/**
 * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
 *                                   See the operation documentation for the appropriate value for this field.
 * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
 *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
 *                                   information see
 *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
 */
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
    // Create a client.
    $vmwareEngineClient = new VmwareEngineClient();

    // Prepare the request message.
    $permissions = [$permissionsElement,];
    $request = (new TestIamPermissionsRequest())
        ->setResource($resource)
        ->setPermissions($permissions);

    // Call the API and handle any network failures.
    try {
        /** @var TestIamPermissionsResponse $response */
        $response = $vmwareEngineClient->testIamPermissions($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
{
    $resource = '[RESOURCE]';
    $permissionsElement = '[PERMISSIONS]';

    test_iam_permissions_sample($resource, $permissionsElement);
}

getOperationsClient

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

Returns
TypeDescription
Google\ApiCore\LongRunning\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
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::clusterName

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

Parameters
NameDescription
project string
location string
privateCloud string
cluster string
Returns
TypeDescription
stringThe formatted cluster resource.

static::hcxActivationKeyName

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

Parameters
NameDescription
project string
location string
privateCloud string
hcxActivationKey string
Returns
TypeDescription
stringThe formatted hcx_activation_key resource.

static::locationName

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

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::networkName

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

Parameters
NameDescription
project string
network string
Returns
TypeDescription
stringThe formatted network resource.

static::networkPolicyName

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

Parameters
NameDescription
project string
location string
networkPolicy string
Returns
TypeDescription
stringThe formatted network_policy resource.

static::nodeTypeName

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

Parameters
NameDescription
project string
location string
nodeType string
Returns
TypeDescription
stringThe formatted node_type resource.

static::privateCloudName

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

Parameters
NameDescription
project string
location string
privateCloud string
Returns
TypeDescription
stringThe formatted private_cloud resource.

static::privateConnectionName

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

Parameters
NameDescription
project string
location string
privateConnection string
Returns
TypeDescription
stringThe formatted private_connection resource.

static::subnetName

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

Parameters
NameDescription
project string
location string
privateCloud string
subnet string
Returns
TypeDescription
stringThe formatted subnet resource.

static::vmwareEngineNetworkName

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

Parameters
NameDescription
project string
location string
vmwareEngineNetwork string
Returns
TypeDescription
stringThe formatted vmware_engine_network 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

  • cluster: projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}
  • hcxActivationKey: projects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}
  • location: projects/{project}/locations/{location}
  • network: projects/{project}/global/networks/{network}
  • networkPolicy: projects/{project}/locations/{location}/networkPolicies/{network_policy}
  • nodeType: projects/{project}/locations/{location}/nodeTypes/{node_type}
  • privateCloud: projects/{project}/locations/{location}/privateClouds/{private_cloud}
  • privateConnection: projects/{project}/locations/{location}/privateConnections/{private_connection}
  • subnet: projects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}
  • vmwareEngineNetwork: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}

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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.

Constants

SERVICE_NAME

Value: 'google.cloud.vmwareengine.v1.VmwareEngine'

The name of the service.

SERVICE_ADDRESS

Value: 'vmwareengine.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

The name of the code generator, to be included in the agent header.