migration_service.proto 9.1 KB

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