summaryrefslogtreecommitdiff
path: root/third_party/googleapis/google/cloud/integrations/v1alpha/log_entries.proto
blob: 25f1c36cf2f70f8cb2513334ef160a52265c3d9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.integrations.v1alpha;

import "google/cloud/integrations/v1alpha/event_parameter.proto";
import "google/cloud/integrations/v1alpha/product.proto";
import "google/cloud/integrations/v1alpha/task_config.proto";
import "google/protobuf/timestamp.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/integrations/v1alpha;integrations";
option java_multiple_files = true;
option java_outer_classname = "LogEntriesProto";
option java_package = "com.google.cloud.integrations.v1alpha";

// Log entry to log execution info for the monitored resource
// `integrations.googleapis.com/IntegrationVersion`.
message ExecutionInfo {
  // PostMethod Enum
  enum PostMethod {
    // Default value.
    POST_METHOD_UNSPECIFIED = 0;

    // Sync post.
    POST = 1;

    // Async post with schedule time.
    SCHEDULE = 2;
  }

  // Auto-generated primary key.
  string event_execution_info_id = 1;

  // Name of the integration.
  string integration = 2;

  // Pointer to the active version it is executing.
  string integration_version = 3;

  // The event data user sends as request.
  string project_id = 4;

  // The trigger id of the integration trigger config. If both trigger_id
  // and client_id is present, the integration is executed from the start tasks
  // provided by the matching trigger config otherwise it is executed from the
  // default start tasks.
  string trigger_id = 5;

  // Event parameters come in as part of the request.
  map<string, EventParameter> request_params = 6;

  // Event parameters come out as part of the response.
  map<string, EventParameter> response_params = 7;

  // The ways user posts this event.
  PostMethod post_method = 8;

  // The execution info about this event.
  EventExecutionDetails event_execution_details = 9;

  // Errors, warnings, and informationals associated with the workflow/task.
  // The order in which the errors were added by the workflow/task is
  // maintained.
  repeated ErrorDetail errors = 10;

  // Which Google product the execution_info belongs to. If not set, the
  // execution_info belongs to Integration Platform by default.
  Product product = 11;

  // This is used to de-dup incoming request.
  string request_id = 12;

  // The configuration details for a task.
  repeated TaskConfig task_configs = 13;
}

// Contains the details of the execution info of this event: this includes
// the tasks execution details plus the event execution statistics.
message EventExecutionDetails {
  // Enum EventExecutionState.
  enum EventExecutionState {
    // Default value.
    EVENT_EXECUTION_STATE_UNSPECIFIED = 0;

    // Event is received and waiting for the execution. This happens when
    // firing the event via "postToQueue" or "schedule".
    ON_HOLD = 1;

    // Event is under processing.
    IN_PROCESS = 2;

    // Event execution successfully finished. There's no more change after
    // this state.
    SUCCEEDED = 3;

    // Event execution failed. There's no more change after this state.
    FAILED = 4;

    // Event execution canceled by user. There's no more change after this
    // state.
    CANCELLED = 5;

    // Event execution failed and waiting for retry.
    RETRY_ON_HOLD = 6;

    // Event execution suspended and waiting for manual intervention.
    SUSPENDED = 7;
  }

  // The execution state of this event.
  EventExecutionState event_execution_state = 1;

  // After snapshot migration, this field will no longer be populated, but old
  // execution snapshots will still be accessible.
  repeated EventExecutionSnapshot event_execution_snapshot = 2;

  // Status for the current event execution attempt.
  repeated AttemptStats event_attempt_stats = 3;

  // Next scheduled execution time in case the execution status was
  // RETRY_ON_HOLD.
  google.protobuf.Timestamp next_execution_time = 4;

  // Indicates the number of times the execution has restarted from the
  // beginning.
  int32 event_retries_count = 5;
}

// Contains the snapshot of the event execution for a given checkpoint.
message EventExecutionSnapshot {
  // Metadata for the event/task retry.
  message EventExecutionSnapshotMetadata {
    // The task number associated with this snapshot. Could be empty.
    string task_number = 1;

    // the task name associated with this snapshot. Could be empty.
    string task = 2;

    // the event attempt number this snapshot belongs to.
    int32 event_attempt_num = 3;

    // the task attempt number this snapshot belongs to. Could be empty.
    int32 task_attempt_num = 4;
  }

  // Indicates "right after which checkpoint task's execution" this snapshot
  // is taken.
  string checkpoint_task_number = 1;

  // Indicates when this snapshot is taken.
  google.protobuf.Timestamp snapshot_time = 2;

  // Snapshot metadata.
  EventExecutionSnapshotMetadata event_execution_snapshot_metadata = 3;

  // All of the task execution details at the given point of time.
  repeated TaskExecutionDetails task_execution_details = 4;

  // All of the computed conditions that been calculated.
  repeated ConditionResult condition_results = 5;

  // The parameters in Event object.
  map<string, EventParameter> event_params = 6;

  // The parameters in Event object that differs from last snapshot.
  map<string, EventParameter> diff_params = 7;
}

// Contains the details of the execution of this task.
message TaskExecutionDetails {
  // Enum TaskExecutionState.
  enum TaskExecutionState {
    // Default value.
    TASK_EXECUTION_STATE_UNSPECIFIED = 0;

    // Task is waiting for its precondition tasks to finish to start the
    // execution.
    PENDING_EXECUTION = 1;

    // Task is under processing.
    IN_PROCESS = 2;

    // Task execution successfully finished. There's no more change after
    // this state.
    SUCCEED = 3;

    // Task execution failed. There's no more change after this state.
    FAILED = 4;

    // Task execution failed and cause the whole event execution to fail
    // immediately. There's no more change after this state.
    FATAL = 5;

    // Task execution failed and waiting for retry.
    RETRY_ON_HOLD = 6;

    // Task execution skipped. This happens when its precondition wasn't met,
    // or the event execution been canceled before reach to the task.
    // There's no more changes after this state.
    SKIPPED = 7;

    // Task execution canceled when in progress. This happens when event
    // execution been canceled or any other task fall in fatal state.
    CANCELLED = 8;

    // Task is waiting for its dependency tasks' rollback to finish to start
    // its rollback.
    PENDING_ROLLBACK = 9;

    // Task is rolling back.
    ROLLBACK_IN_PROCESS = 10;

    // Task is rolled back. This is the state we will set regardless of
    // rollback succeeding or failing.
    ROLLEDBACK = 11;

    // Task is a SuspensionTask which has executed once, creating a pending
    // suspension.
    SUSPENDED = 12;
  }

  // Pointer to the task config it used for execution.
  string task_number = 1;

  // The execution state of this task.
  TaskExecutionState task_execution_state = 2;

  // Status for the current task execution attempt.
  repeated AttemptStats task_attempt_stats = 3;
}

// Status for the execution attempt.
message AttemptStats {
  // The start time of the event execution for current attempt. This could be
  // in the future if it's been scheduled.
  google.protobuf.Timestamp start_time = 1;

  // The end time of the event execution for current attempt.
  google.protobuf.Timestamp end_time = 2;
}

// An error, warning, or information message associated with an integration.
message ErrorDetail {
  // The full text of the error message, including any parameters that were
  // thrown along with the exception.
  string error_message = 1;

  // The task try-number, in which, the error occurred.  If zero, the error
  // happened at the event level.
  int32 task_number = 2;
}

// Contains the combined condition calculation results.
message ConditionResult {
  // the current task number.
  string current_task_number = 1;

  // the next task number.
  string next_task_number = 2;

  // the result comes out after evaluate the combined condition. True if there's
  // no combined condition specified.
  bool result = 3;
}