executions.proto 8.9 KB

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