Skip to content

Commit 184334d

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add request_source field and update formatting
PiperOrigin-RevId: 518330942
1 parent ed556a1 commit 184334d

5 files changed

Lines changed: 69 additions & 44 deletions

File tree

google/cloud/bigquery/migration/v2/migration_entities.proto

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -135,7 +135,8 @@ message MigrationTask {
135135
// Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
136136
// Translation_Snowflake2BQ, Translation_Netezza2BQ,
137137
// Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
138-
// Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ.
138+
// Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ,
139+
// Translation_Postgresql2BQ.
139140
string type = 2;
140141

141142
// Output only. The current state of the task.
@@ -182,6 +183,10 @@ message MigrationSubtask {
182183
// The subtask is paused, i.e., it will not be scheduled. If it was already
183184
// assigned,it might still finish but no new lease renewals will be granted.
184185
PAUSED = 5;
186+
187+
// The subtask is pending a dependency. It will be scheduled once its
188+
// dependencies are done.
189+
PENDING_DEPENDENCY = 6;
185190
}
186191

187192
// Output only. Immutable. The resource name for the migration subtask. The ID

google/cloud/bigquery/migration/v2/migration_error_details.proto

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -29,13 +29,15 @@ option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";
2929
// Provides details for errors and the corresponding resources.
3030
message ResourceErrorDetail {
3131
// Required. Information about the resource where the error is located.
32-
google.rpc.ResourceInfo resource_info = 1 [(google.api.field_behavior) = REQUIRED];
32+
google.rpc.ResourceInfo resource_info = 1
33+
[(google.api.field_behavior) = REQUIRED];
3334

3435
// Required. The error details for the resource.
35-
repeated ErrorDetail error_details = 2 [(google.api.field_behavior) = REQUIRED];
36+
repeated ErrorDetail error_details = 2
37+
[(google.api.field_behavior) = REQUIRED];
3638

37-
// Required. How many errors there are in total for the resource. Truncation can be
38-
// indicated by having an `error_count` that is higher than the size of
39+
// Required. How many errors there are in total for the resource. Truncation
40+
// can be indicated by having an `error_count` that is higher than the size of
3941
// `error_details`.
4042
int32 error_count = 3 [(google.api.field_behavior) = REQUIRED];
4143
}
@@ -52,11 +54,11 @@ message ErrorDetail {
5254

5355
// Holds information about where the error is located.
5456
message ErrorLocation {
55-
// Optional. If applicable, denotes the line where the error occurred. A zero value
56-
// means that there is no line information.
57+
// Optional. If applicable, denotes the line where the error occurred. A zero
58+
// value means that there is no line information.
5759
int32 line = 1 [(google.api.field_behavior) = OPTIONAL];
5860

59-
// Optional. If applicable, denotes the column where the error occurred. A zero value
60-
// means that there is no columns information.
61+
// Optional. If applicable, denotes the column where the error occurred. A
62+
// zero value means that there is no columns information.
6163
int32 column = 2 [(google.api.field_behavior) = OPTIONAL];
6264
}

google/cloud/bigquery/migration/v2/migration_metrics.proto

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -36,18 +36,20 @@ message TimeSeries {
3636
string metric = 1 [(google.api.field_behavior) = REQUIRED];
3737

3838
// Required. The value type of the time series.
39-
google.api.MetricDescriptor.ValueType value_type = 2 [(google.api.field_behavior) = REQUIRED];
39+
google.api.MetricDescriptor.ValueType value_type = 2
40+
[(google.api.field_behavior) = REQUIRED];
4041

4142
// Optional. The metric kind of the time series.
4243
//
4344
// If present, it must be the same as the metric kind of the associated
4445
// metric. If the associated metric's descriptor must be auto-created, then
4546
// this field specifies the metric kind of the new descriptor and must be
4647
// either `GAUGE` (the default) or `CUMULATIVE`.
47-
google.api.MetricDescriptor.MetricKind metric_kind = 3 [(google.api.field_behavior) = OPTIONAL];
48+
google.api.MetricDescriptor.MetricKind metric_kind = 3
49+
[(google.api.field_behavior) = OPTIONAL];
4850

49-
// Required. The data points of this time series. When listing time series, points are
50-
// returned in reverse time order.
51+
// Required. The data points of this time series. When listing time series,
52+
// points are returned in reverse time order.
5153
//
5254
// When creating a time series, this field must contain exactly one point and
5355
// the point's type must be the same as the value type of the associated
@@ -81,10 +83,12 @@ message TimeInterval {
8183
// Optional. The beginning of the time interval. The default value
8284
// for the start time is the end time. The start time must not be
8385
// later than the end time.
84-
google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OPTIONAL];
86+
google.protobuf.Timestamp start_time = 1
87+
[(google.api.field_behavior) = OPTIONAL];
8588

8689
// Required. The end of the time interval.
87-
google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED];
90+
google.protobuf.Timestamp end_time = 2
91+
[(google.api.field_behavior) = REQUIRED];
8892
}
8993

9094
// A single strongly-typed value.

google/cloud/bigquery/migration/v2/migration_service.proto

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -34,10 +34,12 @@ option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";
3434
// Service to handle EDW migrations.
3535
service MigrationService {
3636
option (google.api.default_host) = "bigquerymigration.googleapis.com";
37-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
37+
option (google.api.oauth_scopes) =
38+
"https://www.googleapis.com/auth/cloud-platform";
3839

3940
// Creates a migration workflow.
40-
rpc CreateMigrationWorkflow(CreateMigrationWorkflowRequest) returns (MigrationWorkflow) {
41+
rpc CreateMigrationWorkflow(CreateMigrationWorkflowRequest)
42+
returns (MigrationWorkflow) {
4143
option (google.api.http) = {
4244
post: "/v2/{parent=projects/*/locations/*}/workflows"
4345
body: "migration_workflow"
@@ -46,23 +48,26 @@ service MigrationService {
4648
}
4749

4850
// Gets a previously created migration workflow.
49-
rpc GetMigrationWorkflow(GetMigrationWorkflowRequest) returns (MigrationWorkflow) {
51+
rpc GetMigrationWorkflow(GetMigrationWorkflowRequest)
52+
returns (MigrationWorkflow) {
5053
option (google.api.http) = {
5154
get: "/v2/{name=projects/*/locations/*/workflows/*}"
5255
};
5356
option (google.api.method_signature) = "name";
5457
}
5558

5659
// Lists previously created migration workflow.
57-
rpc ListMigrationWorkflows(ListMigrationWorkflowsRequest) returns (ListMigrationWorkflowsResponse) {
60+
rpc ListMigrationWorkflows(ListMigrationWorkflowsRequest)
61+
returns (ListMigrationWorkflowsResponse) {
5862
option (google.api.http) = {
5963
get: "/v2/{parent=projects/*/locations/*}/workflows"
6064
};
6165
option (google.api.method_signature) = "parent";
6266
}
6367

6468
// Deletes a migration workflow by name.
65-
rpc DeleteMigrationWorkflow(DeleteMigrationWorkflowRequest) returns (google.protobuf.Empty) {
69+
rpc DeleteMigrationWorkflow(DeleteMigrationWorkflowRequest)
70+
returns (google.protobuf.Empty) {
6671
option (google.api.http) = {
6772
delete: "/v2/{name=projects/*/locations/*/workflows/*}"
6873
};
@@ -73,7 +78,8 @@ service MigrationService {
7378
// from DRAFT to RUNNING. This is a no-op if the state is already RUNNING.
7479
// An error will be signaled if the state is anything other than DRAFT or
7580
// RUNNING.
76-
rpc StartMigrationWorkflow(StartMigrationWorkflowRequest) returns (google.protobuf.Empty) {
81+
rpc StartMigrationWorkflow(StartMigrationWorkflowRequest)
82+
returns (google.protobuf.Empty) {
7783
option (google.api.http) = {
7884
post: "/v2/{name=projects/*/locations/*/workflows/*}:start"
7985
body: "*"
@@ -82,15 +88,17 @@ service MigrationService {
8288
}
8389

8490
// Gets a previously created migration subtask.
85-
rpc GetMigrationSubtask(GetMigrationSubtaskRequest) returns (MigrationSubtask) {
91+
rpc GetMigrationSubtask(GetMigrationSubtaskRequest)
92+
returns (MigrationSubtask) {
8693
option (google.api.http) = {
8794
get: "/v2/{name=projects/*/locations/*/workflows/*/subtasks/*}"
8895
};
8996
option (google.api.method_signature) = "name";
9097
}
9198

9299
// Lists previously created migration subtasks.
93-
rpc ListMigrationSubtasks(ListMigrationSubtasksRequest) returns (ListMigrationSubtasksResponse) {
100+
rpc ListMigrationSubtasks(ListMigrationSubtasksRequest)
101+
returns (ListMigrationSubtasksResponse) {
94102
option (google.api.http) = {
95103
get: "/v2/{parent=projects/*/locations/*/workflows/*}/subtasks"
96104
};
@@ -110,7 +118,8 @@ message CreateMigrationWorkflowRequest {
110118
];
111119

112120
// Required. The migration workflow to create.
113-
MigrationWorkflow migration_workflow = 2 [(google.api.field_behavior) = REQUIRED];
121+
MigrationWorkflow migration_workflow = 2
122+
[(google.api.field_behavior) = REQUIRED];
114123
}
115124

116125
// A request to get a previously created migration workflow.
@@ -200,7 +209,8 @@ message GetMigrationSubtaskRequest {
200209
];
201210

202211
// Optional. The list of fields to be retrieved.
203-
google.protobuf.FieldMask read_mask = 2 [(google.api.field_behavior) = OPTIONAL];
212+
google.protobuf.FieldMask read_mask = 2
213+
[(google.api.field_behavior) = OPTIONAL];
204214
}
205215

206216
// A request to list previously created migration subtasks.
@@ -215,22 +225,23 @@ message ListMigrationSubtasksRequest {
215225
];
216226

217227
// Optional. The list of fields to be retrieved.
218-
google.protobuf.FieldMask read_mask = 2 [(google.api.field_behavior) = OPTIONAL];
228+
google.protobuf.FieldMask read_mask = 2
229+
[(google.api.field_behavior) = OPTIONAL];
219230

220-
// Optional. The maximum number of migration tasks to return. The service may return
221-
// fewer than this number.
231+
// Optional. The maximum number of migration tasks to return. The service may
232+
// return fewer than this number.
222233
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
223234

224-
// Optional. A page token, received from previous `ListMigrationSubtasks` call.
225-
// Provide this to retrieve the subsequent page.
235+
// Optional. A page token, received from previous `ListMigrationSubtasks`
236+
// call. Provide this to retrieve the subsequent page.
226237
//
227238
// When paginating, all other parameters provided to `ListMigrationSubtasks`
228239
// must match the call that provided the page token.
229240
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
230241

231-
// Optional. The filter to apply. This can be used to get the subtasks of a specific
232-
// tasks in a workflow, e.g. `migration_task = "ab012"` where `"ab012"` is the
233-
// task ID (not the name in the named map).
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).
234245
string filter = 5 [(google.api.field_behavior) = OPTIONAL];
235246
}
236247

google/cloud/bigquery/migration/v2/translation_config.proto

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -38,21 +38,24 @@ message TranslationConfigDetails {
3838
string gcs_target_path = 2;
3939
}
4040

41-
// The dialect of the input files.
42-
Dialect source_dialect = 3;
43-
44-
// The target dialect for the engine to translate the input to.
45-
Dialect target_dialect = 4;
46-
4741
// The mapping of full SQL object names from their current state to the
4842
// desired output.
4943
oneof output_name_mapping {
5044
// The mapping of objects to their desired output names in list form.
5145
ObjectNameMappingList name_mapping_list = 5;
5246
}
5347

48+
// The dialect of the input files.
49+
Dialect source_dialect = 3;
50+
51+
// The target dialect for the engine to translate the input to.
52+
Dialect target_dialect = 4;
53+
5454
// The default source environment values for the translation.
5555
SourceEnv source_env = 6;
56+
57+
// The indicator to show translation request initiator.
58+
string request_source = 8;
5659
}
5760

5861
// The possible dialect options for translation.

0 commit comments

Comments
 (0)