This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
/
executions.py
241 lines (187 loc) · 7.82 KB
/
executions.py
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
# -*- coding: utf-8 -*-
# Copyright 2020 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.
#
import proto # type: ignore
from google.protobuf import timestamp_pb2 as timestamp # type: ignore
__protobuf__ = proto.module(
package="google.cloud.workflows.executions.v1beta",
manifest={
"ExecutionView",
"Execution",
"ListExecutionsRequest",
"ListExecutionsResponse",
"CreateExecutionRequest",
"GetExecutionRequest",
"CancelExecutionRequest",
},
)
class ExecutionView(proto.Enum):
r"""Defines possible views for execution resource."""
EXECUTION_VIEW_UNSPECIFIED = 0
BASIC = 1
FULL = 2
class Execution(proto.Message):
r"""A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Attributes:
name (str):
Output only. The resource name of the
execution. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
start_time (~.timestamp.Timestamp):
Output only. Marks the beginning of
execution.
end_time (~.timestamp.Timestamp):
Output only. Marks the end of execution,
successful or not.
state (~.gcwe_executions.Execution.State):
Output only. Current state of the execution.
argument (str):
Input parameters of the execution represented
as a JSON string. The size limit is 32KB.
result (str):
Output only. Output of the execution represented as a JSON
string. The value can only be present if the execution's
state is ``SUCCEEDED``.
error (~.gcwe_executions.Execution.Error):
Output only. The error which caused the execution to finish
prematurely. The value is only present if the execution's
state is ``FAILED`` or ``CANCELLED``.
workflow_revision_id (str):
Output only. Revision of the workflow this
execution is using.
"""
class State(proto.Enum):
r"""Describes the current state of the execution. More states may
be added in the future.
"""
STATE_UNSPECIFIED = 0
ACTIVE = 1
SUCCEEDED = 2
FAILED = 3
CANCELLED = 4
class Error(proto.Message):
r"""Error describes why the execution was abnormally terminated.
Attributes:
payload (str):
Error payload returned by the execution,
represented as a JSON string.
context (str):
Human readable error context, helpful for
debugging purposes.
"""
payload = proto.Field(proto.STRING, number=1)
context = proto.Field(proto.STRING, number=2)
name = proto.Field(proto.STRING, number=1)
start_time = proto.Field(proto.MESSAGE, number=2, message=timestamp.Timestamp,)
end_time = proto.Field(proto.MESSAGE, number=3, message=timestamp.Timestamp,)
state = proto.Field(proto.ENUM, number=4, enum=State,)
argument = proto.Field(proto.STRING, number=5)
result = proto.Field(proto.STRING, number=6)
error = proto.Field(proto.MESSAGE, number=7, message=Error,)
workflow_revision_id = proto.Field(proto.STRING, number=8)
class ListExecutionsRequest(proto.Message):
r"""Request for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
Attributes:
parent (str):
Required. Name of the workflow for which the
executions should be listed. Format:
projects/{project}/locations/{location}/workflows/{workflow}
page_size (int):
Maximum number of executions to return per
call. Max supported value depends on the
selected Execution view: it's 10000 for BASIC
and 100 for FULL. The default value used if the
field is not specified is 100, regardless of the
selected view. Values greater than the max value
will be coerced down to it.
page_token (str):
A page token, received from a previous ``ListExecutions``
call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to
``ListExecutions`` must match the call that provided the
page token.
view (~.gcwe_executions.ExecutionView):
Optional. A view defining which fields should
be filled in the returned executions. The API
will default to the BASIC view.
"""
parent = proto.Field(proto.STRING, number=1)
page_size = proto.Field(proto.INT32, number=2)
page_token = proto.Field(proto.STRING, number=3)
view = proto.Field(proto.ENUM, number=4, enum="ExecutionView",)
class ListExecutionsResponse(proto.Message):
r"""Response for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
Attributes:
executions (Sequence[~.gcwe_executions.Execution]):
The executions which match the request.
next_page_token (str):
A token, which can be sent as ``page_token`` to retrieve the
next page. If this field is omitted, there are no subsequent
pages.
"""
@property
def raw_page(self):
return self
executions = proto.RepeatedField(proto.MESSAGE, number=1, message="Execution",)
next_page_token = proto.Field(proto.STRING, number=2)
class CreateExecutionRequest(proto.Message):
r"""Request for the
[CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
method.
Attributes:
parent (str):
Required. Name of the workflow for which an
execution should be created. Format:
projects/{project}/locations/{location}/workflows/{workflow}
The latest revision of the workflow will be
used.
execution (~.gcwe_executions.Execution):
Required. Execution to be created.
"""
parent = proto.Field(proto.STRING, number=1)
execution = proto.Field(proto.MESSAGE, number=2, message="Execution",)
class GetExecutionRequest(proto.Message):
r"""Request for the
[GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
method.
Attributes:
name (str):
Required. Name of the execution to be
retrieved. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
view (~.gcwe_executions.ExecutionView):
Optional. A view defining which fields should
be filled in the returned execution. The API
will default to the FULL view.
"""
name = proto.Field(proto.STRING, number=1)
view = proto.Field(proto.ENUM, number=2, enum="ExecutionView",)
class CancelExecutionRequest(proto.Message):
r"""Request for the
[CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
method.
Attributes:
name (str):
Required. Name of the execution to be
cancelled. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
"""
name = proto.Field(proto.STRING, number=1)
__all__ = tuple(sorted(__protobuf__.manifest))