migration_entities.proto 7.3 KB

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