xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1beta1/migration_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1beta1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/aiplatform/v1beta1/migratable_resource.proto";
24import "google/cloud/aiplatform/v1beta1/operation.proto";
25import "google/longrunning/operations.proto";
26import "google/rpc/status.proto";
27
28option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
29option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
30option java_multiple_files = true;
31option java_outer_classname = "MigrationServiceProto";
32option java_package = "com.google.cloud.aiplatform.v1beta1";
33option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
34option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
35
36// A service that migrates resources from automl.googleapis.com,
37// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.
38service MigrationService {
39  option (google.api.default_host) = "aiplatform.googleapis.com";
40  option (google.api.oauth_scopes) =
41      "https://www.googleapis.com/auth/cloud-platform";
42
43  // Searches all of the resources in automl.googleapis.com,
44  // datalabeling.googleapis.com and ml.googleapis.com that can be migrated to
45  // Vertex AI's given location.
46  rpc SearchMigratableResources(SearchMigratableResourcesRequest)
47      returns (SearchMigratableResourcesResponse) {
48    option (google.api.http) = {
49      post: "/v1beta1/{parent=projects/*/locations/*}/migratableResources:search"
50      body: "*"
51    };
52    option (google.api.method_signature) = "parent";
53  }
54
55  // Batch migrates resources from ml.googleapis.com, automl.googleapis.com,
56  // and datalabeling.googleapis.com to Vertex AI.
57  rpc BatchMigrateResources(BatchMigrateResourcesRequest)
58      returns (google.longrunning.Operation) {
59    option (google.api.http) = {
60      post: "/v1beta1/{parent=projects/*/locations/*}/migratableResources:batchMigrate"
61      body: "*"
62    };
63    option (google.api.method_signature) = "parent,migrate_resource_requests";
64    option (google.longrunning.operation_info) = {
65      response_type: "BatchMigrateResourcesResponse"
66      metadata_type: "BatchMigrateResourcesOperationMetadata"
67    };
68  }
69}
70
71// Request message for
72// [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1beta1.MigrationService.SearchMigratableResources].
73message SearchMigratableResourcesRequest {
74  // Required. The location that the migratable resources should be searched
75  // from. It's the Vertex AI location that the resources can be migrated to,
76  // not the resources' original location. Format:
77  // `projects/{project}/locations/{location}`
78  string parent = 1 [
79    (google.api.field_behavior) = REQUIRED,
80    (google.api.resource_reference) = {
81      type: "locations.googleapis.com/Location"
82    }
83  ];
84
85  // The standard page size.
86  // The default and maximum value is 100.
87  int32 page_size = 2;
88
89  // The standard page token.
90  string page_token = 3;
91
92  // A filter for your search. You can use the following types of filters:
93  //
94  // *   Resource type filters. The following strings filter for a specific type
95  //     of
96  //     [MigratableResource][google.cloud.aiplatform.v1beta1.MigratableResource]:
97  //     *   `ml_engine_model_version:*`
98  //     *   `automl_model:*`
99  //     *   `automl_dataset:*`
100  //     *   `data_labeling_dataset:*`
101  // *   "Migrated or not" filters. The following strings filter for resources
102  //     that either have or have not already been migrated:
103  //     *   `last_migrate_time:*` filters for migrated resources.
104  //     *   `NOT last_migrate_time:*` filters for not yet migrated resources.
105  string filter = 4;
106}
107
108// Response message for
109// [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1beta1.MigrationService.SearchMigratableResources].
110message SearchMigratableResourcesResponse {
111  // All migratable resources that can be migrated to the
112  // location specified in the request.
113  repeated MigratableResource migratable_resources = 1;
114
115  // The standard next-page token.
116  // The migratable_resources may not fill page_size in
117  // SearchMigratableResourcesRequest even when there are subsequent pages.
118  string next_page_token = 2;
119}
120
121// Request message for
122// [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources].
123message BatchMigrateResourcesRequest {
124  // Required. The location of the migrated resource will live in.
125  // Format: `projects/{project}/locations/{location}`
126  string parent = 1 [
127    (google.api.field_behavior) = REQUIRED,
128    (google.api.resource_reference) = {
129      type: "locations.googleapis.com/Location"
130    }
131  ];
132
133  // Required. The request messages specifying the resources to migrate.
134  // They must be in the same location as the destination.
135  // Up to 50 resources can be migrated in one batch.
136  repeated MigrateResourceRequest migrate_resource_requests = 2
137      [(google.api.field_behavior) = REQUIRED];
138}
139
140// Config of migrating one resource from automl.googleapis.com,
141// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.
142message MigrateResourceRequest {
143  // Config for migrating version in ml.googleapis.com to Vertex AI's Model.
144  message MigrateMlEngineModelVersionConfig {
145    // Required. The ml.googleapis.com endpoint that this model version should
146    // be migrated from. Example values:
147    //
148    // * ml.googleapis.com
149    //
150    // * us-centrall-ml.googleapis.com
151    //
152    // * europe-west4-ml.googleapis.com
153    //
154    // * asia-east1-ml.googleapis.com
155    string endpoint = 1 [(google.api.field_behavior) = REQUIRED];
156
157    // Required. Full resource name of ml engine model version.
158    // Format: `projects/{project}/models/{model}/versions/{version}`.
159    string model_version = 2 [
160      (google.api.field_behavior) = REQUIRED,
161      (google.api.resource_reference) = { type: "ml.googleapis.com/Version" }
162    ];
163
164    // Required. Display name of the model in Vertex AI.
165    // System will pick a display name if unspecified.
166    string model_display_name = 3 [(google.api.field_behavior) = REQUIRED];
167  }
168
169  // Config for migrating Model in automl.googleapis.com to Vertex AI's Model.
170  message MigrateAutomlModelConfig {
171    // Required. Full resource name of automl Model.
172    // Format:
173    // `projects/{project}/locations/{location}/models/{model}`.
174    string model = 1 [
175      (google.api.field_behavior) = REQUIRED,
176      (google.api.resource_reference) = { type: "automl.googleapis.com/Model" }
177    ];
178
179    // Optional. Display name of the model in Vertex AI.
180    // System will pick a display name if unspecified.
181    string model_display_name = 2 [(google.api.field_behavior) = OPTIONAL];
182  }
183
184  // Config for migrating Dataset in automl.googleapis.com to Vertex AI's
185  // Dataset.
186  message MigrateAutomlDatasetConfig {
187    // Required. Full resource name of automl Dataset.
188    // Format:
189    // `projects/{project}/locations/{location}/datasets/{dataset}`.
190    string dataset = 1 [
191      (google.api.field_behavior) = REQUIRED,
192      (google.api.resource_reference) = {
193        type: "automl.googleapis.com/Dataset"
194      }
195    ];
196
197    // Required. Display name of the Dataset in Vertex AI.
198    // System will pick a display name if unspecified.
199    string dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED];
200  }
201
202  // Config for migrating Dataset in datalabeling.googleapis.com to Vertex
203  // AI's Dataset.
204  message MigrateDataLabelingDatasetConfig {
205    // Config for migrating AnnotatedDataset in datalabeling.googleapis.com to
206    // Vertex AI's SavedQuery.
207    message MigrateDataLabelingAnnotatedDatasetConfig {
208      // Required. Full resource name of data labeling AnnotatedDataset.
209      // Format:
210      // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`.
211      string annotated_dataset = 1 [
212        (google.api.field_behavior) = REQUIRED,
213        (google.api.resource_reference) = {
214          type: "datalabeling.googleapis.com/AnnotatedDataset"
215        }
216      ];
217    }
218
219    // Required. Full resource name of data labeling Dataset.
220    // Format:
221    // `projects/{project}/datasets/{dataset}`.
222    string dataset = 1 [
223      (google.api.field_behavior) = REQUIRED,
224      (google.api.resource_reference) = {
225        type: "datalabeling.googleapis.com/Dataset"
226      }
227    ];
228
229    // Optional. Display name of the Dataset in Vertex AI.
230    // System will pick a display name if unspecified.
231    string dataset_display_name = 2 [(google.api.field_behavior) = OPTIONAL];
232
233    // Optional. Configs for migrating AnnotatedDataset in
234    // datalabeling.googleapis.com to Vertex AI's SavedQuery. The specified
235    // AnnotatedDatasets have to belong to the datalabeling Dataset.
236    repeated MigrateDataLabelingAnnotatedDatasetConfig
237        migrate_data_labeling_annotated_dataset_configs = 3
238        [(google.api.field_behavior) = OPTIONAL];
239  }
240
241  oneof request {
242    // Config for migrating Version in ml.googleapis.com to Vertex AI's Model.
243    MigrateMlEngineModelVersionConfig migrate_ml_engine_model_version_config =
244        1;
245
246    // Config for migrating Model in automl.googleapis.com to Vertex AI's
247    // Model.
248    MigrateAutomlModelConfig migrate_automl_model_config = 2;
249
250    // Config for migrating Dataset in automl.googleapis.com to Vertex AI's
251    // Dataset.
252    MigrateAutomlDatasetConfig migrate_automl_dataset_config = 3;
253
254    // Config for migrating Dataset in datalabeling.googleapis.com to
255    // Vertex AI's Dataset.
256    MigrateDataLabelingDatasetConfig migrate_data_labeling_dataset_config = 4;
257  }
258}
259
260// Response message for
261// [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources].
262message BatchMigrateResourcesResponse {
263  // Successfully migrated resources.
264  repeated MigrateResourceResponse migrate_resource_responses = 1;
265}
266
267// Describes a successfully migrated resource.
268message MigrateResourceResponse {
269  // After migration, the resource name in Vertex AI.
270  oneof migrated_resource {
271    // Migrated Dataset's resource name.
272    string dataset = 1 [(google.api.resource_reference) = {
273      type: "aiplatform.googleapis.com/Dataset"
274    }];
275
276    // Migrated Model's resource name.
277    string model = 2 [(google.api.resource_reference) = {
278      type: "aiplatform.googleapis.com/Model"
279    }];
280  }
281
282  // Before migration, the identifier in ml.googleapis.com,
283  // automl.googleapis.com or datalabeling.googleapis.com.
284  MigratableResource migratable_resource = 3;
285}
286
287// Runtime operation information for
288// [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources].
289message BatchMigrateResourcesOperationMetadata {
290  // Represents a partial result in batch migration operation for one
291  // [MigrateResourceRequest][google.cloud.aiplatform.v1beta1.MigrateResourceRequest].
292  message PartialResult {
293    // If the resource's migration is ongoing, none of the result will be set.
294    // If the resource's migration is finished, either error or one of the
295    // migrated resource name will be filled.
296    oneof result {
297      // The error result of the migration request in case of failure.
298      google.rpc.Status error = 2;
299
300      // Migrated model resource name.
301      string model = 3 [(google.api.resource_reference) = {
302        type: "aiplatform.googleapis.com/Model"
303      }];
304
305      // Migrated dataset resource name.
306      string dataset = 4 [(google.api.resource_reference) = {
307        type: "aiplatform.googleapis.com/Dataset"
308      }];
309    }
310
311    // It's the same as the value in
312    // [MigrateResourceRequest.migrate_resource_requests][].
313    MigrateResourceRequest request = 1;
314  }
315
316  // The common part of the operation metadata.
317  GenericOperationMetadata generic_metadata = 1;
318
319  // Partial results that reflect the latest migration operation progress.
320  repeated PartialResult partial_results = 2;
321}
322