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.v1; 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/v1/migratable_resource.proto"; 24import "google/cloud/aiplatform/v1/operation.proto"; 25import "google/longrunning/operations.proto"; 26import "google/rpc/status.proto"; 27 28option csharp_namespace = "Google.Cloud.AIPlatform.V1"; 29option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; 30option java_multiple_files = true; 31option java_outer_classname = "MigrationServiceProto"; 32option java_package = "com.google.cloud.aiplatform.v1"; 33option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; 34option ruby_package = "Google::Cloud::AIPlatform::V1"; 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: "/v1/{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: "/v1/{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.v1.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 [MigratableResource][google.cloud.aiplatform.v1.MigratableResource]: 96 // * `ml_engine_model_version:*` 97 // * `automl_model:*` 98 // * `automl_dataset:*` 99 // * `data_labeling_dataset:*` 100 // * "Migrated or not" filters. The following strings filter for resources 101 // that either have or have not already been migrated: 102 // * `last_migrate_time:*` filters for migrated resources. 103 // * `NOT last_migrate_time:*` filters for not yet migrated resources. 104 string filter = 4; 105} 106 107// Response message for 108// [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1.MigrationService.SearchMigratableResources]. 109message SearchMigratableResourcesResponse { 110 // All migratable resources that can be migrated to the 111 // location specified in the request. 112 repeated MigratableResource migratable_resources = 1; 113 114 // The standard next-page token. 115 // The migratable_resources may not fill page_size in 116 // SearchMigratableResourcesRequest even when there are subsequent pages. 117 string next_page_token = 2; 118} 119 120// Request message for 121// [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. 122message BatchMigrateResourcesRequest { 123 // Required. The location of the migrated resource will live in. 124 // Format: `projects/{project}/locations/{location}` 125 string parent = 1 [ 126 (google.api.field_behavior) = REQUIRED, 127 (google.api.resource_reference) = { 128 type: "locations.googleapis.com/Location" 129 } 130 ]; 131 132 // Required. The request messages specifying the resources to migrate. 133 // They must be in the same location as the destination. 134 // Up to 50 resources can be migrated in one batch. 135 repeated MigrateResourceRequest migrate_resource_requests = 2 136 [(google.api.field_behavior) = REQUIRED]; 137} 138 139// Config of migrating one resource from automl.googleapis.com, 140// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. 141message MigrateResourceRequest { 142 // Config for migrating version in ml.googleapis.com to Vertex AI's Model. 143 message MigrateMlEngineModelVersionConfig { 144 // Required. The ml.googleapis.com endpoint that this model version should 145 // be migrated from. Example values: 146 // 147 // * ml.googleapis.com 148 // 149 // * us-centrall-ml.googleapis.com 150 // 151 // * europe-west4-ml.googleapis.com 152 // 153 // * asia-east1-ml.googleapis.com 154 string endpoint = 1 [(google.api.field_behavior) = REQUIRED]; 155 156 // Required. Full resource name of ml engine model version. 157 // Format: `projects/{project}/models/{model}/versions/{version}`. 158 string model_version = 2 [ 159 (google.api.field_behavior) = REQUIRED, 160 (google.api.resource_reference) = { type: "ml.googleapis.com/Version" } 161 ]; 162 163 // Required. Display name of the model in Vertex AI. 164 // System will pick a display name if unspecified. 165 string model_display_name = 3 [(google.api.field_behavior) = REQUIRED]; 166 } 167 168 // Config for migrating Model in automl.googleapis.com to Vertex AI's Model. 169 message MigrateAutomlModelConfig { 170 // Required. Full resource name of automl Model. 171 // Format: 172 // `projects/{project}/locations/{location}/models/{model}`. 173 string model = 1 [ 174 (google.api.field_behavior) = REQUIRED, 175 (google.api.resource_reference) = { type: "automl.googleapis.com/Model" } 176 ]; 177 178 // Optional. Display name of the model in Vertex AI. 179 // System will pick a display name if unspecified. 180 string model_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; 181 } 182 183 // Config for migrating Dataset in automl.googleapis.com to Vertex AI's 184 // Dataset. 185 message MigrateAutomlDatasetConfig { 186 // Required. Full resource name of automl Dataset. 187 // Format: 188 // `projects/{project}/locations/{location}/datasets/{dataset}`. 189 string dataset = 1 [ 190 (google.api.field_behavior) = REQUIRED, 191 (google.api.resource_reference) = { 192 type: "automl.googleapis.com/Dataset" 193 } 194 ]; 195 196 // Required. Display name of the Dataset in Vertex AI. 197 // System will pick a display name if unspecified. 198 string dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; 199 } 200 201 // Config for migrating Dataset in datalabeling.googleapis.com to Vertex 202 // AI's Dataset. 203 message MigrateDataLabelingDatasetConfig { 204 // Config for migrating AnnotatedDataset in datalabeling.googleapis.com to 205 // Vertex AI's SavedQuery. 206 message MigrateDataLabelingAnnotatedDatasetConfig { 207 // Required. Full resource name of data labeling AnnotatedDataset. 208 // Format: 209 // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. 210 string annotated_dataset = 1 [ 211 (google.api.field_behavior) = REQUIRED, 212 (google.api.resource_reference) = { 213 type: "datalabeling.googleapis.com/AnnotatedDataset" 214 } 215 ]; 216 } 217 218 // Required. Full resource name of data labeling Dataset. 219 // Format: 220 // `projects/{project}/datasets/{dataset}`. 221 string dataset = 1 [ 222 (google.api.field_behavior) = REQUIRED, 223 (google.api.resource_reference) = { 224 type: "datalabeling.googleapis.com/Dataset" 225 } 226 ]; 227 228 // Optional. Display name of the Dataset in Vertex AI. 229 // System will pick a display name if unspecified. 230 string dataset_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; 231 232 // Optional. Configs for migrating AnnotatedDataset in 233 // datalabeling.googleapis.com to Vertex AI's SavedQuery. The specified 234 // AnnotatedDatasets have to belong to the datalabeling Dataset. 235 repeated MigrateDataLabelingAnnotatedDatasetConfig 236 migrate_data_labeling_annotated_dataset_configs = 3 237 [(google.api.field_behavior) = OPTIONAL]; 238 } 239 240 oneof request { 241 // Config for migrating Version in ml.googleapis.com to Vertex AI's Model. 242 MigrateMlEngineModelVersionConfig migrate_ml_engine_model_version_config = 243 1; 244 245 // Config for migrating Model in automl.googleapis.com to Vertex AI's 246 // Model. 247 MigrateAutomlModelConfig migrate_automl_model_config = 2; 248 249 // Config for migrating Dataset in automl.googleapis.com to Vertex AI's 250 // Dataset. 251 MigrateAutomlDatasetConfig migrate_automl_dataset_config = 3; 252 253 // Config for migrating Dataset in datalabeling.googleapis.com to 254 // Vertex AI's Dataset. 255 MigrateDataLabelingDatasetConfig migrate_data_labeling_dataset_config = 4; 256 } 257} 258 259// Response message for 260// [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. 261message BatchMigrateResourcesResponse { 262 // Successfully migrated resources. 263 repeated MigrateResourceResponse migrate_resource_responses = 1; 264} 265 266// Describes a successfully migrated resource. 267message MigrateResourceResponse { 268 // After migration, the resource name in Vertex AI. 269 oneof migrated_resource { 270 // Migrated Dataset's resource name. 271 string dataset = 1 [(google.api.resource_reference) = { 272 type: "aiplatform.googleapis.com/Dataset" 273 }]; 274 275 // Migrated Model's resource name. 276 string model = 2 [(google.api.resource_reference) = { 277 type: "aiplatform.googleapis.com/Model" 278 }]; 279 } 280 281 // Before migration, the identifier in ml.googleapis.com, 282 // automl.googleapis.com or datalabeling.googleapis.com. 283 MigratableResource migratable_resource = 3; 284} 285 286// Runtime operation information for 287// [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. 288message BatchMigrateResourcesOperationMetadata { 289 // Represents a partial result in batch migration operation for one 290 // [MigrateResourceRequest][google.cloud.aiplatform.v1.MigrateResourceRequest]. 291 message PartialResult { 292 // If the resource's migration is ongoing, none of the result will be set. 293 // If the resource's migration is finished, either error or one of the 294 // migrated resource name will be filled. 295 oneof result { 296 // The error result of the migration request in case of failure. 297 google.rpc.Status error = 2; 298 299 // Migrated model resource name. 300 string model = 3 [(google.api.resource_reference) = { 301 type: "aiplatform.googleapis.com/Model" 302 }]; 303 304 // Migrated dataset resource name. 305 string dataset = 4 [(google.api.resource_reference) = { 306 type: "aiplatform.googleapis.com/Dataset" 307 }]; 308 } 309 310 // It's the same as the value in 311 // [MigrateResourceRequest.migrate_resource_requests][]. 312 MigrateResourceRequest request = 1; 313 } 314 315 // The common part of the operation metadata. 316 GenericOperationMetadata generic_metadata = 1; 317 318 // Partial results that reflect the latest migration operation progress. 319 repeated PartialResult partial_results = 2; 320} 321