executions.proto 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. // Copyright 2020 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.workflows.executions.v1beta;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1beta;executions";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ExecutionsProto";
  24. option java_package = "com.google.cloud.workflows.executions.v1beta";
  25. option (google.api.resource_definition) = {
  26. type: "workflows.googleapis.com/Workflow"
  27. pattern: "projects/{project}/locations/{location}/workflows/{workflow}"
  28. };
  29. // Executions is used to start and manage running instances of
  30. // [Workflows][google.cloud.workflows.v1beta.Workflow] called executions.
  31. service Executions {
  32. option (google.api.default_host) = "workflowexecutions.googleapis.com";
  33. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  34. // Returns a list of executions which belong to the workflow with
  35. // the given name. The method returns executions of all workflow
  36. // revisions. Returned executions are ordered by their start time (newest
  37. // first).
  38. rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) {
  39. option (google.api.http) = {
  40. get: "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions"
  41. };
  42. option (google.api.method_signature) = "parent";
  43. }
  44. // Creates a new execution using the latest revision of the given workflow.
  45. rpc CreateExecution(CreateExecutionRequest) returns (Execution) {
  46. option (google.api.http) = {
  47. post: "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions"
  48. body: "execution"
  49. };
  50. option (google.api.method_signature) = "parent,execution";
  51. }
  52. // Returns an execution of the given name.
  53. rpc GetExecution(GetExecutionRequest) returns (Execution) {
  54. option (google.api.http) = {
  55. get: "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}"
  56. };
  57. option (google.api.method_signature) = "name";
  58. }
  59. // Cancels an execution of the given name.
  60. rpc CancelExecution(CancelExecutionRequest) returns (Execution) {
  61. option (google.api.http) = {
  62. post: "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel"
  63. body: "*"
  64. };
  65. option (google.api.method_signature) = "name";
  66. }
  67. }
  68. // A running instance of a [Workflow][google.cloud.workflows.v1beta.Workflow].
  69. message Execution {
  70. option (google.api.resource) = {
  71. type: "workflowexecutions.googleapis.com/Execution"
  72. pattern: "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}"
  73. };
  74. // Error describes why the execution was abnormally terminated.
  75. message Error {
  76. // Error payload returned by the execution, represented as a JSON string.
  77. string payload = 1;
  78. // Human readable error context, helpful for debugging purposes.
  79. string context = 2;
  80. }
  81. // Describes the current state of the execution. More states may be added
  82. // in the future.
  83. enum State {
  84. // Invalid state.
  85. STATE_UNSPECIFIED = 0;
  86. // The execution is in progress.
  87. ACTIVE = 1;
  88. // The execution finished successfully.
  89. SUCCEEDED = 2;
  90. // The execution failed with an error.
  91. FAILED = 3;
  92. // The execution was stopped intentionally.
  93. CANCELLED = 4;
  94. }
  95. // Output only. The resource name of the execution.
  96. // Format:
  97. // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
  98. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  99. // Output only. Marks the beginning of execution.
  100. google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  101. // Output only. Marks the end of execution, successful or not.
  102. google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  103. // Output only. Current state of the execution.
  104. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  105. // Input parameters of the execution represented as a JSON string.
  106. // The size limit is 32KB.
  107. string argument = 5;
  108. // Output only. Output of the execution represented as a JSON string. The
  109. // value can only be present if the execution's state is `SUCCEEDED`.
  110. string result = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  111. // Output only. The error which caused the execution to finish prematurely.
  112. // The value is only present if the execution's state is `FAILED`
  113. // or `CANCELLED`.
  114. Error error = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  115. // Output only. Revision of the workflow this execution is using.
  116. string workflow_revision_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. }
  118. // Request for the
  119. // [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
  120. // method.
  121. message ListExecutionsRequest {
  122. // Required. Name of the workflow for which the executions should be listed.
  123. // Format: projects/{project}/locations/{location}/workflows/{workflow}
  124. string parent = 1 [
  125. (google.api.field_behavior) = REQUIRED,
  126. (google.api.resource_reference) = {
  127. type: "workflows.googleapis.com/Workflow"
  128. }
  129. ];
  130. // Maximum number of executions to return per call.
  131. // Max supported value depends on the selected Execution view: it's 10000 for
  132. // BASIC and 100 for FULL. The default value used if the field is not
  133. // specified is 100, regardless of the selected view. Values greater than
  134. // the max value will be coerced down to it.
  135. int32 page_size = 2;
  136. // A page token, received from a previous `ListExecutions` call.
  137. // Provide this to retrieve the subsequent page.
  138. //
  139. // When paginating, all other parameters provided to `ListExecutions` must
  140. // match the call that provided the page token.
  141. string page_token = 3;
  142. // Optional. A view defining which fields should be filled in the returned executions.
  143. // The API will default to the BASIC view.
  144. ExecutionView view = 4 [(google.api.field_behavior) = OPTIONAL];
  145. }
  146. // Response for the
  147. // [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
  148. // method.
  149. message ListExecutionsResponse {
  150. // The executions which match the request.
  151. repeated Execution executions = 1;
  152. // A token, which can be sent as `page_token` to retrieve the next page.
  153. // If this field is omitted, there are no subsequent pages.
  154. string next_page_token = 2;
  155. }
  156. // Request for the
  157. // [CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
  158. // method.
  159. message CreateExecutionRequest {
  160. // Required. Name of the workflow for which an execution should be created.
  161. // Format: projects/{project}/locations/{location}/workflows/{workflow}
  162. // The latest revision of the workflow will be used.
  163. string parent = 1 [
  164. (google.api.field_behavior) = REQUIRED,
  165. (google.api.resource_reference) = {
  166. type: "workflows.googleapis.com/Workflow"
  167. }
  168. ];
  169. // Required. Execution to be created.
  170. Execution execution = 2 [(google.api.field_behavior) = REQUIRED];
  171. }
  172. // Request for the
  173. // [GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
  174. // method.
  175. message GetExecutionRequest {
  176. // Required. Name of the execution to be retrieved.
  177. // Format:
  178. // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
  179. string name = 1 [
  180. (google.api.field_behavior) = REQUIRED,
  181. (google.api.resource_reference) = {
  182. type: "workflowexecutions.googleapis.com/Execution"
  183. }
  184. ];
  185. // Optional. A view defining which fields should be filled in the returned execution.
  186. // The API will default to the FULL view.
  187. ExecutionView view = 2 [(google.api.field_behavior) = OPTIONAL];
  188. }
  189. // Request for the
  190. // [CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
  191. // method.
  192. message CancelExecutionRequest {
  193. // Required. Name of the execution to be cancelled.
  194. // Format:
  195. // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
  196. string name = 1 [
  197. (google.api.field_behavior) = REQUIRED,
  198. (google.api.resource_reference) = {
  199. type: "workflowexecutions.googleapis.com/Execution"
  200. }
  201. ];
  202. }
  203. // Defines possible views for execution resource.
  204. enum ExecutionView {
  205. // The default / unset value.
  206. EXECUTION_VIEW_UNSPECIFIED = 0;
  207. // Includes only basic metadata about the execution.
  208. // Following fields are returned: name, start_time, end_time, state
  209. // and workflow_revision_id.
  210. BASIC = 1;
  211. // Includes all data.
  212. FULL = 2;
  213. }