migration_entities.proto 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/bigquery/migration/v2alpha/assessment_task.proto";
  19. import "google/cloud/bigquery/migration/v2alpha/migration_error_details.proto";
  20. import "google/cloud/bigquery/migration/v2alpha/migration_metrics.proto";
  21. import "google/cloud/bigquery/migration/v2alpha/translation_task.proto";
  22. import "google/protobuf/any.proto";
  23. import "google/protobuf/timestamp.proto";
  24. import "google/rpc/error_details.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 = "MigrationEntitiesProto";
  29. option java_package = "com.google.cloud.bigquery.migration.v2alpha";
  30. option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2alpha";
  31. // A migration workflow which specifies what needs to be done for an EDW
  32. // migration.
  33. message MigrationWorkflow {
  34. option (google.api.resource) = {
  35. type: "bigquerymigration.googleapis.com/MigrationWorkflow"
  36. pattern: "projects/{project}/locations/{location}/workflows/{workflow}"
  37. };
  38. // Possible migration workflow states.
  39. enum State {
  40. // Workflow state is unspecified.
  41. STATE_UNSPECIFIED = 0;
  42. // Workflow is in draft status, i.e. tasks are not yet eligible for
  43. // execution.
  44. DRAFT = 1;
  45. // Workflow is running (i.e. tasks are eligible for execution).
  46. RUNNING = 2;
  47. // Workflow is paused. Tasks currently in progress may continue, but no
  48. // further tasks will be scheduled.
  49. PAUSED = 3;
  50. // Workflow is complete. There should not be any task in a non-terminal
  51. // state, but if they are (e.g. forced termination), they will not be
  52. // scheduled.
  53. COMPLETED = 4;
  54. }
  55. // Output only. Immutable. The unique identifier for the migration workflow. The ID is
  56. // server-generated.
  57. //
  58. // Example: `projects/123/locations/us/workflows/345`
  59. string name = 1 [
  60. (google.api.field_behavior) = OUTPUT_ONLY,
  61. (google.api.field_behavior) = IMMUTABLE
  62. ];
  63. // The display name of the workflow. This can be set to give a workflow
  64. // a descriptive name. There is no guarantee or enforcement of uniqueness.
  65. string display_name = 6;
  66. // The tasks in a workflow in a named map. The name (i.e. key) has no
  67. // meaning and is merely a convenient way to address a specific task
  68. // in a workflow.
  69. map<string, MigrationTask> tasks = 2;
  70. // Output only. That status of the workflow.
  71. State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  72. // Time when the workflow was created.
  73. google.protobuf.Timestamp create_time = 4;
  74. // Time when the workflow was last updated.
  75. google.protobuf.Timestamp last_update_time = 5;
  76. }
  77. // A single task for a migration which has details about the configuration of
  78. // the task.
  79. message MigrationTask {
  80. // Possible states of a migration task.
  81. enum State {
  82. // The state is unspecified.
  83. STATE_UNSPECIFIED = 0;
  84. // The task is waiting for orchestration.
  85. PENDING = 1;
  86. // The task is assigned to an orchestrator.
  87. ORCHESTRATING = 2;
  88. // The task is running, i.e. its subtasks are ready for execution.
  89. RUNNING = 3;
  90. // Tha task is paused. Assigned subtasks can continue, but no new subtasks
  91. // will be scheduled.
  92. PAUSED = 4;
  93. // The task finished successfully.
  94. SUCCEEDED = 5;
  95. // The task finished unsuccessfully.
  96. FAILED = 6;
  97. }
  98. // The details of the task.
  99. oneof task_details {
  100. // Task configuration for Assessment.
  101. AssessmentTaskDetails assessment_task_details = 12;
  102. // Task configuration for Batch/Offline SQL Translation.
  103. TranslationTaskDetails translation_task_details = 13;
  104. }
  105. // Output only. Immutable. The unique identifier for the migration task. The ID is server-generated.
  106. string id = 1 [
  107. (google.api.field_behavior) = OUTPUT_ONLY,
  108. (google.api.field_behavior) = IMMUTABLE
  109. ];
  110. // The type of the task. This must be a supported task type.
  111. string type = 2;
  112. // DEPRECATED! Use one of the task_details below.
  113. // The details of the task. The type URL must be one of the supported task
  114. // details messages and correspond to the Task's type.
  115. google.protobuf.Any details = 3;
  116. // Output only. The current state of the task.
  117. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  118. // Output only. An explanation that may be populated when the task is in FAILED state.
  119. google.rpc.ErrorInfo processing_error = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  120. // Time when the task was created.
  121. google.protobuf.Timestamp create_time = 6;
  122. // Time when the task was last updated.
  123. google.protobuf.Timestamp last_update_time = 7;
  124. // Output only. Additional information about the orchestration.
  125. MigrationTaskOrchestrationResult orchestration_result = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  126. }
  127. // A subtask for a migration which carries details about the configuration of
  128. // the subtask. The content of the details should not matter to the end user,
  129. // but is a contract between the subtask creator and subtask worker.
  130. message MigrationSubtask {
  131. option (google.api.resource) = {
  132. type: "bigquerymigration.googleapis.com/MigrationSubtask"
  133. pattern: "projects/{project}/locations/{location}/workflows/{workflow}/subtasks/{subtask}"
  134. };
  135. // Possible states of a migration subtask.
  136. enum State {
  137. // The state is unspecified.
  138. STATE_UNSPECIFIED = 0;
  139. // The subtask is ready, i.e. it is ready for execution.
  140. ACTIVE = 1;
  141. // The subtask is running, i.e. it is assigned to a worker for execution.
  142. RUNNING = 2;
  143. // The subtask finished successfully.
  144. SUCCEEDED = 3;
  145. // The subtask finished unsuccessfully.
  146. FAILED = 4;
  147. // The subtask is paused, i.e., it will not be scheduled. If it was already
  148. // assigned,it might still finish but no new lease renewals will be granted.
  149. PAUSED = 5;
  150. }
  151. // Output only. Immutable. The resource name for the migration subtask. The ID is
  152. // server-generated.
  153. //
  154. // Example: `projects/123/locations/us/workflows/345/subtasks/678`
  155. string name = 1 [
  156. (google.api.field_behavior) = OUTPUT_ONLY,
  157. (google.api.field_behavior) = IMMUTABLE
  158. ];
  159. // The unique ID of the task to which this subtask belongs.
  160. string task_id = 2;
  161. // The type of the Subtask. The migration service does not check whether this
  162. // is a known type. It is up to the task creator (i.e. orchestrator or worker)
  163. // to ensure it only creates subtasks for which there are compatible workers
  164. // polling for Subtasks.
  165. string type = 3;
  166. // Output only. The current state of the subtask.
  167. State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  168. // Output only. An explanation that may be populated when the task is in FAILED state.
  169. google.rpc.ErrorInfo processing_error = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  170. // Output only. Provides details to errors and issues encountered while processing the
  171. // subtask. Presence of error details does not mean that the subtask failed.
  172. repeated ResourceErrorDetail resource_error_details = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  173. // The number or resources with errors. Note: This is not the total
  174. // number of errors as each resource can have more than one error.
  175. // This is used to indicate truncation by having a `resource_error_count`
  176. // that is higher than the size of `resource_error_details`.
  177. int32 resource_error_count = 13;
  178. // Time when the subtask was created.
  179. google.protobuf.Timestamp create_time = 7;
  180. // Time when the subtask was last updated.
  181. google.protobuf.Timestamp last_update_time = 8;
  182. // The metrics for the subtask.
  183. repeated TimeSeries metrics = 11;
  184. }
  185. // Additional information from the orchestrator when it is done with the
  186. // task orchestration.
  187. message MigrationTaskOrchestrationResult {
  188. // Details specific to the task type.
  189. oneof details {
  190. // Details specific to assessment task types.
  191. AssessmentOrchestrationResultDetails assessment_details = 1;
  192. }
  193. }