xref: /aosp_15_r20/external/googleapis/google/cloud/bigquery/migration/v2/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.bigquery.migration.v2;
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/bigquery/migration/v2/migration_entities.proto";
24import "google/protobuf/empty.proto";
25import "google/protobuf/field_mask.proto";
26
27option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2";
28option go_package = "cloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpb";
29option java_multiple_files = true;
30option java_outer_classname = "MigrationServiceProto";
31option java_package = "com.google.cloud.bigquery.migration.v2";
32option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";
33
34// Service to handle EDW migrations.
35service MigrationService {
36  option (google.api.default_host) = "bigquerymigration.googleapis.com";
37  option (google.api.oauth_scopes) =
38      "https://www.googleapis.com/auth/cloud-platform";
39
40  // Creates a migration workflow.
41  rpc CreateMigrationWorkflow(CreateMigrationWorkflowRequest)
42      returns (MigrationWorkflow) {
43    option (google.api.http) = {
44      post: "/v2/{parent=projects/*/locations/*}/workflows"
45      body: "migration_workflow"
46    };
47    option (google.api.method_signature) = "parent,migration_workflow";
48  }
49
50  // Gets a previously created migration workflow.
51  rpc GetMigrationWorkflow(GetMigrationWorkflowRequest)
52      returns (MigrationWorkflow) {
53    option (google.api.http) = {
54      get: "/v2/{name=projects/*/locations/*/workflows/*}"
55    };
56    option (google.api.method_signature) = "name";
57  }
58
59  // Lists previously created migration workflow.
60  rpc ListMigrationWorkflows(ListMigrationWorkflowsRequest)
61      returns (ListMigrationWorkflowsResponse) {
62    option (google.api.http) = {
63      get: "/v2/{parent=projects/*/locations/*}/workflows"
64    };
65    option (google.api.method_signature) = "parent";
66  }
67
68  // Deletes a migration workflow by name.
69  rpc DeleteMigrationWorkflow(DeleteMigrationWorkflowRequest)
70      returns (google.protobuf.Empty) {
71    option (google.api.http) = {
72      delete: "/v2/{name=projects/*/locations/*/workflows/*}"
73    };
74    option (google.api.method_signature) = "name";
75  }
76
77  // Starts a previously created migration workflow. I.e., the state transitions
78  // from DRAFT to RUNNING. This is a no-op if the state is already RUNNING.
79  // An error will be signaled if the state is anything other than DRAFT or
80  // RUNNING.
81  rpc StartMigrationWorkflow(StartMigrationWorkflowRequest)
82      returns (google.protobuf.Empty) {
83    option (google.api.http) = {
84      post: "/v2/{name=projects/*/locations/*/workflows/*}:start"
85      body: "*"
86    };
87    option (google.api.method_signature) = "name";
88  }
89
90  // Gets a previously created migration subtask.
91  rpc GetMigrationSubtask(GetMigrationSubtaskRequest)
92      returns (MigrationSubtask) {
93    option (google.api.http) = {
94      get: "/v2/{name=projects/*/locations/*/workflows/*/subtasks/*}"
95    };
96    option (google.api.method_signature) = "name";
97  }
98
99  // Lists previously created migration subtasks.
100  rpc ListMigrationSubtasks(ListMigrationSubtasksRequest)
101      returns (ListMigrationSubtasksResponse) {
102    option (google.api.http) = {
103      get: "/v2/{parent=projects/*/locations/*/workflows/*}/subtasks"
104    };
105    option (google.api.method_signature) = "parent";
106  }
107}
108
109// Request to create a migration workflow resource.
110message CreateMigrationWorkflowRequest {
111  // Required. The name of the project to which this migration workflow belongs.
112  // Example: `projects/foo/locations/bar`
113  string parent = 1 [
114    (google.api.field_behavior) = REQUIRED,
115    (google.api.resource_reference) = {
116      type: "locations.googleapis.com/Location"
117    }
118  ];
119
120  // Required. The migration workflow to create.
121  MigrationWorkflow migration_workflow = 2
122      [(google.api.field_behavior) = REQUIRED];
123}
124
125// A request to get a previously created migration workflow.
126message GetMigrationWorkflowRequest {
127  // Required. The unique identifier for the migration workflow.
128  // Example: `projects/123/locations/us/workflows/1234`
129  string name = 1 [
130    (google.api.field_behavior) = REQUIRED,
131    (google.api.resource_reference) = {
132      type: "bigquerymigration.googleapis.com/MigrationWorkflow"
133    }
134  ];
135
136  // The list of fields to be retrieved.
137  google.protobuf.FieldMask read_mask = 2;
138}
139
140// A request to list previously created migration workflows.
141message ListMigrationWorkflowsRequest {
142  // Required. The project and location of the migration workflows to list.
143  // Example: `projects/123/locations/us`
144  string parent = 1 [
145    (google.api.field_behavior) = REQUIRED,
146    (google.api.resource_reference) = {
147      type: "locations.googleapis.com/Location"
148    }
149  ];
150
151  // The list of fields to be retrieved.
152  google.protobuf.FieldMask read_mask = 2;
153
154  // The maximum number of migration workflows to return. The service may return
155  // fewer than this number.
156  int32 page_size = 3;
157
158  // A page token, received from previous `ListMigrationWorkflows` call.
159  // Provide this to retrieve the subsequent page.
160  //
161  // When paginating, all other parameters provided to `ListMigrationWorkflows`
162  // must match the call that provided the page token.
163  string page_token = 4;
164}
165
166// Response object for a `ListMigrationWorkflows` call.
167message ListMigrationWorkflowsResponse {
168  // The migration workflows for the specified project / location.
169  repeated MigrationWorkflow migration_workflows = 1;
170
171  // A token, which can be sent as `page_token` to retrieve the next page.
172  // If this field is omitted, there are no subsequent pages.
173  string next_page_token = 2;
174}
175
176// A request to delete a previously created migration workflow.
177message DeleteMigrationWorkflowRequest {
178  // Required. The unique identifier for the migration workflow.
179  // Example: `projects/123/locations/us/workflows/1234`
180  string name = 1 [
181    (google.api.field_behavior) = REQUIRED,
182    (google.api.resource_reference) = {
183      type: "bigquerymigration.googleapis.com/MigrationWorkflow"
184    }
185  ];
186}
187
188// A request to start a previously created migration workflow.
189message StartMigrationWorkflowRequest {
190  // Required. The unique identifier for the migration workflow.
191  // Example: `projects/123/locations/us/workflows/1234`
192  string name = 1 [
193    (google.api.field_behavior) = REQUIRED,
194    (google.api.resource_reference) = {
195      type: "bigquerymigration.googleapis.com/MigrationWorkflow"
196    }
197  ];
198}
199
200// A request to get a previously created migration subtasks.
201message GetMigrationSubtaskRequest {
202  // Required. The unique identifier for the migration subtask.
203  // Example: `projects/123/locations/us/workflows/1234/subtasks/543`
204  string name = 1 [
205    (google.api.field_behavior) = REQUIRED,
206    (google.api.resource_reference) = {
207      type: "bigquerymigration.googleapis.com/MigrationSubtask"
208    }
209  ];
210
211  // Optional. The list of fields to be retrieved.
212  google.protobuf.FieldMask read_mask = 2
213      [(google.api.field_behavior) = OPTIONAL];
214}
215
216// A request to list previously created migration subtasks.
217message ListMigrationSubtasksRequest {
218  // Required. The migration task of the subtasks to list.
219  // Example: `projects/123/locations/us/workflows/1234`
220  string parent = 1 [
221    (google.api.field_behavior) = REQUIRED,
222    (google.api.resource_reference) = {
223      type: "bigquerymigration.googleapis.com/MigrationWorkflow"
224    }
225  ];
226
227  // Optional. The list of fields to be retrieved.
228  google.protobuf.FieldMask read_mask = 2
229      [(google.api.field_behavior) = OPTIONAL];
230
231  // Optional. The maximum number of migration tasks to return. The service may
232  // return fewer than this number.
233  int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
234
235  // Optional. A page token, received from previous `ListMigrationSubtasks`
236  // call. Provide this to retrieve the subsequent page.
237  //
238  // When paginating, all other parameters provided to `ListMigrationSubtasks`
239  // must match the call that provided the page token.
240  string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
241
242  // Optional. The filter to apply. This can be used to get the subtasks of a
243  // specific tasks in a workflow, e.g. `migration_task = "ab012"` where
244  // `"ab012"` is the task ID (not the name in the named map).
245  string filter = 5 [(google.api.field_behavior) = OPTIONAL];
246}
247
248// Response object for a `ListMigrationSubtasks` call.
249message ListMigrationSubtasksResponse {
250  // The migration subtasks for the specified task.
251  repeated MigrationSubtask migration_subtasks = 1;
252
253  // A token, which can be sent as `page_token` to retrieve the next page.
254  // If this field is omitted, there are no subsequent pages.
255  string next_page_token = 2;
256}
257