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