migration_service.proto 9.2 KB

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