log_entries.proto 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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.integrations.v1alpha;
  16. import "google/cloud/integrations/v1alpha/event_parameter.proto";
  17. import "google/cloud/integrations/v1alpha/product.proto";
  18. import "google/cloud/integrations/v1alpha/task_config.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/integrations/v1alpha;integrations";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "LogEntriesProto";
  23. option java_package = "com.google.cloud.integrations.v1alpha";
  24. // Log entry to log execution info for the monitored resource
  25. // `integrations.googleapis.com/IntegrationVersion`.
  26. message ExecutionInfo {
  27. // PostMethod Enum
  28. enum PostMethod {
  29. // Default value.
  30. POST_METHOD_UNSPECIFIED = 0;
  31. // Sync post.
  32. POST = 1;
  33. // Async post with schedule time.
  34. SCHEDULE = 2;
  35. }
  36. // Auto-generated primary key.
  37. string event_execution_info_id = 1;
  38. // Name of the integration.
  39. string integration = 2;
  40. // Pointer to the active version it is executing.
  41. string integration_version = 3;
  42. // The event data user sends as request.
  43. string project_id = 4;
  44. // The trigger id of the integration trigger config. If both trigger_id
  45. // and client_id is present, the integration is executed from the start tasks
  46. // provided by the matching trigger config otherwise it is executed from the
  47. // default start tasks.
  48. string trigger_id = 5;
  49. // Event parameters come in as part of the request.
  50. map<string, EventParameter> request_params = 6;
  51. // Event parameters come out as part of the response.
  52. map<string, EventParameter> response_params = 7;
  53. // The ways user posts this event.
  54. PostMethod post_method = 8;
  55. // The execution info about this event.
  56. EventExecutionDetails event_execution_details = 9;
  57. // Errors, warnings, and informationals associated with the workflow/task.
  58. // The order in which the errors were added by the workflow/task is
  59. // maintained.
  60. repeated ErrorDetail errors = 10;
  61. // Which Google product the execution_info belongs to. If not set, the
  62. // execution_info belongs to Integration Platform by default.
  63. Product product = 11;
  64. // This is used to de-dup incoming request.
  65. string request_id = 12;
  66. // The configuration details for a task.
  67. repeated TaskConfig task_configs = 13;
  68. }
  69. // Contains the details of the execution info of this event: this includes
  70. // the tasks execution details plus the event execution statistics.
  71. message EventExecutionDetails {
  72. // Enum EventExecutionState.
  73. enum EventExecutionState {
  74. // Default value.
  75. EVENT_EXECUTION_STATE_UNSPECIFIED = 0;
  76. // Event is received and waiting for the execution. This happens when
  77. // firing the event via "postToQueue" or "schedule".
  78. ON_HOLD = 1;
  79. // Event is under processing.
  80. IN_PROCESS = 2;
  81. // Event execution successfully finished. There's no more change after
  82. // this state.
  83. SUCCEEDED = 3;
  84. // Event execution failed. There's no more change after this state.
  85. FAILED = 4;
  86. // Event execution canceled by user. There's no more change after this
  87. // state.
  88. CANCELLED = 5;
  89. // Event execution failed and waiting for retry.
  90. RETRY_ON_HOLD = 6;
  91. // Event execution suspended and waiting for manual intervention.
  92. SUSPENDED = 7;
  93. }
  94. // The execution state of this event.
  95. EventExecutionState event_execution_state = 1;
  96. // After snapshot migration, this field will no longer be populated, but old
  97. // execution snapshots will still be accessible.
  98. repeated EventExecutionSnapshot event_execution_snapshot = 2;
  99. // Status for the current event execution attempt.
  100. repeated AttemptStats event_attempt_stats = 3;
  101. // Next scheduled execution time in case the execution status was
  102. // RETRY_ON_HOLD.
  103. google.protobuf.Timestamp next_execution_time = 4;
  104. // Indicates the number of times the execution has restarted from the
  105. // beginning.
  106. int32 event_retries_count = 5;
  107. }
  108. // Contains the snapshot of the event execution for a given checkpoint.
  109. message EventExecutionSnapshot {
  110. // Metadata for the event/task retry.
  111. message EventExecutionSnapshotMetadata {
  112. // The task number associated with this snapshot. Could be empty.
  113. string task_number = 1;
  114. // the task name associated with this snapshot. Could be empty.
  115. string task = 2;
  116. // the event attempt number this snapshot belongs to.
  117. int32 event_attempt_num = 3;
  118. // the task attempt number this snapshot belongs to. Could be empty.
  119. int32 task_attempt_num = 4;
  120. }
  121. // Indicates "right after which checkpoint task's execution" this snapshot
  122. // is taken.
  123. string checkpoint_task_number = 1;
  124. // Indicates when this snapshot is taken.
  125. google.protobuf.Timestamp snapshot_time = 2;
  126. // Snapshot metadata.
  127. EventExecutionSnapshotMetadata event_execution_snapshot_metadata = 3;
  128. // All of the task execution details at the given point of time.
  129. repeated TaskExecutionDetails task_execution_details = 4;
  130. // All of the computed conditions that been calculated.
  131. repeated ConditionResult condition_results = 5;
  132. // The parameters in Event object.
  133. map<string, EventParameter> event_params = 6;
  134. // The parameters in Event object that differs from last snapshot.
  135. map<string, EventParameter> diff_params = 7;
  136. }
  137. // Contains the details of the execution of this task.
  138. message TaskExecutionDetails {
  139. // Enum TaskExecutionState.
  140. enum TaskExecutionState {
  141. // Default value.
  142. TASK_EXECUTION_STATE_UNSPECIFIED = 0;
  143. // Task is waiting for its precondition tasks to finish to start the
  144. // execution.
  145. PENDING_EXECUTION = 1;
  146. // Task is under processing.
  147. IN_PROCESS = 2;
  148. // Task execution successfully finished. There's no more change after
  149. // this state.
  150. SUCCEED = 3;
  151. // Task execution failed. There's no more change after this state.
  152. FAILED = 4;
  153. // Task execution failed and cause the whole event execution to fail
  154. // immediately. There's no more change after this state.
  155. FATAL = 5;
  156. // Task execution failed and waiting for retry.
  157. RETRY_ON_HOLD = 6;
  158. // Task execution skipped. This happens when its precondition wasn't met,
  159. // or the event execution been canceled before reach to the task.
  160. // There's no more changes after this state.
  161. SKIPPED = 7;
  162. // Task execution canceled when in progress. This happens when event
  163. // execution been canceled or any other task fall in fatal state.
  164. CANCELLED = 8;
  165. // Task is waiting for its dependency tasks' rollback to finish to start
  166. // its rollback.
  167. PENDING_ROLLBACK = 9;
  168. // Task is rolling back.
  169. ROLLBACK_IN_PROCESS = 10;
  170. // Task is rolled back. This is the state we will set regardless of
  171. // rollback succeeding or failing.
  172. ROLLEDBACK = 11;
  173. // Task is a SuspensionTask which has executed once, creating a pending
  174. // suspension.
  175. SUSPENDED = 12;
  176. }
  177. // Pointer to the task config it used for execution.
  178. string task_number = 1;
  179. // The execution state of this task.
  180. TaskExecutionState task_execution_state = 2;
  181. // Status for the current task execution attempt.
  182. repeated AttemptStats task_attempt_stats = 3;
  183. }
  184. // Status for the execution attempt.
  185. message AttemptStats {
  186. // The start time of the event execution for current attempt. This could be
  187. // in the future if it's been scheduled.
  188. google.protobuf.Timestamp start_time = 1;
  189. // The end time of the event execution for current attempt.
  190. google.protobuf.Timestamp end_time = 2;
  191. }
  192. // An error, warning, or information message associated with an integration.
  193. message ErrorDetail {
  194. // The full text of the error message, including any parameters that were
  195. // thrown along with the exception.
  196. string error_message = 1;
  197. // The task try-number, in which, the error occurred. If zero, the error
  198. // happened at the event level.
  199. int32 task_number = 2;
  200. }
  201. // Contains the combined condition calculation results.
  202. message ConditionResult {
  203. // the current task number.
  204. string current_task_number = 1;
  205. // the next task number.
  206. string next_task_number = 2;
  207. // the result comes out after evaluate the combined condition. True if there's
  208. // no combined condition specified.
  209. bool result = 3;
  210. }