Cloud AI Platform v1 API - Class MigrationServiceClient (2.12.0)

public abstract class MigrationServiceClient

Reference documentation and code samples for the Cloud AI Platform v1 API class MigrationServiceClient.

MigrationService client wrapper, for convenient use.

Inheritance

object > MigrationServiceClient

Namespace

GoogleCloudGoogle.Cloud.AIPlatformV1

Assembly

Google.Cloud.AIPlatform.V1.dll

Remarks

A service that migrates resources from automl.googleapis.com, datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.

Properties

BatchMigrateResourcesOperationsClient

public virtual OperationsClient BatchMigrateResourcesOperationsClient { get; }

The long-running operations client for BatchMigrateResources.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the MigrationService service, which is a host of "aiplatform.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default MigrationService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default MigrationService scopes are:

GrpcClient

public virtual MigrationService.MigrationServiceClient GrpcClient { get; }

The underlying gRPC MigrationService client

Property Value
TypeDescription
MigrationServiceMigrationServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

BatchMigrateResources(LocationName, IEnumerable<MigrateResourceRequest>, CallSettings)

public virtual Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> BatchMigrateResources(LocationName parent, IEnumerable<MigrateResourceRequest> migrateResourceRequests, CallSettings callSettings = null)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
parentLocationName

Required. The location of the migrated resource will live in. Format: projects/{project}/locations/{location}

migrateResourceRequestsIEnumerableMigrateResourceRequest

Required. The request messages specifying the resources to migrate. They must be in the same location as the destination. Up to 50 resources can be migrated in one batch.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

The RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = MigrationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<MigrateResourceRequest> migrateResourceRequests = new MigrateResourceRequest[]
{
    new MigrateResourceRequest(),
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = migrationServiceClient.BatchMigrateResources(parent, migrateResourceRequests);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = migrationServiceClient.PollOnceBatchMigrateResources(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResources(BatchMigrateResourcesRequest, CallSettings)

public virtual Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> BatchMigrateResources(BatchMigrateResourcesRequest request, CallSettings callSettings = null)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
requestBatchMigrateResourcesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

The RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = MigrationServiceClient.Create();
// Initialize request argument(s)
BatchMigrateResourcesRequest request = new BatchMigrateResourcesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    MigrateResourceRequests =
    {
        new MigrateResourceRequest(),
    },
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = migrationServiceClient.BatchMigrateResources(request);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = migrationServiceClient.PollOnceBatchMigrateResources(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResources(string, IEnumerable<MigrateResourceRequest>, CallSettings)

public virtual Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> BatchMigrateResources(string parent, IEnumerable<MigrateResourceRequest> migrateResourceRequests, CallSettings callSettings = null)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
parentstring

Required. The location of the migrated resource will live in. Format: projects/{project}/locations/{location}

migrateResourceRequestsIEnumerableMigrateResourceRequest

Required. The request messages specifying the resources to migrate. They must be in the same location as the destination. Up to 50 resources can be migrated in one batch.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

The RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = MigrationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<MigrateResourceRequest> migrateResourceRequests = new MigrateResourceRequest[]
{
    new MigrateResourceRequest(),
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = migrationServiceClient.BatchMigrateResources(parent, migrateResourceRequests);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = migrationServiceClient.PollOnceBatchMigrateResources(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResourcesAsync(LocationName, IEnumerable<MigrateResourceRequest>, CallSettings)

public virtual Task<Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>> BatchMigrateResourcesAsync(LocationName parent, IEnumerable<MigrateResourceRequest> migrateResourceRequests, CallSettings callSettings = null)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
parentLocationName

Required. The location of the migrated resource will live in. Format: projects/{project}/locations/{location}

migrateResourceRequestsIEnumerableMigrateResourceRequest

Required. The request messages specifying the resources to migrate. They must be in the same location as the destination. Up to 50 resources can be migrated in one batch.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

A Task containing the RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = await MigrationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<MigrateResourceRequest> migrateResourceRequests = new MigrateResourceRequest[]
{
    new MigrateResourceRequest(),
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = await migrationServiceClient.BatchMigrateResourcesAsync(parent, migrateResourceRequests);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = await migrationServiceClient.PollOnceBatchMigrateResourcesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResourcesAsync(LocationName, IEnumerable<MigrateResourceRequest>, CancellationToken)

public virtual Task<Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>> BatchMigrateResourcesAsync(LocationName parent, IEnumerable<MigrateResourceRequest> migrateResourceRequests, CancellationToken cancellationToken)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
parentLocationName

Required. The location of the migrated resource will live in. Format: projects/{project}/locations/{location}

migrateResourceRequestsIEnumerableMigrateResourceRequest

Required. The request messages specifying the resources to migrate. They must be in the same location as the destination. Up to 50 resources can be migrated in one batch.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

A Task containing the RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = await MigrationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<MigrateResourceRequest> migrateResourceRequests = new MigrateResourceRequest[]
{
    new MigrateResourceRequest(),
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = await migrationServiceClient.BatchMigrateResourcesAsync(parent, migrateResourceRequests);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = await migrationServiceClient.PollOnceBatchMigrateResourcesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResourcesAsync(BatchMigrateResourcesRequest, CallSettings)

public virtual Task<Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>> BatchMigrateResourcesAsync(BatchMigrateResourcesRequest request, CallSettings callSettings = null)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
requestBatchMigrateResourcesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

A Task containing the RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = await MigrationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchMigrateResourcesRequest request = new BatchMigrateResourcesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    MigrateResourceRequests =
    {
        new MigrateResourceRequest(),
    },
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = await migrationServiceClient.BatchMigrateResourcesAsync(request);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = await migrationServiceClient.PollOnceBatchMigrateResourcesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResourcesAsync(BatchMigrateResourcesRequest, CancellationToken)

public virtual Task<Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>> BatchMigrateResourcesAsync(BatchMigrateResourcesRequest request, CancellationToken cancellationToken)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
requestBatchMigrateResourcesRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

A Task containing the RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = await MigrationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchMigrateResourcesRequest request = new BatchMigrateResourcesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    MigrateResourceRequests =
    {
        new MigrateResourceRequest(),
    },
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = await migrationServiceClient.BatchMigrateResourcesAsync(request);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = await migrationServiceClient.PollOnceBatchMigrateResourcesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResourcesAsync(string, IEnumerable<MigrateResourceRequest>, CallSettings)

public virtual Task<Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>> BatchMigrateResourcesAsync(string parent, IEnumerable<MigrateResourceRequest> migrateResourceRequests, CallSettings callSettings = null)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
parentstring

Required. The location of the migrated resource will live in. Format: projects/{project}/locations/{location}

migrateResourceRequestsIEnumerableMigrateResourceRequest

Required. The request messages specifying the resources to migrate. They must be in the same location as the destination. Up to 50 resources can be migrated in one batch.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

A Task containing the RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = await MigrationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<MigrateResourceRequest> migrateResourceRequests = new MigrateResourceRequest[]
{
    new MigrateResourceRequest(),
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = await migrationServiceClient.BatchMigrateResourcesAsync(parent, migrateResourceRequests);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = await migrationServiceClient.PollOnceBatchMigrateResourcesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

BatchMigrateResourcesAsync(string, IEnumerable<MigrateResourceRequest>, CancellationToken)

public virtual Task<Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>> BatchMigrateResourcesAsync(string parent, IEnumerable<MigrateResourceRequest> migrateResourceRequests, CancellationToken cancellationToken)

Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and datalabeling.googleapis.com to Vertex AI.

Parameters
NameDescription
parentstring

Required. The location of the migrated resource will live in. Format: projects/{project}/locations/{location}

migrateResourceRequestsIEnumerableMigrateResourceRequest

Required. The request messages specifying the resources to migrate. They must be in the same location as the destination. Up to 50 resources can be migrated in one batch.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationBatchMigrateResourcesResponseBatchMigrateResourcesOperationMetadata

A Task containing the RPC response.

Example
// Create client
MigrationServiceClient migrationServiceClient = await MigrationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<MigrateResourceRequest> migrateResourceRequests = new MigrateResourceRequest[]
{
    new MigrateResourceRequest(),
};
// Make the request
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> response = await migrationServiceClient.BatchMigrateResourcesAsync(parent, migrateResourceRequests);

// Poll until the returned long-running operation is complete
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchMigrateResourcesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> retrievedResponse = await migrationServiceClient.PollOnceBatchMigrateResourcesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    BatchMigrateResourcesResponse retrievedResult = retrievedResponse.Result;
}

Create()

public static MigrationServiceClient Create()

Synchronously creates a MigrationServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use MigrationServiceClientBuilder.

Returns
TypeDescription
MigrationServiceClient

The created MigrationServiceClient.

CreateAsync(CancellationToken)

public static Task<MigrationServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a MigrationServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use MigrationServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskMigrationServiceClient

The task representing the created MigrationServiceClient.

PollOnceBatchMigrateResources(string, CallSettings)

public virtual Operation<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> PollOnceBatchMigrateResources(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of BatchMigrateResources .

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettings