Reference documentation and code samples for the Google Cloud Migration Center V1 Client class MigrationCenterClient.
Service Description: Service describing handlers for resources.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ MigrationCenter \ V1 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ 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 |
↳ 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. |
↳ logger |
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
addAssetsToGroup
Adds assets to a group.
The async variant is MigrationCenterClient::addAssetsToGroupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\AddAssetsToGroupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\AddAssetsToGroupRequest;
use Google\Cloud\MigrationCenter\V1\AssetList;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\Group;
use Google\Rpc\Status;
/**
* @param string $formattedGroup Group reference. Please see
* {@see MigrationCenterClient::groupName()} for help formatting this field.
* @param string $formattedAssetsAssetIdsElement A list of asset IDs
* Please see {@see MigrationCenterClient::assetName()} for help formatting this field.
*/
function add_assets_to_group_sample(
string $formattedGroup,
string $formattedAssetsAssetIdsElement
): void {
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$formattedAssetsAssetIds = [$formattedAssetsAssetIdsElement,];
$assets = (new AssetList())
->setAssetIds($formattedAssetsAssetIds);
$request = (new AddAssetsToGroupRequest())
->setGroup($formattedGroup)
->setAssets($assets);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->addAssetsToGroup($request);
$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());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedGroup = MigrationCenterClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');
$formattedAssetsAssetIdsElement = MigrationCenterClient::assetName(
'[PROJECT]',
'[LOCATION]',
'[ASSET]'
);
add_assets_to_group_sample($formattedGroup, $formattedAssetsAssetIdsElement);
}
aggregateAssetsValues
Aggregates the requested fields based on provided function.
The async variant is MigrationCenterClient::aggregateAssetsValuesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\AggregateAssetsValuesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\AggregateAssetsValuesResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\AggregateAssetsValuesRequest;
use Google\Cloud\MigrationCenter\V1\AggregateAssetsValuesResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
/**
* @param string $parent Parent value for `AggregateAssetsValuesRequest`.
*/
function aggregate_assets_values_sample(string $parent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new AggregateAssetsValuesRequest())
->setParent($parent);
// Call the API and handle any network failures.
try {
/** @var AggregateAssetsValuesResponse $response */
$response = $migrationCenterClient->aggregateAssetsValues($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$parent = '[PARENT]';
aggregate_assets_values_sample($parent);
}
batchDeleteAssets
Deletes list of Assets.
The async variant is MigrationCenterClient::batchDeleteAssetsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\BatchDeleteAssetsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\BatchDeleteAssetsRequest;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
/**
* @param string $formattedParent Parent value for batch asset delete. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
* @param string $formattedNamesElement The IDs of the assets to delete.
* A maximum of 1000 assets can be deleted in a batch.
* Format: projects/{project}/locations/{location}/assets/{name}. Please see
* {@see MigrationCenterClient::assetName()} for help formatting this field.
*/
function batch_delete_assets_sample(string $formattedParent, string $formattedNamesElement): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$formattedNames = [$formattedNamesElement,];
$request = (new BatchDeleteAssetsRequest())
->setParent($formattedParent)
->setNames($formattedNames);
// Call the API and handle any network failures.
try {
$migrationCenterClient->batchDeleteAssets($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
$formattedNamesElement = MigrationCenterClient::assetName('[PROJECT]', '[LOCATION]', '[ASSET]');
batch_delete_assets_sample($formattedParent, $formattedNamesElement);
}
batchUpdateAssets
Updates the parameters of a list of assets.
The async variant is MigrationCenterClient::batchUpdateAssetsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Asset;
use Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsRequest;
use Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\UpdateAssetRequest;
use Google\Protobuf\FieldMask;
/**
* @param string $formattedParent Parent value for batch asset update. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function batch_update_assets_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$requestsUpdateMask = new FieldMask();
$requestsAsset = new Asset();
$updateAssetRequest = (new UpdateAssetRequest())
->setUpdateMask($requestsUpdateMask)
->setAsset($requestsAsset);
$requests = [$updateAssetRequest,];
$request = (new BatchUpdateAssetsRequest())
->setParent($formattedParent)
->setRequests($requests);
// Call the API and handle any network failures.
try {
/** @var BatchUpdateAssetsResponse $response */
$response = $migrationCenterClient->batchUpdateAssets($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
batch_update_assets_sample($formattedParent);
}
createGroup
Creates a new group in a given project and location.
The async variant is MigrationCenterClient::createGroupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateGroupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreateGroupRequest;
use Google\Cloud\MigrationCenter\V1\Group;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
* @param string $groupId User specified ID for the group. It will become the last
* component of the group name. The ID must be unique within the project, must
* conform with RFC-1034, is restricted to lower-cased letters, and has a
* maximum length of 63 characters. The ID must match the regular expression:
* `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
*/
function create_group_sample(string $formattedParent, string $groupId): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$group = new Group();
$request = (new CreateGroupRequest())
->setParent($formattedParent)
->setGroupId($groupId)
->setGroup($group);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createGroup($request);
$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());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
$groupId = '[GROUP_ID]';
create_group_sample($formattedParent, $groupId);
}
createImportDataFile
Creates an import data file.
The async variant is MigrationCenterClient::createImportDataFileAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateImportDataFileRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreateImportDataFileRequest;
use Google\Cloud\MigrationCenter\V1\ImportDataFile;
use Google\Cloud\MigrationCenter\V1\ImportJobFormat;
use Google\Rpc\Status;
/**
* @param string $formattedParent Name of the parent of the ImportDataFile. Please see
* {@see MigrationCenterClient::importJobName()} for help formatting this field.
* @param string $importDataFileId The ID of the new data file.
* @param int $importDataFileFormat The payload format.
*/
function create_import_data_file_sample(
string $formattedParent,
string $importDataFileId,
int $importDataFileFormat
): void {
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$importDataFile = (new ImportDataFile())
->setFormat($importDataFileFormat);
$request = (new CreateImportDataFileRequest())
->setParent($formattedParent)
->setImportDataFileId($importDataFileId)
->setImportDataFile($importDataFile);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createImportDataFile($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ImportDataFile $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::importJobName('[PROJECT]', '[LOCATION]', '[IMPORT_JOB]');
$importDataFileId = '[IMPORT_DATA_FILE_ID]';
$importDataFileFormat = ImportJobFormat::IMPORT_JOB_FORMAT_UNSPECIFIED;
create_import_data_file_sample($formattedParent, $importDataFileId, $importDataFileFormat);
}
createImportJob
Creates an import job.
The async variant is MigrationCenterClient::createImportJobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateImportJobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreateImportJobRequest;
use Google\Cloud\MigrationCenter\V1\ImportJob;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
* @param string $importJobId ID of the import job.
* @param string $formattedImportJobAssetSource Reference to a source. Please see
* {@see MigrationCenterClient::sourceName()} for help formatting this field.
*/
function create_import_job_sample(
string $formattedParent,
string $importJobId,
string $formattedImportJobAssetSource
): void {
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$importJob = (new ImportJob())
->setAssetSource($formattedImportJobAssetSource);
$request = (new CreateImportJobRequest())
->setParent($formattedParent)
->setImportJobId($importJobId)
->setImportJob($importJob);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createImportJob($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ImportJob $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
$importJobId = '[IMPORT_JOB_ID]';
$formattedImportJobAssetSource = MigrationCenterClient::sourceName(
'[PROJECT]',
'[LOCATION]',
'[SOURCE]'
);
create_import_job_sample($formattedParent, $importJobId, $formattedImportJobAssetSource);
}
createPreferenceSet
Creates a new preference set in a given project and location.
The async variant is MigrationCenterClient::createPreferenceSetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreatePreferenceSetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreatePreferenceSetRequest;
use Google\Cloud\MigrationCenter\V1\PreferenceSet;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
* @param string $preferenceSetId User specified ID for the preference set. It will become the last
* component of the preference set name. The ID must be unique within the
* project, must conform with RFC-1034, is restricted to lower-cased letters,
* and has a maximum length of 63 characters. The ID must match the regular
* expression
* `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
*/
function create_preference_set_sample(string $formattedParent, string $preferenceSetId): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$preferenceSet = new PreferenceSet();
$request = (new CreatePreferenceSetRequest())
->setParent($formattedParent)
->setPreferenceSetId($preferenceSetId)
->setPreferenceSet($preferenceSet);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createPreferenceSet($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PreferenceSet $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
$preferenceSetId = '[PREFERENCE_SET_ID]';
create_preference_set_sample($formattedParent, $preferenceSetId);
}
createReport
Creates a report.
The async variant is MigrationCenterClient::createReportAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateReportRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreateReportRequest;
use Google\Cloud\MigrationCenter\V1\Report;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see MigrationCenterClient::reportConfigName()} for help formatting this field.
* @param string $reportId User specified id for the report. It will become the last
* component of the report name. The id must be unique within the project,
* must conform with RFC-1034, is restricted to lower-cased letters, and has a
* maximum length of 63 characters. The id must match the regular expression:
* [a-z]([a-z0-9-]{0,61}[a-z0-9])?.
*/
function create_report_sample(string $formattedParent, string $reportId): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$report = new Report();
$request = (new CreateReportRequest())
->setParent($formattedParent)
->setReportId($reportId)
->setReport($report);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createReport($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Report $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::reportConfigName(
'[PROJECT]',
'[LOCATION]',
'[REPORT_CONFIG]'
);
$reportId = '[REPORT_ID]';
create_report_sample($formattedParent, $reportId);
}
createReportConfig
Creates a report configuration.
The async variant is MigrationCenterClient::createReportConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateReportConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreateReportConfigRequest;
use Google\Cloud\MigrationCenter\V1\ReportConfig;
use Google\Cloud\MigrationCenter\V1\ReportConfig\GroupPreferenceSetAssignment;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
* @param string $reportConfigId User specified ID for the report config. It will become the last
* component of the report config name. The ID must be unique within the
* project, must conform with RFC-1034, is restricted to lower-cased letters,
* and has a maximum length of 63 characters. The ID must match the regular
* expression: [a-z]([a-z0-9-]{0,61}[a-z0-9])?.
* @param string $formattedReportConfigGroupPreferencesetAssignmentsGroup Name of the group. Please see
* {@see MigrationCenterClient::groupName()} for help formatting this field.
* @param string $formattedReportConfigGroupPreferencesetAssignmentsPreferenceSet Name of the Preference Set. Please see
* {@see MigrationCenterClient::preferenceSetName()} for help formatting this field.
*/
function create_report_config_sample(
string $formattedParent,
string $reportConfigId,
string $formattedReportConfigGroupPreferencesetAssignmentsGroup,
string $formattedReportConfigGroupPreferencesetAssignmentsPreferenceSet
): void {
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$groupPreferenceSetAssignment = (new GroupPreferenceSetAssignment())
->setGroup($formattedReportConfigGroupPreferencesetAssignmentsGroup)
->setPreferenceSet($formattedReportConfigGroupPreferencesetAssignmentsPreferenceSet);
$reportConfigGroupPreferencesetAssignments = [$groupPreferenceSetAssignment,];
$reportConfig = (new ReportConfig())
->setGroupPreferencesetAssignments($reportConfigGroupPreferencesetAssignments);
$request = (new CreateReportConfigRequest())
->setParent($formattedParent)
->setReportConfigId($reportConfigId)
->setReportConfig($reportConfig);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createReportConfig($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ReportConfig $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
$reportConfigId = '[REPORT_CONFIG_ID]';
$formattedReportConfigGroupPreferencesetAssignmentsGroup = MigrationCenterClient::groupName(
'[PROJECT]',
'[LOCATION]',
'[GROUP]'
);
$formattedReportConfigGroupPreferencesetAssignmentsPreferenceSet = MigrationCenterClient::preferenceSetName(
'[PROJECT]',
'[LOCATION]',
'[PREFERENCE_SET]'
);
create_report_config_sample(
$formattedParent,
$reportConfigId,
$formattedReportConfigGroupPreferencesetAssignmentsGroup,
$formattedReportConfigGroupPreferencesetAssignmentsPreferenceSet
);
}
createSource
Creates a new source in a given project and location.
The async variant is MigrationCenterClient::createSourceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateSourceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\CreateSourceRequest;
use Google\Cloud\MigrationCenter\V1\Source;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
* @param string $sourceId User specified ID for the source. It will become the last
* component of the source name. The ID must be unique within the project,
* must conform with RFC-1034, is restricted to lower-cased letters, and has a
* maximum length of 63 characters. The ID must match the regular expression:
* `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
*/
function create_source_sample(string $formattedParent, string $sourceId): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$source = new Source();
$request = (new CreateSourceRequest())
->setParent($formattedParent)
->setSourceId($sourceId)
->setSource($source);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->createSource($request);
$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());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
$sourceId = '[SOURCE_ID]';
create_source_sample($formattedParent, $sourceId);
}
deleteAsset
Deletes an asset.
The async variant is MigrationCenterClient::deleteAssetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteAssetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteAssetRequest;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::assetName()} for help formatting this field.
*/
function delete_asset_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteAssetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$migrationCenterClient->deleteAsset($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::assetName('[PROJECT]', '[LOCATION]', '[ASSET]');
delete_asset_sample($formattedName);
}
deleteGroup
Deletes a group.
The async variant is MigrationCenterClient::deleteGroupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteGroupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteGroupRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the group resource. Please see
* {@see MigrationCenterClient::groupName()} for help formatting this field.
*/
function delete_group_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteGroupRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deleteGroup($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');
delete_group_sample($formattedName);
}
deleteImportDataFile
Delete an import data file.
The async variant is MigrationCenterClient::deleteImportDataFileAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteImportDataFileRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteImportDataFileRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the ImportDataFile to delete. Please see
* {@see MigrationCenterClient::importDataFileName()} for help formatting this field.
*/
function delete_import_data_file_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteImportDataFileRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deleteImportDataFile($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::importDataFileName(
'[PROJECT]',
'[LOCATION]',
'[IMPORT_JOB]',
'[IMPORT_DATA_FILE]'
);
delete_import_data_file_sample($formattedName);
}
deleteImportJob
Deletes an import job.
The async variant is MigrationCenterClient::deleteImportJobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteImportJobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteImportJobRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::importJobName()} for help formatting this field.
*/
function delete_import_job_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteImportJobRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deleteImportJob($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::importJobName('[PROJECT]', '[LOCATION]', '[IMPORT_JOB]');
delete_import_job_sample($formattedName);
}
deletePreferenceSet
Deletes a preference set.
The async variant is MigrationCenterClient::deletePreferenceSetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeletePreferenceSetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeletePreferenceSetRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the group resource. Please see
* {@see MigrationCenterClient::preferenceSetName()} for help formatting this field.
*/
function delete_preference_set_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeletePreferenceSetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deletePreferenceSet($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::preferenceSetName(
'[PROJECT]',
'[LOCATION]',
'[PREFERENCE_SET]'
);
delete_preference_set_sample($formattedName);
}
deleteReport
Deletes a Report.
The async variant is MigrationCenterClient::deleteReportAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteReportRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteReportRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::reportName()} for help formatting this field.
*/
function delete_report_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteReportRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deleteReport($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::reportName(
'[PROJECT]',
'[LOCATION]',
'[REPORT_CONFIG]',
'[REPORT]'
);
delete_report_sample($formattedName);
}
deleteReportConfig
Deletes a ReportConfig.
The async variant is MigrationCenterClient::deleteReportConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteReportConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteReportConfigRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::reportConfigName()} for help formatting this field.
*/
function delete_report_config_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteReportConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deleteReportConfig($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::reportConfigName(
'[PROJECT]',
'[LOCATION]',
'[REPORT_CONFIG]'
);
delete_report_config_sample($formattedName);
}
deleteSource
Deletes a source.
The async variant is MigrationCenterClient::deleteSourceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteSourceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\DeleteSourceRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::sourceName()} for help formatting this field.
*/
function delete_source_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new DeleteSourceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->deleteSource($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
delete_source_sample($formattedName);
}
getAsset
Gets the details of an asset.
The async variant is MigrationCenterClient::getAssetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetAssetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\Asset |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Asset;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetAssetRequest;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::assetName()} for help formatting this field.
*/
function get_asset_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetAssetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Asset $response */
$response = $migrationCenterClient->getAsset($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::assetName('[PROJECT]', '[LOCATION]', '[ASSET]');
get_asset_sample($formattedName);
}
getErrorFrame
Gets the details of an error frame.
The async variant is MigrationCenterClient::getErrorFrameAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetErrorFrameRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\ErrorFrame |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ErrorFrame;
use Google\Cloud\MigrationCenter\V1\GetErrorFrameRequest;
/**
* @param string $formattedName The name of the frame to retrieve.
* Format:
* projects/{project}/locations/{location}/sources/{source}/errorFrames/{error_frame}
* Please see {@see MigrationCenterClient::errorFrameName()} for help formatting this field.
*/
function get_error_frame_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetErrorFrameRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ErrorFrame $response */
$response = $migrationCenterClient->getErrorFrame($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::errorFrameName(
'[PROJECT]',
'[LOCATION]',
'[SOURCE]',
'[ERROR_FRAME]'
);
get_error_frame_sample($formattedName);
}
getGroup
Gets the details of a group.
The async variant is MigrationCenterClient::getGroupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetGroupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\Group |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetGroupRequest;
use Google\Cloud\MigrationCenter\V1\Group;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::groupName()} for help formatting this field.
*/
function get_group_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetGroupRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Group $response */
$response = $migrationCenterClient->getGroup($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');
get_group_sample($formattedName);
}
getImportDataFile
Gets an import data file.
The async variant is MigrationCenterClient::getImportDataFileAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetImportDataFileRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\ImportDataFile |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetImportDataFileRequest;
use Google\Cloud\MigrationCenter\V1\ImportDataFile;
/**
* @param string $formattedName Name of the ImportDataFile. Please see
* {@see MigrationCenterClient::importDataFileName()} for help formatting this field.
*/
function get_import_data_file_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetImportDataFileRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ImportDataFile $response */
$response = $migrationCenterClient->getImportDataFile($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::importDataFileName(
'[PROJECT]',
'[LOCATION]',
'[IMPORT_JOB]',
'[IMPORT_DATA_FILE]'
);
get_import_data_file_sample($formattedName);
}
getImportJob
Gets the details of an import job.
The async variant is MigrationCenterClient::getImportJobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetImportJobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\ImportJob |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetImportJobRequest;
use Google\Cloud\MigrationCenter\V1\ImportJob;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::importJobName()} for help formatting this field.
*/
function get_import_job_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetImportJobRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ImportJob $response */
$response = $migrationCenterClient->getImportJob($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::importJobName('[PROJECT]', '[LOCATION]', '[IMPORT_JOB]');
get_import_job_sample($formattedName);
}
getPreferenceSet
Gets the details of a preference set.
The async variant is MigrationCenterClient::getPreferenceSetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetPreferenceSetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\PreferenceSet |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetPreferenceSetRequest;
use Google\Cloud\MigrationCenter\V1\PreferenceSet;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::preferenceSetName()} for help formatting this field.
*/
function get_preference_set_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetPreferenceSetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PreferenceSet $response */
$response = $migrationCenterClient->getPreferenceSet($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::preferenceSetName(
'[PROJECT]',
'[LOCATION]',
'[PREFERENCE_SET]'
);
get_preference_set_sample($formattedName);
}
getReport
Gets details of a single Report.
The async variant is MigrationCenterClient::getReportAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetReportRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\Report |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetReportRequest;
use Google\Cloud\MigrationCenter\V1\Report;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::reportName()} for help formatting this field.
*/
function get_report_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetReportRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Report $response */
$response = $migrationCenterClient->getReport($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::reportName(
'[PROJECT]',
'[LOCATION]',
'[REPORT_CONFIG]',
'[REPORT]'
);
get_report_sample($formattedName);
}
getReportConfig
Gets details of a single ReportConfig.
The async variant is MigrationCenterClient::getReportConfigAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetReportConfigRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\ReportConfig |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetReportConfigRequest;
use Google\Cloud\MigrationCenter\V1\ReportConfig;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::reportConfigName()} for help formatting this field.
*/
function get_report_config_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetReportConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ReportConfig $response */
$response = $migrationCenterClient->getReportConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::reportConfigName(
'[PROJECT]',
'[LOCATION]',
'[REPORT_CONFIG]'
);
get_report_config_sample($formattedName);
}
getSettings
Gets the details of regional settings.
The async variant is MigrationCenterClient::getSettingsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetSettingsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\Settings |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetSettingsRequest;
use Google\Cloud\MigrationCenter\V1\Settings;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::settingsName()} for help formatting this field.
*/
function get_settings_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetSettingsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Settings $response */
$response = $migrationCenterClient->getSettings($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::settingsName('[PROJECT]', '[LOCATION]');
get_settings_sample($formattedName);
}
getSource
Gets the details of a source.
The async variant is MigrationCenterClient::getSourceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetSourceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\Source |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\GetSourceRequest;
use Google\Cloud\MigrationCenter\V1\Source;
/**
* @param string $formattedName Name of the resource. Please see
* {@see MigrationCenterClient::sourceName()} for help formatting this field.
*/
function get_source_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new GetSourceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Source $response */
$response = $migrationCenterClient->getSource($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
get_source_sample($formattedName);
}
listAssets
Lists all the assets in a given project and location.
The async variant is MigrationCenterClient::listAssetsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListAssetsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Asset;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ListAssetsRequest;
/**
* @param string $formattedParent Parent value for `ListAssetsRequest`. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function list_assets_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListAssetsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listAssets($request);
/** @var Asset $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
list_assets_sample($formattedParent);
}
listErrorFrames
Lists all error frames in a given source and location.
The async variant is MigrationCenterClient::listErrorFramesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListErrorFramesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ErrorFrame;
use Google\Cloud\MigrationCenter\V1\ListErrorFramesRequest;
/**
* @param string $formattedParent Parent value (the source) for `ListErrorFramesRequest`. Please see
* {@see MigrationCenterClient::sourceName()} for help formatting this field.
*/
function list_error_frames_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListErrorFramesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listErrorFrames($request);
/** @var ErrorFrame $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
list_error_frames_sample($formattedParent);
}
listGroups
Lists all groups in a given project and location.
The async variant is MigrationCenterClient::listGroupsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListGroupsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\Group;
use Google\Cloud\MigrationCenter\V1\ListGroupsRequest;
/**
* @param string $formattedParent Parent value for `ListGroupsRequest`. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function list_groups_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListGroupsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listGroups($request);
/** @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());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
list_groups_sample($formattedParent);
}
listImportDataFiles
List import data files.
The async variant is MigrationCenterClient::listImportDataFilesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListImportDataFilesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ImportDataFile;
use Google\Cloud\MigrationCenter\V1\ListImportDataFilesRequest;
/**
* @param string $formattedParent Name of the parent of the `ImportDataFiles` resource. Please see
* {@see MigrationCenterClient::importJobName()} for help formatting this field.
*/
function list_import_data_files_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListImportDataFilesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listImportDataFiles($request);
/** @var ImportDataFile $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::importJobName('[PROJECT]', '[LOCATION]', '[IMPORT_JOB]');
list_import_data_files_sample($formattedParent);
}
listImportJobs
Lists all import jobs.
The async variant is MigrationCenterClient::listImportJobsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListImportJobsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ImportJob;
use Google\Cloud\MigrationCenter\V1\ListImportJobsRequest;
/**
* @param string $formattedParent Parent value for `ListImportJobsRequest`. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function list_import_jobs_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListImportJobsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listImportJobs($request);
/** @var ImportJob $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
list_import_jobs_sample($formattedParent);
}
listPreferenceSets
Lists all the preference sets in a given project and location.
The async variant is MigrationCenterClient::listPreferenceSetsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListPreferenceSetsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ListPreferenceSetsRequest;
use Google\Cloud\MigrationCenter\V1\PreferenceSet;
/**
* @param string $formattedParent Parent value for `ListPreferenceSetsRequest`. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function list_preference_sets_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListPreferenceSetsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listPreferenceSets($request);
/** @var PreferenceSet $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
list_preference_sets_sample($formattedParent);
}
listReportConfigs
Lists ReportConfigs in a given project and location.
The async variant is MigrationCenterClient::listReportConfigsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListReportConfigsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ListReportConfigsRequest;
use Google\Cloud\MigrationCenter\V1\ReportConfig;
/**
* @param string $formattedParent Parent value for `ListReportConfigsRequest`. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function list_report_configs_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListReportConfigsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listReportConfigs($request);
/** @var ReportConfig $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
list_report_configs_sample($formattedParent);
}
listReports
Lists Reports in a given ReportConfig.
The async variant is MigrationCenterClient::listReportsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListReportsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ListReportsRequest;
use Google\Cloud\MigrationCenter\V1\Report;
/**
* @param string $formattedParent Parent value for `ListReportsRequest`. Please see
* {@see MigrationCenterClient::reportConfigName()} for help formatting this field.
*/
function list_reports_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListReportsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listReports($request);
/** @var Report $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::reportConfigName(
'[PROJECT]',
'[LOCATION]',
'[REPORT_CONFIG]'
);
list_reports_sample($formattedParent);
}
listSources
Lists all the sources in a given project and location.
The async variant is MigrationCenterClient::listSourcesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListSourcesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ListSourcesRequest;
use Google\Cloud\MigrationCenter\V1\Source;
/**
* @param string $formattedParent Parent value for `ListSourcesRequest`. Please see
* {@see MigrationCenterClient::locationName()} for help formatting this field.
*/
function list_sources_sample(string $formattedParent): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ListSourcesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listSources($request);
/** @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());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = MigrationCenterClient::locationName('[PROJECT]', '[LOCATION]');
list_sources_sample($formattedParent);
}
removeAssetsFromGroup
Removes assets from a group.
The async variant is MigrationCenterClient::removeAssetsFromGroupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\RemoveAssetsFromGroupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\AssetList;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\Group;
use Google\Cloud\MigrationCenter\V1\RemoveAssetsFromGroupRequest;
use Google\Rpc\Status;
/**
* @param string $formattedGroup Group reference. Please see
* {@see MigrationCenterClient::groupName()} for help formatting this field.
* @param string $formattedAssetsAssetIdsElement A list of asset IDs
* Please see {@see MigrationCenterClient::assetName()} for help formatting this field.
*/
function remove_assets_from_group_sample(
string $formattedGroup,
string $formattedAssetsAssetIdsElement
): void {
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$formattedAssetsAssetIds = [$formattedAssetsAssetIdsElement,];
$assets = (new AssetList())
->setAssetIds($formattedAssetsAssetIds);
$request = (new RemoveAssetsFromGroupRequest())
->setGroup($formattedGroup)
->setAssets($assets);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->removeAssetsFromGroup($request);
$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());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedGroup = MigrationCenterClient::groupName('[PROJECT]', '[LOCATION]', '[GROUP]');
$formattedAssetsAssetIdsElement = MigrationCenterClient::assetName(
'[PROJECT]',
'[LOCATION]',
'[ASSET]'
);
remove_assets_from_group_sample($formattedGroup, $formattedAssetsAssetIdsElement);
}
reportAssetFrames
Reports a set of frames.
The async variant is MigrationCenterClient::reportAssetFramesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ReportAssetFramesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\ReportAssetFramesResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ReportAssetFramesRequest;
use Google\Cloud\MigrationCenter\V1\ReportAssetFramesResponse;
/**
* @param string $parent Parent of the resource.
* @param string $formattedSource Reference to a source. Please see
* {@see MigrationCenterClient::sourceName()} for help formatting this field.
*/
function report_asset_frames_sample(string $parent, string $formattedSource): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ReportAssetFramesRequest())
->setParent($parent)
->setSource($formattedSource);
// Call the API and handle any network failures.
try {
/** @var ReportAssetFramesResponse $response */
$response = $migrationCenterClient->reportAssetFrames($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$parent = '[PARENT]';
$formattedSource = MigrationCenterClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]');
report_asset_frames_sample($parent, $formattedSource);
}
runImportJob
Runs an import job.
The async variant is MigrationCenterClient::runImportJobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\RunImportJobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\RunImportJobRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The name of the import job to run. Please see
* {@see MigrationCenterClient::importJobName()} for help formatting this field.
*/
function run_import_job_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new RunImportJobRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->runImportJob($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::importJobName('[PROJECT]', '[LOCATION]', '[IMPORT_JOB]');
run_import_job_sample($formattedName);
}
updateAsset
Updates the parameters of an asset.
The async variant is MigrationCenterClient::updateAssetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateAssetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\MigrationCenter\V1\Asset |
use Google\ApiCore\ApiException;
use Google\Cloud\MigrationCenter\V1\Asset;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\UpdateAssetRequest;
use Google\Protobuf\FieldMask;
/**
* 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_asset_sample(): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$updateMask = new FieldMask();
$asset = new Asset();
$request = (new UpdateAssetRequest())
->setUpdateMask($updateMask)
->setAsset($asset);
// Call the API and handle any network failures.
try {
/** @var Asset $response */
$response = $migrationCenterClient->updateAsset($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateGroup
Updates the parameters of a group.
The async variant is MigrationCenterClient::updateGroupAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateGroupRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\Group;
use Google\Cloud\MigrationCenter\V1\UpdateGroupRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_group_sample(): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$updateMask = new FieldMask();
$group = new Group();
$request = (new UpdateGroupRequest())
->setUpdateMask($updateMask)
->setGroup($group);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->updateGroup($request);
$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());
}
}
updateImportJob
Updates an import job.
The async variant is MigrationCenterClient::updateImportJobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateImportJobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ImportJob;
use Google\Cloud\MigrationCenter\V1\UpdateImportJobRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $formattedImportJobAssetSource Reference to a source. Please see
* {@see MigrationCenterClient::sourceName()} for help formatting this field.
*/
function update_import_job_sample(string $formattedImportJobAssetSource): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$updateMask = new FieldMask();
$importJob = (new ImportJob())
->setAssetSource($formattedImportJobAssetSource);
$request = (new UpdateImportJobRequest())
->setUpdateMask($updateMask)
->setImportJob($importJob);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->updateImportJob($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ImportJob $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedImportJobAssetSource = MigrationCenterClient::sourceName(
'[PROJECT]',
'[LOCATION]',
'[SOURCE]'
);
update_import_job_sample($formattedImportJobAssetSource);
}
updatePreferenceSet
Updates the parameters of a preference set.
The async variant is MigrationCenterClient::updatePreferenceSetAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdatePreferenceSetRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\PreferenceSet;
use Google\Cloud\MigrationCenter\V1\UpdatePreferenceSetRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_preference_set_sample(): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$updateMask = new FieldMask();
$preferenceSet = new PreferenceSet();
$request = (new UpdatePreferenceSetRequest())
->setUpdateMask($updateMask)
->setPreferenceSet($preferenceSet);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->updatePreferenceSet($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PreferenceSet $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());
}
}
updateSettings
Updates the regional-level project settings.
The async variant is MigrationCenterClient::updateSettingsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateSettingsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\Settings;
use Google\Cloud\MigrationCenter\V1\UpdateSettingsRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_settings_sample(): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$updateMask = new FieldMask();
$settings = new Settings();
$request = (new UpdateSettingsRequest())
->setUpdateMask($updateMask)
->setSettings($settings);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->updateSettings($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Settings $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 source.
The async variant is MigrationCenterClient::updateSourceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateSourceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\Source;
use Google\Cloud\MigrationCenter\V1\UpdateSourceRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_source_sample(): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$updateMask = new FieldMask();
$source = new Source();
$request = (new UpdateSourceRequest())
->setUpdateMask($updateMask)
->setSource($source);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->updateSource($request);
$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());
}
}
validateImportJob
Validates an import job.
The async variant is MigrationCenterClient::validateImportJobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ValidateImportJobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
use Google\Cloud\MigrationCenter\V1\ValidateImportJobRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The name of the import job to validate. Please see
* {@see MigrationCenterClient::importJobName()} for help formatting this field.
*/
function validate_import_job_sample(string $formattedName): void
{
// Create a client.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = (new ValidateImportJobRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $migrationCenterClient->validateImportJob($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = MigrationCenterClient::importJobName('[PROJECT]', '[LOCATION]', '[IMPORT_JOB]');
validate_import_job_sample($formattedName);
}
getLocation
Gets information about a location.
The async variant is MigrationCenterClient::getLocationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
/**
* 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.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $migrationCenterClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
The async variant is MigrationCenterClient::listLocationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\MigrationCenter\V1\Client\MigrationCenterClient;
/**
* 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.
$migrationCenterClient = new MigrationCenterClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $migrationCenterClient->listLocations($request);
/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
addAssetsToGroupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\AddAssetsToGroupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
aggregateAssetsValuesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\AggregateAssetsValuesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\AggregateAssetsValuesResponse> |
batchDeleteAssetsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\BatchDeleteAssetsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
batchUpdateAssetsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\BatchUpdateAssetsResponse> |
createGroupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateGroupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createImportDataFileAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateImportDataFileRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createImportJobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateImportJobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createPreferenceSetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreatePreferenceSetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createReportAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateReportRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createReportConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateReportConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createSourceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\CreateSourceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteAssetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteAssetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
deleteGroupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteGroupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteImportDataFileAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteImportDataFileRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteImportJobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteImportJobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deletePreferenceSetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeletePreferenceSetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteReportAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteReportRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteReportConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteReportConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteSourceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\DeleteSourceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
getAssetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetAssetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\Asset> |
getErrorFrameAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetErrorFrameRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\ErrorFrame> |
getGroupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetGroupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\Group> |
getImportDataFileAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetImportDataFileRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\ImportDataFile> |
getImportJobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetImportJobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\ImportJob> |
getPreferenceSetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetPreferenceSetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\PreferenceSet> |
getReportAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetReportRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\Report> |
getReportConfigAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetReportConfigRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\ReportConfig> |
getSettingsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetSettingsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\Settings> |
getSourceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\GetSourceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\Source> |
listAssetsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListAssetsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listErrorFramesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListErrorFramesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listGroupsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListGroupsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listImportDataFilesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListImportDataFilesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listImportJobsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListImportJobsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listPreferenceSetsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListPreferenceSetsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listReportConfigsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListReportConfigsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listReportsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListReportsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listSourcesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ListSourcesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
removeAssetsFromGroupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\RemoveAssetsFromGroupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
reportAssetFramesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ReportAssetFramesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\ReportAssetFramesResponse> |
runImportJobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\RunImportJobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateAssetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateAssetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\MigrationCenter\V1\Asset> |
updateGroupAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateGroupRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateImportJobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateImportJobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updatePreferenceSetAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdatePreferenceSetRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateSettingsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateSettingsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateSourceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\UpdateSourceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
validateImportJobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\MigrationCenter\V1\ValidateImportJobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
getLocationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Location\Location> |
listLocationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\LongRunning\Client\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
static::assetName
Formats a string containing the fully-qualified path to represent a asset resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
asset |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted asset resource. |
static::errorFrameName
Formats a string containing the fully-qualified path to represent a error_frame resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
source |
string
|
errorFrame |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted error_frame resource. |
static::groupName
Formats a string containing the fully-qualified path to represent a group resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
group |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted group resource. |
static::importDataFileName
Formats a string containing the fully-qualified path to represent a import_data_file resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
importJob |
string
|
importDataFile |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted import_data_file resource. |
static::importJobName
Formats a string containing the fully-qualified path to represent a import_job resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
importJob |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted import_job resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted location resource. |
static::preferenceSetName
Formats a string containing the fully-qualified path to represent a preference_set resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
preferenceSet |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted preference_set resource. |
static::reportName
Formats a string containing the fully-qualified path to represent a report resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
reportConfig |
string
|
report |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted report resource. |
static::reportConfigName
Formats a string containing the fully-qualified path to represent a report_config resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
reportConfig |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted report_config resource. |
static::settingsName
Formats a string containing the fully-qualified path to represent a settings resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted settings resource. |
static::sourceName
Formats a string containing the fully-qualified path to represent a source resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
source |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted source resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- asset: projects/{project}/locations/{location}/assets/{asset}
- errorFrame: projects/{project}/locations/{location}/sources/{source}/errorFrames/{error_frame}
- group: projects/{project}/locations/{location}/groups/{group}
- importDataFile: projects/{project}/locations/{location}/importJobs/{import_job}/importDataFiles/{import_data_file}
- importJob: projects/{project}/locations/{location}/importJobs/{import_job}
- location: projects/{project}/locations/{location}
- preferenceSet: projects/{project}/locations/{location}/preferenceSets/{preference_set}
- report: projects/{project}/locations/{location}/reportConfigs/{report_config}/reports/{report}
- reportConfig: projects/{project}/locations/{location}/reportConfigs/{report_config}
- settings: projects/{project}/locations/{location}/settings
- source: projects/{project}/locations/{location}/sources/{source}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
?string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array |
An associative array from name component IDs to component values. |