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