migration_entities.proto 8.0 KB

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