Google Cloud Vm Migration V1 Client - Class VmMigrationClient (0.3.2)

Reference documentation and code samples for the Google Cloud Vm Migration V1 Client class VmMigrationClient.

Service Description: VM Migration Service

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

$vmMigrationClient = new VmMigrationClient();
try {
    $formattedGroup = $vmMigrationClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]');
    $operationResponse = $vmMigrationClient->addGroupMigration($formattedGroup);
    $operationResponse->pollUntilComplete();
    if ($operationResponse->operationSucceeded()) {
        $result = $operationResponse->getResult();
    // doSomethingWith($result)
    } else {
        $error = $operationResponse->getError();
        // handleError($error)
    }
    // Alternatively:
    // start the operation, keep the operation name, and resume later
    $operationResponse = $vmMigrationClient->addGroupMigration($formattedGroup);
    $operationName = $operationResponse->getName();
    // ... do other work
    $newOperationResponse = $vmMigrationClient->resumeOperation($operationName, 'addGroupMigration');
    while (!$newOperationResponse->isDone()) {
        // ... do other work
        $newOperationResponse->reload();
    }
    if ($newOperationResponse->operationSucceeded()) {
        $result = $newOperationResponse->getResult();
    // doSomethingWith($result)
    } else {
        $error = $newOperationResponse->getError();
        // handleError($error)
    }
} finally {
    $vmMigrationClient->close();
}

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

Methods

cloneJobName

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

Parameters
NameDescription
project string
location string
source string
migratingVm string
cloneJob string
Returns
TypeDescription
stringThe formatted clone_job resource.

cutoverJobName

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

Parameters
NameDescription
project string
location string
source string
migratingVm string
cutoverJob string
Returns
TypeDescription
stringThe formatted cutover_job resource.

datacenterConnectorName

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

Parameters
NameDescription
project string
location string
source string
datacenterConnector string
Returns
TypeDescription
stringThe formatted datacenter_connector resource.

groupName

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

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

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.

migratingVmName

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

Parameters
NameDescription
project string
location string
source string
migratingVm string
Returns
TypeDescription
stringThe formatted migrating_vm resource.

replicationCycleName

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

Parameters
NameDescription
project string
location string
source string
migratingVm string
replicationCycle string
Returns
TypeDescription
stringThe formatted replication_cycle resource.

sourceName

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

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

targetProjectName

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

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

utilizationReportName

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

Parameters
NameDescription
project string
location string
source string
utilizationReport string
Returns
TypeDescription
stringThe formatted utilization_report resource.

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

  • cloneJob: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}
  • cutoverJob: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}
  • datacenterConnector: projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}
  • group: projects/{project}/locations/{location}/groups/{group}
  • location: projects/{project}/locations/{location}
  • migratingVm: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}
  • replicationCycle: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}
  • source: projects/{project}/locations/{location}/sources/{source}
  • targetProject: projects/{project}/locations/{location}/targetProjects/{target_project}
  • utilizationReport: projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}

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.

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

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

addGroupMigration

Adds a MigratingVm to a Group.

Parameters
NameDescription
group string

Required. The full path name of the Group to add to.

optionalArgs array

Optional.

↳ migratingVm string

The full path name of the MigratingVm to add.

↳ 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\VMMigration\V1\AddGroupMigrationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedGroup The full path name of the Group to add to. Please see
 *                               {@see VmMigrationClient::groupName()} for help formatting this field.
 */
function add_group_migration_sample(string $formattedGroup): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedGroup = VmMigrationClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');

    add_group_migration_sample($formattedGroup);
}

cancelCloneJob

Initiates the cancellation of a running clone job.

Parameters
NameDescription
name string

Required. The clone job id

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\CancelCloneJobResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The clone job id
 *                              Please see {@see VmMigrationClient::cloneJobName()} for help formatting this field.
 */
function cancel_clone_job_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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 = VmMigrationClient::cloneJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]',
        '[CLONE_JOB]'
    );

    cancel_clone_job_sample($formattedName);
}

cancelCutoverJob

Initiates the cancellation of a running cutover job.

Parameters
NameDescription
name string

Required. The cutover job id

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\CancelCutoverJobResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The cutover job id
 *                              Please see {@see VmMigrationClient::cutoverJobName()} for help formatting this field.
 */
function cancel_cutover_job_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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 = VmMigrationClient::cutoverJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]',
        '[CUTOVER_JOB]'
    );

    cancel_cutover_job_sample($formattedName);
}

createCloneJob

Initiates a Clone of a specific migrating VM.

Parameters
NameDescription
parent string

Required. The Clone's parent.

cloneJobId string

Required. The clone job identifier.

cloneJob Google\Cloud\VMMigration\V1\CloneJob

Required. The clone request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\CloneJob;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The Clone's parent. Please see
 *                                {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 * @param string $cloneJobId      The clone job identifier.
 */
function create_clone_job_sample(string $formattedParent, string $cloneJobId): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $cloneJob = new CloneJob();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createCloneJob($formattedParent, $cloneJobId, $cloneJob);
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );
    $cloneJobId = '[CLONE_JOB_ID]';

    create_clone_job_sample($formattedParent, $cloneJobId);
}

createCutoverJob

Initiates a Cutover of a specific migrating VM.

The returned LRO is completed when the cutover job resource is created and the job is initiated.

Parameters
NameDescription
parent string

Required. The Cutover's parent.

cutoverJobId string

Required. The cutover job identifier.

cutoverJob Google\Cloud\VMMigration\V1\CutoverJob

Required. The cutover request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\CutoverJob;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The Cutover's parent. Please see
 *                                {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 * @param string $cutoverJobId    The cutover job identifier.
 */
function create_cutover_job_sample(string $formattedParent, string $cutoverJobId): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $cutoverJob = new CutoverJob();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createCutoverJob($formattedParent, $cutoverJobId, $cutoverJob);
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );
    $cutoverJobId = '[CUTOVER_JOB_ID]';

    create_cutover_job_sample($formattedParent, $cutoverJobId);
}

createDatacenterConnector

Creates a new DatacenterConnector in a given Source.

Parameters
NameDescription
parent string

Required. The DatacenterConnector's parent. Required. The Source in where the new DatacenterConnector will be created. For example: projects/my-project/locations/us-central1/sources/my-source

datacenterConnectorId string

Required. The datacenterConnector identifier.

datacenterConnector Google\Cloud\VMMigration\V1\DatacenterConnector

Required. The create request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\DatacenterConnector;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent       The DatacenterConnector's parent.
 *                                      The Source in where the new DatacenterConnector will be created.
 *                                      For example:
 *                                      `projects/my-project/locations/us-central1/sources/my-source`
 *                                      Please see {@see VmMigrationClient::sourceName()} for help formatting this field.
 * @param string $datacenterConnectorId The datacenterConnector identifier.
 */
function create_datacenter_connector_sample(
    string $formattedParent,
    string $datacenterConnectorId
): void {
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $datacenterConnector = new DatacenterConnector();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createDatacenterConnector(
            $formattedParent,
            $datacenterConnectorId,
            $datacenterConnector
        );
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
    $datacenterConnectorId = '[DATACENTER_CONNECTOR_ID]';

    create_datacenter_connector_sample($formattedParent, $datacenterConnectorId);
}

createGroup

Creates a new Group in a given project and location.

Parameters
NameDescription
parent string

Required. The Group's parent.

groupId string

Required. The group identifier.

group Google\Cloud\VMMigration\V1\Group

Required. The create request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\Group;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The Group's parent. Please see
 *                                {@see VmMigrationClient::locationName()} for help formatting this field.
 * @param string $groupId         The group identifier.
 */
function create_group_sample(string $formattedParent, string $groupId): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $group = new Group();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createGroup($formattedParent, $groupId, $group);
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]');
    $groupId = '[GROUP_ID]';

    create_group_sample($formattedParent, $groupId);
}

createMigratingVm

Creates a new MigratingVm in a given Source.

Parameters
NameDescription
parent string

Required. The MigratingVm's parent.

migratingVmId string

Required. The migratingVm identifier.

migratingVm Google\Cloud\VMMigration\V1\MigratingVm

Required. The create request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\MigratingVm;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The MigratingVm's parent. Please see
 *                                {@see VmMigrationClient::sourceName()} for help formatting this field.
 * @param string $migratingVmId   The migratingVm identifier.
 */
function create_migrating_vm_sample(string $formattedParent, string $migratingVmId): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $migratingVm = new MigratingVm();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createMigratingVm($formattedParent, $migratingVmId, $migratingVm);
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
    $migratingVmId = '[MIGRATING_VM_ID]';

    create_migrating_vm_sample($formattedParent, $migratingVmId);
}

createSource

Creates a new Source in a given project and location.

Parameters
NameDescription
parent string

Required. The Source's parent.

sourceId string

Required. The source identifier.

source Google\Cloud\VMMigration\V1\Source

Required. The create request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\Source;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The Source's parent. Please see
 *                                {@see VmMigrationClient::locationName()} for help formatting this field.
 * @param string $sourceId        The source identifier.
 */
function create_source_sample(string $formattedParent, string $sourceId): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $source = new Source();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createSource($formattedParent, $sourceId, $source);
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]');
    $sourceId = '[SOURCE_ID]';

    create_source_sample($formattedParent, $sourceId);
}

createTargetProject

Creates a new TargetProject in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
parent string

Required. The TargetProject's parent.

targetProjectId string

Required. The target_project identifier.

targetProject Google\Cloud\VMMigration\V1\TargetProject

Required. The create request body.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\TargetProject;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The TargetProject's parent. Please see
 *                                {@see VmMigrationClient::locationName()} for help formatting this field.
 * @param string $targetProjectId The target_project identifier.
 */
function create_target_project_sample(string $formattedParent, string $targetProjectId): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $targetProject = new TargetProject();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createTargetProject(
            $formattedParent,
            $targetProjectId,
            $targetProject
        );
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]');
    $targetProjectId = '[TARGET_PROJECT_ID]';

    create_target_project_sample($formattedParent, $targetProjectId);
}

createUtilizationReport

Creates a new UtilizationReport.

Parameters
NameDescription
parent string

Required. The Utilization Report's parent.

utilizationReport Google\Cloud\VMMigration\V1\UtilizationReport

Required. The report to create.

utilizationReportId string

Required. The ID to use for the report, which will become the final component of the reports's resource name.

This value maximum length is 63 characters, and valid characters are /[a-z][0-9]-/. It must start with an english letter and must not end with a hyphen.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\UtilizationReport;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedParent     The Utilization Report's parent. Please see
 *                                    {@see VmMigrationClient::sourceName()} for help formatting this field.
 * @param string $utilizationReportId The ID to use for the report, which will become the final
 *                                    component of the reports's resource name.
 *
 *                                    This value maximum length is 63 characters, and valid characters
 *                                    are /[a-z][0-9]-/. It must start with an english letter and must not
 *                                    end with a hyphen.
 */
function create_utilization_report_sample(
    string $formattedParent,
    string $utilizationReportId
): void {
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $utilizationReport = new UtilizationReport();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->createUtilizationReport(
            $formattedParent,
            $utilizationReport,
            $utilizationReportId
        );
        $response->pollUntilComplete();

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
    $utilizationReportId = '[UTILIZATION_REPORT_ID]';

    create_utilization_report_sample($formattedParent, $utilizationReportId);
}

deleteDatacenterConnector

Deletes a single DatacenterConnector.

Parameters
NameDescription
name string

Required. The DatacenterConnector name.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The DatacenterConnector name. Please see
 *                              {@see VmMigrationClient::datacenterConnectorName()} for help formatting this field.
 */
function delete_datacenter_connector_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->deleteDatacenterConnector($formattedName);
        $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());
    }
}

/**
 * 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 = VmMigrationClient::datacenterConnectorName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[DATACENTER_CONNECTOR]'
    );

    delete_datacenter_connector_sample($formattedName);
}

deleteGroup

Deletes a single Group.

Parameters
NameDescription
name string

Required. The Group name.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The Group name. Please see
 *                              {@see VmMigrationClient::groupName()} for help formatting this field.
 */
function delete_group_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->deleteGroup($formattedName);
        $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());
    }
}

/**
 * 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 = VmMigrationClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');

    delete_group_sample($formattedName);
}

deleteMigratingVm

Deletes a single MigratingVm.

Parameters
NameDescription
name string

Required. The name of the MigratingVm.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the MigratingVm. Please see
 *                              {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 */
function delete_migrating_vm_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->deleteMigratingVm($formattedName);
        $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());
    }
}

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );

    delete_migrating_vm_sample($formattedName);
}

deleteSource

Deletes a single Source.

Parameters
NameDescription
name string

Required. The Source name.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The Source name. Please see
 *                              {@see VmMigrationClient::sourceName()} for help formatting this field.
 */
function delete_source_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->deleteSource($formattedName);
        $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());
    }
}

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');

    delete_source_sample($formattedName);
}

deleteTargetProject

Deletes a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
name string

Required. The TargetProject name.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The TargetProject name. Please see
 *                              {@see VmMigrationClient::targetProjectName()} for help formatting this field.
 */
function delete_target_project_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->deleteTargetProject($formattedName);
        $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());
    }
}

/**
 * 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 = VmMigrationClient::targetProjectName(
        '[PROJECT]',
        '[LOCATION]',
        '[TARGET_PROJECT]'
    );

    delete_target_project_sample($formattedName);
}

deleteUtilizationReport

Deletes a single Utilization Report.

Parameters
NameDescription
name string

Required. The Utilization Report name.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedName The Utilization Report name. Please see
 *                              {@see VmMigrationClient::utilizationReportName()} for help formatting this field.
 */
function delete_utilization_report_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $vmMigrationClient->deleteUtilizationReport($formattedName);
        $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());
    }
}

/**
 * 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 = VmMigrationClient::utilizationReportName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[UTILIZATION_REPORT]'
    );

    delete_utilization_report_sample($formattedName);
}

fetchInventory

List remote source's inventory of VMs.

The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.

Parameters
NameDescription
source string

Required. The name of the Source.

optionalArgs array

Optional.

↳ forceRefresh bool

If this flag is set to true, the source will be queried instead of using cached results. Using this flag will make the call slower.

↳ 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\VMMigration\V1\FetchInventoryResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\FetchInventoryResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedSource The name of the Source. Please see
 *                                {@see VmMigrationClient::sourceName()} for help formatting this field.
 */
function fetch_inventory_sample(string $formattedSource): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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
{
    $formattedSource = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');

    fetch_inventory_sample($formattedSource);
}

finalizeMigration

Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.

Parameters
NameDescription
migratingVm string

Required. The name of the MigratingVm.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\FinalizeMigrationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedMigratingVm The name of the MigratingVm. Please see
 *                                     {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 */
function finalize_migration_sample(string $formattedMigratingVm): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedMigratingVm = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );

    finalize_migration_sample($formattedMigratingVm);
}

getCloneJob

Gets details of a single CloneJob.

Parameters
NameDescription
name string

Required. The name of the CloneJob.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\CloneJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\CloneJob;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The name of the CloneJob. Please see
 *                              {@see VmMigrationClient::cloneJobName()} for help formatting this field.
 */
function get_clone_job_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::cloneJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]',
        '[CLONE_JOB]'
    );

    get_clone_job_sample($formattedName);
}

getCutoverJob

Gets details of a single CutoverJob.

Parameters
NameDescription
name string

Required. The name of the CutoverJob.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\CutoverJob
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\CutoverJob;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The name of the CutoverJob. Please see
 *                              {@see VmMigrationClient::cutoverJobName()} for help formatting this field.
 */
function get_cutover_job_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::cutoverJobName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]',
        '[CUTOVER_JOB]'
    );

    get_cutover_job_sample($formattedName);
}

getDatacenterConnector

Gets details of a single DatacenterConnector.

Parameters
NameDescription
name string

Required. The name of the DatacenterConnector.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\DatacenterConnector
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\DatacenterConnector;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The name of the DatacenterConnector. Please see
 *                              {@see VmMigrationClient::datacenterConnectorName()} for help formatting this field.
 */
function get_datacenter_connector_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::datacenterConnectorName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[DATACENTER_CONNECTOR]'
    );

    get_datacenter_connector_sample($formattedName);
}

getGroup

Gets details of a single Group.

Parameters
NameDescription
name string

Required. The group name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\Group
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\Group;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The group name. Please see
 *                              {@see VmMigrationClient::groupName()} for help formatting this field.
 */
function get_group_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');

    get_group_sample($formattedName);
}

getMigratingVm

Gets details of a single MigratingVm.

Parameters
NameDescription
name string

Required. The name of the MigratingVm.

optionalArgs array

Optional.

↳ view int

Optional. The level of details of the migrating VM. For allowed values, use constants defined on Google\Cloud\VMMigration\V1\MigratingVmView

↳ 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\VMMigration\V1\MigratingVm
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\MigratingVm;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The name of the MigratingVm. Please see
 *                              {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 */
function get_migrating_vm_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );

    get_migrating_vm_sample($formattedName);
}

getReplicationCycle

Gets details of a single ReplicationCycle.

Parameters
NameDescription
name string

Required. The name of the ReplicationCycle.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\ReplicationCycle
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\ReplicationCycle;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The name of the ReplicationCycle. Please see
 *                              {@see VmMigrationClient::replicationCycleName()} for help formatting this field.
 */
function get_replication_cycle_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::replicationCycleName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]',
        '[REPLICATION_CYCLE]'
    );

    get_replication_cycle_sample($formattedName);
}

getSource

Gets details of a single Source.

Parameters
NameDescription
name string

Required. The Source name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\Source
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\Source;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The Source name. Please see
 *                              {@see VmMigrationClient::sourceName()} for help formatting this field.
 */
function get_source_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');

    get_source_sample($formattedName);
}

getTargetProject

Gets details of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
name string

Required. The TargetProject name.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\VMMigration\V1\TargetProject
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\TargetProject;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The TargetProject name. Please see
 *                              {@see VmMigrationClient::targetProjectName()} for help formatting this field.
 */
function get_target_project_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::targetProjectName(
        '[PROJECT]',
        '[LOCATION]',
        '[TARGET_PROJECT]'
    );

    get_target_project_sample($formattedName);
}

getUtilizationReport

Gets a single Utilization Report.

Parameters
NameDescription
name string

Required. The Utilization Report name.

optionalArgs array

Optional.

↳ view int

Optional. The level of details of the report. Defaults to FULL For allowed values, use constants defined on Google\Cloud\VMMigration\V1\UtilizationReportView

↳ 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\VMMigration\V1\UtilizationReport
Example
use Google\ApiCore\ApiException;
use Google\Cloud\VMMigration\V1\UtilizationReport;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedName The Utilization Report name. Please see
 *                              {@see VmMigrationClient::utilizationReportName()} for help formatting this field.
 */
function get_utilization_report_sample(string $formattedName): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

/**
 * 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 = VmMigrationClient::utilizationReportName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[UTILIZATION_REPORT]'
    );

    get_utilization_report_sample($formattedName);
}

listCloneJobs

Lists CloneJobs of a given migrating VM.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of source VMs.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\CloneJob;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of source VMs. Please see
 *                                {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_clone_jobs_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listCloneJobs($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );
    $pageToken = '[PAGE_TOKEN]';

    list_clone_jobs_sample($formattedParent, $pageToken);
}

listCutoverJobs

Lists CutoverJobs of a given migrating VM.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of migrating VMs.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\CutoverJob;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of migrating VMs. Please see
 *                                {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_cutover_jobs_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listCutoverJobs($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );
    $pageToken = '[PAGE_TOKEN]';

    list_cutover_jobs_sample($formattedParent, $pageToken);
}

listDatacenterConnectors

Lists DatacenterConnectors in a given Source.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of connectors.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\DatacenterConnector;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of connectors. Please see
 *                                {@see VmMigrationClient::sourceName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_datacenter_connectors_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listDatacenterConnectors($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
    $pageToken = '[PAGE_TOKEN]';

    list_datacenter_connectors_sample($formattedParent, $pageToken);
}

listGroups

Lists Groups in a given project and location.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of groups.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\Group;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of groups. Please see
 *                                {@see VmMigrationClient::locationName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_groups_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listGroups($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]');
    $pageToken = '[PAGE_TOKEN]';

    list_groups_sample($formattedParent, $pageToken);
}

listMigratingVms

Lists MigratingVms in a given Source.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of MigratingVms.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ view int

Optional. The level of details of each migrating VM. For allowed values, use constants defined on Google\Cloud\VMMigration\V1\MigratingVmView

↳ 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\VMMigration\V1\MigratingVm;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of MigratingVms. Please see
 *                                {@see VmMigrationClient::sourceName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_migrating_vms_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listMigratingVms($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
    $pageToken = '[PAGE_TOKEN]';

    list_migrating_vms_sample($formattedParent, $pageToken);
}

listReplicationCycles

Lists ReplicationCycles in a given MigratingVM.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of ReplicationCycles.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\ReplicationCycle;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of ReplicationCycles. Please see
 *                                {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_replication_cycles_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listReplicationCycles($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );
    $pageToken = '[PAGE_TOKEN]';

    list_replication_cycles_sample($formattedParent, $pageToken);
}

listSources

Lists Sources in a given project and location.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of sources.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\Source;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of sources. Please see
 *                                {@see VmMigrationClient::locationName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_sources_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listSources($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]');
    $pageToken = '[PAGE_TOKEN]';

    list_sources_sample($formattedParent, $pageToken);
}

listTargetProjects

Lists TargetProjects in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of targets.

pageToken string

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

optionalArgs array

Optional.

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\TargetProject;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The parent, which owns this collection of targets. Please see
 *                                {@see VmMigrationClient::locationName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_target_projects_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listTargetProjects($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]');
    $pageToken = '[PAGE_TOKEN]';

    list_target_projects_sample($formattedParent, $pageToken);
}

listUtilizationReports

Lists Utilization Reports of the given Source.

Parameters
NameDescription
parent string

Required. The Utilization Reports parent.

pageToken string

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

optionalArgs array

Optional.

↳ view int

Optional. The level of details of each report. Defaults to BASIC. For allowed values, use constants defined on Google\Cloud\VMMigration\V1\UtilizationReportView

↳ pageSize int

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

↳ filter string

Optional. The filter request.

↳ orderBy string

Optional. the order by fields for the result.

↳ 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\VMMigration\V1\UtilizationReport;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * @param string $formattedParent The Utilization Reports parent. Please see
 *                                {@see VmMigrationClient::sourceName()} for help formatting this field.
 * @param string $pageToken       A page token is used to specify a page of values to be returned.
 *                                If no page token is specified (the default), the first page
 *                                of values will be returned. Any page token used here must have
 *                                been generated by a previous call to the API.
 */
function list_utilization_reports_sample(string $formattedParent, string $pageToken): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $vmMigrationClient->listUtilizationReports($formattedParent, $pageToken);

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

/**
 * 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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
    $pageToken = '[PAGE_TOKEN]';

    list_utilization_reports_sample($formattedParent, $pageToken);
}

pauseMigration

Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.

Parameters
NameDescription
migratingVm string

Required. The name of the MigratingVm.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\PauseMigrationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedMigratingVm The name of the MigratingVm. Please see
 *                                     {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 */
function pause_migration_sample(string $formattedMigratingVm): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedMigratingVm = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );

    pause_migration_sample($formattedMigratingVm);
}

removeGroupMigration

Removes a MigratingVm from a Group.

Parameters
NameDescription
group string

Required. The name of the Group.

optionalArgs array

Optional.

↳ migratingVm string

The MigratingVm to remove.

↳ 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\VMMigration\V1\RemoveGroupMigrationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedGroup The name of the Group. Please see
 *                               {@see VmMigrationClient::groupName()} for help formatting this field.
 */
function remove_group_migration_sample(string $formattedGroup): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedGroup = VmMigrationClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');

    remove_group_migration_sample($formattedGroup);
}

resumeMigration

Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.

Parameters
NameDescription
migratingVm string

Required. The name of the MigratingVm.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\ResumeMigrationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedMigratingVm The name of the MigratingVm. Please see
 *                                     {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 */
function resume_migration_sample(string $formattedMigratingVm): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedMigratingVm = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );

    resume_migration_sample($formattedMigratingVm);
}

startMigration

Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.

Parameters
NameDescription
migratingVm string

Required. The name of the MigratingVm.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\StartMigrationResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedMigratingVm The name of the MigratingVm. Please see
 *                                     {@see VmMigrationClient::migratingVmName()} for help formatting this field.
 */
function start_migration_sample(string $formattedMigratingVm): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedMigratingVm = VmMigrationClient::migratingVmName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[MIGRATING_VM]'
    );

    start_migration_sample($formattedMigratingVm);
}

updateGroup

Updates the parameters of a single Group.

Parameters
NameDescription
group Google\Cloud\VMMigration\V1\Group

Required. The update request body.

optionalArgs array

Optional.

↳ updateMask FieldMask

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

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\Group;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
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_group_sample(): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $group = new Group();

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

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

updateMigratingVm

Updates the parameters of a single MigratingVm.

Parameters
NameDescription
migratingVm Google\Cloud\VMMigration\V1\MigratingVm

Required. The update request body.

optionalArgs array

Optional.

↳ updateMask FieldMask

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

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\MigratingVm;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
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_migrating_vm_sample(): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $migratingVm = new MigratingVm();

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

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

updateSource

Updates the parameters of a single Source.

Parameters
NameDescription
source Google\Cloud\VMMigration\V1\Source

Required. The update request body.

optionalArgs array

Optional.

↳ updateMask FieldMask

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

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\Source;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
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_source_sample(): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $source = new Source();

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

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

updateTargetProject

Updates the parameters of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Parameters
NameDescription
targetProject Google\Cloud\VMMigration\V1\TargetProject

Required. The update request body.

optionalArgs array

Optional.

↳ updateMask FieldMask

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

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\TargetProject;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
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_target_project_sample(): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $targetProject = new TargetProject();

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

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

upgradeAppliance

Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.

Parameters
NameDescription
datacenterConnector string

Required. The DatacenterConnector name.

optionalArgs array

Optional.

↳ requestId string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\VMMigration\V1\UpgradeApplianceResponse;
use Google\Cloud\VMMigration\V1\VmMigrationClient;
use Google\Rpc\Status;

/**
 * @param string $formattedDatacenterConnector The DatacenterConnector name. Please see
 *                                             {@see VmMigrationClient::datacenterConnectorName()} for help formatting this field.
 */
function upgrade_appliance_sample(string $formattedDatacenterConnector): void
{
    // Create a client.
    $vmMigrationClient = new VmMigrationClient();

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

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

/**
 * 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
{
    $formattedDatacenterConnector = VmMigrationClient::datacenterConnectorName(
        '[PROJECT]',
        '[LOCATION]',
        '[SOURCE]',
        '[DATACENTER_CONNECTOR]'
    );

    upgrade_appliance_sample($formattedDatacenterConnector);
}

getLocation

Gets information about a location.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

Resource name for the location.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Location\Location;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * 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.
    $vmMigrationClient = new VmMigrationClient();

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

listLocations

Lists information about the supported locations for this service.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

The resource that owns the locations collection, if applicable.

↳ filter string

The standard list filter.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\Location;
use Google\Cloud\VMMigration\V1\VmMigrationClient;

/**
 * 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.
    $vmMigrationClient = new VmMigrationClient();

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

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

Constants

SERVICE_NAME

Value: 'google.cloud.vmmigration.v1.VmMigration'

The name of the service.

SERVICE_ADDRESS

Value: 'vmmigration.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

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