1// Copyright 2023 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.integrations.v1alpha; 18 19import "google/api/field_behavior.proto"; 20import "google/cloud/integrations/v1alpha/cloud_logging_details.proto"; 21import "google/cloud/integrations/v1alpha/event_parameter.proto"; 22import "google/cloud/integrations/v1alpha/integration_state.proto"; 23import "google/cloud/integrations/v1alpha/task_config.proto"; 24import "google/protobuf/timestamp.proto"; 25 26option csharp_namespace = "Google.Cloud.Integrations.V1Alpha"; 27option go_package = "cloud.google.com/go/integrations/apiv1alpha/integrationspb;integrationspb"; 28option java_multiple_files = true; 29option java_outer_classname = "LogEntriesProto"; 30option java_package = "com.google.cloud.integrations.v1alpha"; 31 32// Log entry to log execution info for the monitored resource 33// `integrations.googleapis.com/IntegrationVersion`. 34message ExecutionInfo { 35 // ExecutionMethod Enum 36 enum ExecutionMethod { 37 // Default value. 38 EXECUTION_METHOD_UNSPECIFIED = 0; 39 40 // Sync post. 41 POST = 1; 42 43 // Async post with schedule time. 44 SCHEDULE = 2; 45 46 // Async post. 47 POST_TO_QUEUE = 3; 48 } 49 50 // Name of the integration. 51 string integration = 2; 52 53 // The customer's project number. 54 string project_id = 4; 55 56 // The trigger id of the integration trigger config. If both trigger_id 57 // and client_id is present, the integration is executed from the start tasks 58 // provided by the matching trigger config otherwise it is executed from the 59 // default start tasks. 60 string trigger_id = 5; 61 62 // Execution parameters come in as part of the request. 63 map<string, EventParameter> request_params = 6; 64 65 // Execution parameters come out as part of the response. 66 map<string, EventParameter> response_params = 7; 67 68 // Errors, warnings, and informationals associated with the workflow/task. 69 // The order in which the errors were added by the workflow/task is 70 // maintained. 71 repeated ErrorDetail errors = 10; 72 73 // The configuration details for a task. 74 repeated TaskConfig task_configs = 13; 75 76 // Pointer to the active version it is executing. 77 string integration_version_number = 14; 78 79 // Auto-generated primary key. 80 string execution_id = 15; 81 82 // Output only. State of the integration version 83 IntegrationState integration_version_state = 16 84 [(google.api.field_behavior) = OUTPUT_ONLY]; 85 86 // Database persistence policy for execution info 87 bool enable_database_persistence = 17; 88 89 // Cloud Logging details for execution info 90 CloudLoggingDetails cloud_logging_details = 18; 91 92 // The details about this integration execution. 93 IntegrationExecutionDetails integration_execution_details = 19; 94 95 // Specifies whether this execution info corresponds to actual integration or 96 // test case. 97 ExecutionType execution_type = 20; 98 99 // The ways user posts this event. 100 ExecutionMethod execution_method = 21; 101 102 // An increasing sequence that is set when a new snapshot (Integration 103 // Version) is created. 104 int64 integration_snapshot_number = 22; 105} 106 107// Contains the details of the execution info: this includes the tasks execution 108// details plus the integration execution statistics. 109message IntegrationExecutionDetails { 110 // Enum ExecutionState. 111 enum IntegrationExecutionState { 112 // Default value. 113 INTEGRATION_EXECUTION_STATE_UNSPECIFIED = 0; 114 115 // Integration is received and waiting for the execution. This happens when 116 // firing the Integration via "postToQueue" or "schedule". 117 ON_HOLD = 1; 118 119 // Integration is under processing. 120 IN_PROCESS = 2; 121 122 // Integration execution successfully finished. There's no more change after 123 // this state. 124 SUCCEEDED = 3; 125 126 // Integration execution failed. There's no more change after this state. 127 FAILED = 4; 128 129 // Integration execution canceled by user. There's no more change after this 130 // state. 131 CANCELLED = 5; 132 133 // Integration execution failed and waiting for retry. 134 RETRY_ON_HOLD = 6; 135 136 // Integration execution suspended and waiting for manual intervention. 137 SUSPENDED = 7; 138 } 139 140 // Output only. The execution state of this Integration. 141 IntegrationExecutionState integration_execution_state = 1 142 [(google.api.field_behavior) = OUTPUT_ONLY]; 143 144 // Execution snapshot. 145 repeated IntegrationExecutionSnapshot integration_execution_snapshot = 2; 146 147 // Status for the current execution attempt. 148 repeated AttemptStats execution_attempt_stats = 3; 149 150 // Next scheduled execution time in case the execution status was 151 // RETRY_ON_HOLD. 152 google.protobuf.Timestamp next_execution_time = 4; 153 154 // Indicates the number of times the execution has restarted from the 155 // beginning. 156 int32 execution_retries_count = 5; 157} 158 159// Contains the snapshot of the integration execution for a given checkpoint. 160message IntegrationExecutionSnapshot { 161 // Metadata for the integration/task retry. 162 message IntegrationExecutionSnapshotMetadata { 163 // The task number associated with this snapshot. Could be empty. 164 string task_number = 1; 165 166 // the task name associated with this snapshot. Could be empty. 167 string task = 2; 168 169 // the integration execution attempt number this snapshot belongs to. 170 int32 integration_execution_attempt_num = 3; 171 172 // the task attempt number this snapshot belongs to. Could be empty. 173 int32 task_attempt_num = 4; 174 175 // the task label associated with this snapshot. Could be empty. 176 string task_label = 5; 177 178 // Ancestor task number for the task(it will only be non-empty if the task 179 // is under 'private workflow') 180 repeated string ancestor_task_numbers = 6; 181 182 // Ancestor iteration number for the task(it will only be non-empty if the 183 // task is under 'private workflow') 184 repeated string ancestor_iteration_numbers = 7; 185 186 // The direct integration which the event execution snapshots belongs to 187 string integration = 8; 188 } 189 190 // Indicates "right after which checkpoint task's execution" this snapshot 191 // is taken. 192 string checkpoint_task_number = 1; 193 194 // Indicates when this snapshot is taken. 195 google.protobuf.Timestamp snapshot_time = 2; 196 197 // Snapshot metadata. 198 IntegrationExecutionSnapshotMetadata integration_execution_snapshot_metadata = 199 3; 200 201 // All of the task execution details at the given point of time. 202 repeated TaskExecutionDetails task_execution_details = 4; 203 204 // All of the computed conditions that been calculated. 205 repeated ConditionResult condition_results = 5; 206 207 // The parameters in Event object. 208 map<string, EventParameter> execution_params = 6; 209} 210 211// Contains the details of the execution of this task. 212message TaskExecutionDetails { 213 // Enum TaskExecutionState. 214 enum TaskExecutionState { 215 // Default value. 216 TASK_EXECUTION_STATE_UNSPECIFIED = 0; 217 218 // Task is waiting for its precondition tasks to finish to start the 219 // execution. 220 PENDING_EXECUTION = 1; 221 222 // Task is under processing. 223 IN_PROCESS = 2; 224 225 // Task execution successfully finished. There's no more change after 226 // this state. 227 SUCCEED = 3; 228 229 // Task execution failed. There's no more change after this state. 230 FAILED = 4; 231 232 // Task execution failed and cause the whole integration execution to fail 233 // immediately. There's no more change after this state. 234 FATAL = 5; 235 236 // Task execution failed and waiting for retry. 237 RETRY_ON_HOLD = 6; 238 239 // Task execution skipped. This happens when its precondition wasn't met, 240 // or the integration execution been canceled before reach to the task. 241 // There's no more changes after this state. 242 SKIPPED = 7; 243 244 // Task execution canceled when in progress. This happens when integration 245 // execution been canceled or any other task fall in fatal state. 246 CANCELLED = 8; 247 248 // Task is waiting for its dependency tasks' rollback to finish to start 249 // its rollback. 250 PENDING_ROLLBACK = 9; 251 252 // Task is rolling back. 253 ROLLBACK_IN_PROCESS = 10; 254 255 // Task is rolled back. This is the state we will set regardless of 256 // rollback succeeding or failing. 257 ROLLEDBACK = 11; 258 259 // Task is a SuspensionTask which has executed once, creating a pending 260 // suspension. 261 SUSPENDED = 12; 262 } 263 264 // Pointer to the task config it used for execution. 265 string task_number = 1; 266 267 // The execution state of this task. 268 TaskExecutionState task_execution_state = 2; 269 270 // Status for the current task execution attempt. 271 repeated AttemptStats task_attempt_stats = 3; 272} 273 274// Status for the execution attempt. 275message AttemptStats { 276 // The start time of the integration execution for current attempt. This could 277 // be in the future if it's been scheduled. 278 google.protobuf.Timestamp start_time = 1; 279 280 // The end time of the integration execution for current attempt. 281 google.protobuf.Timestamp end_time = 2; 282} 283 284// An error, warning, or information message associated with an integration. 285message ErrorDetail { 286 // The full text of the error message, including any parameters that were 287 // thrown along with the exception. 288 string error_message = 1; 289 290 // The task try-number, in which, the error occurred. If zero, the error 291 // happened at the integration level. 292 int32 task_number = 2; 293} 294 295// Contains the combined condition calculation results. 296message ConditionResult { 297 // the current task number. 298 string current_task_number = 1; 299 300 // the next task number. 301 string next_task_number = 2; 302 303 // the result comes out after evaluate the combined condition. True if there's 304 // no combined condition specified. 305 bool result = 3; 306} 307 308// Specifies whether this execution info corresponds to actual integration or 309// test case. 310enum ExecutionType { 311 // Unspecified value. 312 EXECUTION_TYPE_UNSPECIFIED = 0; 313 314 // Execution corresponds to run of an integration version. 315 INTEGRATION_VERSION = 1; 316 317 // Execution corresponds to run of a functional test case. 318 TEST_CASE = 2; 319} 320