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

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.

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

Namespace

Google \ Cloud \ VmwareEngine \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

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

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

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

↳ credentialsConfig array

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

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

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

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::createClusterAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\CreateClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::createHcxActivationKeyAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\CreateHcxActivationKeyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::createNetworkPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\CreateNetworkPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::createPrivateCloudAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\CreatePrivateCloudRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::createPrivateConnectionAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\CreatePrivateConnectionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::createVmwareEngineNetworkAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\CreateVmwareEngineNetworkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::deleteClusterAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\DeleteClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::deleteNetworkPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\DeleteNetworkPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::deletePrivateCloudAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\DeletePrivateCloudRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::deletePrivateConnectionAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\DeletePrivateConnectionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::deleteVmwareEngineNetworkAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\DeleteVmwareEngineNetworkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getClusterAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getHcxActivationKeyAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetHcxActivationKeyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getNetworkPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetNetworkPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getNodeTypeAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetNodeTypeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getPrivateCloudAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetPrivateCloudRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getPrivateConnectionAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetPrivateConnectionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getSubnetAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetSubnetRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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).

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getVmwareEngineNetworkAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\GetVmwareEngineNetworkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listClustersAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListClustersRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listHcxActivationKeysAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListHcxActivationKeysRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listNetworkPoliciesAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListNetworkPoliciesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListNodeTypesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listPrivateCloudsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListPrivateCloudsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listPrivateConnectionPeeringRoutesAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListPrivateConnectionPeeringRoutesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listPrivateConnectionsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListPrivateConnectionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listSubnetsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListSubnetsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listVmwareEngineNetworksAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ListVmwareEngineNetworksRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::resetNsxCredentialsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ResetNsxCredentialsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::resetVcenterCredentialsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ResetVcenterCredentialsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::showNsxCredentialsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ShowNsxCredentialsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::showVcenterCredentialsAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\ShowVcenterCredentialsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::undeletePrivateCloudAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UndeletePrivateCloudRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::updateClusterAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UpdateClusterRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::updateNetworkPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UpdateNetworkPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::updatePrivateCloudAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UpdatePrivateCloudRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::updatePrivateConnectionAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UpdatePrivateConnectionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::updateSubnetAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UpdateSubnetRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::updateVmwareEngineNetworkAsync() .

Parameters
NameDescription
request Google\Cloud\VmwareEngine\V1\UpdateVmwareEngineNetworkRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getLocationAsync() .

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::listLocationsAsync() .

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::getIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::setIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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.

The async variant is Google\Cloud\VmwareEngine\V1\Client\VmwareEngineClient::testIamPermissionsAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\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);
}

createClusterAsync

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

createHcxActivationKeyAsync

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

createNetworkPolicyAsync

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

createPrivateCloudAsync

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

createPrivateConnectionAsync

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

createVmwareEngineNetworkAsync

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

deleteClusterAsync

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

deleteNetworkPolicyAsync

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

deletePrivateCloudAsync

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

deletePrivateConnectionAsync

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

deleteVmwareEngineNetworkAsync

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

getClusterAsync

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

getHcxActivationKeyAsync

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

getNetworkPolicyAsync

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

getNodeTypeAsync

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

getPrivateCloudAsync

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

getPrivateConnectionAsync

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

getSubnetAsync

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

getVmwareEngineNetworkAsync

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

listClustersAsync

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

listHcxActivationKeysAsync

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

listNetworkPoliciesAsync

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

listNodeTypesAsync

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

listPrivateCloudsAsync

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

listPrivateConnectionPeeringRoutesAsync

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

listPrivateConnectionsAsync

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

listSubnetsAsync

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

listVmwareEngineNetworksAsync

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

resetNsxCredentialsAsync

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

resetVcenterCredentialsAsync

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

showNsxCredentialsAsync

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

showVcenterCredentialsAsync

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

undeletePrivateCloudAsync

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

updateClusterAsync

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

updateNetworkPolicyAsync

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

updatePrivateCloudAsync

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

updatePrivateConnectionAsync

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

updateSubnetAsync

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

updateVmwareEngineNetworkAsync

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

getLocationAsync

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

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

setIamPolicyAsync

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

testIamPermissionsAsync

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

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.