migration_service.proto 9.3 KB

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