Skip to content

Commit a74c1ac

Browse files
author
Shailesh Jagannath Padave
committed
Added WF Execute with sync and durable consistency
1 parent f228526 commit a74c1ac

8 files changed

Lines changed: 2530 additions & 65 deletions

File tree

src/conductor/client/http/api/service_registry_resource_api.py

Lines changed: 1382 additions & 0 deletions
Large diffs are not rendered by default.

src/conductor/client/http/api/workflow_resource_api.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ def execute_workflow(self, body, request_id, name, version, **kwargs): # noqa:
214214
:param int version: (required)
215215
:param str wait_until_task_ref:
216216
:param int wait_for_seconds:
217-
:return: WorkflowRun
217+
:param str consistency:
218+
:param str return_strategy:
219+
:return: SignalResponse
218220
If the method is called asynchronously,
219221
returns the request thread.
220222
"""
@@ -240,12 +242,14 @@ def execute_workflow_with_http_info(self, body, request_id, name, version, **kwa
240242
:param int version: (required)
241243
:param str wait_until_task_ref:
242244
:param int wait_for_seconds:
243-
:return: WorkflowRun
245+
:param str consistency:
246+
:param str return_strategy:
247+
:return: SignalResponse
244248
If the method is called asynchronously,
245249
returns the request thread.
246250
"""
247251

248-
all_params = ['body', 'request_id', 'name', 'version', 'wait_until_task_ref', 'wait_for_seconds'] # noqa: E501
252+
all_params = ['body', 'name', 'version', 'request_id', 'wait_until_task_ref', 'wait_for_seconds', 'consistency', 'return_strategy'] # noqa: E501
249253
all_params.append('async_req')
250254
all_params.append('_return_http_data_only')
251255
all_params.append('_preload_content')
@@ -293,6 +297,10 @@ def execute_workflow_with_http_info(self, body, request_id, name, version, **kwa
293297
query_params.append(('waitUntilTaskRef', params['wait_until_task_ref'])) # noqa: E501
294298
if 'wait_for_seconds' in params:
295299
query_params.append(('waitForSeconds', params['wait_for_seconds'])) # noqa: E501
300+
if 'consistency' in params:
301+
query_params.append(('consistency', params['consistency'])) # noqa: E501
302+
if 'return_strategy' in params:
303+
query_params.append(('returnStrategy', params['return_strategy'])) # noqa: E501
296304

297305
header_params = {}
298306

@@ -321,7 +329,7 @@ def execute_workflow_with_http_info(self, body, request_id, name, version, **kwa
321329
body=body_params,
322330
post_params=form_params,
323331
files=local_var_files,
324-
response_type='WorkflowRun', # noqa: E501
332+
response_type='SignalResponse', # noqa: E501
325333
auth_settings=auth_settings,
326334
async_req=params.get('async_req'),
327335
_return_http_data_only=params.get('_return_http_data_only'),
Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
# coding: utf-8
2+
3+
"""
4+
Orkes Conductor API Server
5+
6+
Orkes Conductor API Server # noqa: E501
7+
8+
OpenAPI spec version: v2
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
import pprint
14+
import re # noqa: F401
15+
16+
import six
17+
18+
class SignalResponse(object):
19+
"""NOTE: This class is auto generated by the swagger code generator program.
20+
21+
Do not edit the class manually.
22+
"""
23+
"""
24+
Attributes:
25+
swagger_types (dict): The key is attribute name
26+
and the value is attribute type.
27+
attribute_map (dict): The key is attribute name
28+
and the value is json key in definition.
29+
"""
30+
swagger_types = {
31+
'correlation_id': 'str',
32+
'input': 'dict(str, object)',
33+
'output': 'dict(str, object)',
34+
'request_id': 'str',
35+
'response_type': 'str',
36+
'target_workflow_id': 'str',
37+
'target_workflow_status': 'str',
38+
'workflow_id': 'str'
39+
}
40+
41+
attribute_map = {
42+
'correlation_id': 'correlationId',
43+
'input': 'input',
44+
'output': 'output',
45+
'request_id': 'requestId',
46+
'response_type': 'responseType',
47+
'target_workflow_id': 'targetWorkflowId',
48+
'target_workflow_status': 'targetWorkflowStatus',
49+
'workflow_id': 'workflowId'
50+
}
51+
52+
def __init__(self, correlation_id=None, input=None, output=None, request_id=None, response_type=None, target_workflow_id=None, target_workflow_status=None, workflow_id=None): # noqa: E501
53+
"""SignalResponse - a model defined in Swagger""" # noqa: E501
54+
self._correlation_id = None
55+
self._input = None
56+
self._output = None
57+
self._request_id = None
58+
self._response_type = None
59+
self._target_workflow_id = None
60+
self._target_workflow_status = None
61+
self._workflow_id = None
62+
self.discriminator = None
63+
if correlation_id is not None:
64+
self.correlation_id = correlation_id
65+
if input is not None:
66+
self.input = input
67+
if output is not None:
68+
self.output = output
69+
if request_id is not None:
70+
self.request_id = request_id
71+
if response_type is not None:
72+
self.response_type = response_type
73+
if target_workflow_id is not None:
74+
self.target_workflow_id = target_workflow_id
75+
if target_workflow_status is not None:
76+
self.target_workflow_status = target_workflow_status
77+
if workflow_id is not None:
78+
self.workflow_id = workflow_id
79+
80+
@property
81+
def correlation_id(self):
82+
"""Gets the correlation_id of this SignalResponse. # noqa: E501
83+
84+
85+
:return: The correlation_id of this SignalResponse. # noqa: E501
86+
:rtype: str
87+
"""
88+
return self._correlation_id
89+
90+
@correlation_id.setter
91+
def correlation_id(self, correlation_id):
92+
"""Sets the correlation_id of this SignalResponse.
93+
94+
95+
:param correlation_id: The correlation_id of this SignalResponse. # noqa: E501
96+
:type: str
97+
"""
98+
99+
self._correlation_id = correlation_id
100+
101+
@property
102+
def input(self):
103+
"""Gets the input of this SignalResponse. # noqa: E501
104+
105+
106+
:return: The input of this SignalResponse. # noqa: E501
107+
:rtype: dict(str, object)
108+
"""
109+
return self._input
110+
111+
@input.setter
112+
def input(self, input):
113+
"""Sets the input of this SignalResponse.
114+
115+
116+
:param input: The input of this SignalResponse. # noqa: E501
117+
:type: dict(str, object)
118+
"""
119+
120+
self._input = input
121+
122+
@property
123+
def output(self):
124+
"""Gets the output of this SignalResponse. # noqa: E501
125+
126+
127+
:return: The output of this SignalResponse. # noqa: E501
128+
:rtype: dict(str, object)
129+
"""
130+
return self._output
131+
132+
@output.setter
133+
def output(self, output):
134+
"""Sets the output of this SignalResponse.
135+
136+
137+
:param output: The output of this SignalResponse. # noqa: E501
138+
:type: dict(str, object)
139+
"""
140+
141+
self._output = output
142+
143+
@property
144+
def request_id(self):
145+
"""Gets the request_id of this SignalResponse. # noqa: E501
146+
147+
148+
:return: The request_id of this SignalResponse. # noqa: E501
149+
:rtype: str
150+
"""
151+
return self._request_id
152+
153+
@request_id.setter
154+
def request_id(self, request_id):
155+
"""Sets the request_id of this SignalResponse.
156+
157+
158+
:param request_id: The request_id of this SignalResponse. # noqa: E501
159+
:type: str
160+
"""
161+
162+
self._request_id = request_id
163+
164+
@property
165+
def response_type(self):
166+
"""Gets the response_type of this SignalResponse. # noqa: E501
167+
168+
169+
:return: The response_type of this SignalResponse. # noqa: E501
170+
:rtype: str
171+
"""
172+
return self._response_type
173+
174+
@response_type.setter
175+
def response_type(self, response_type):
176+
"""Sets the response_type of this SignalResponse.
177+
178+
179+
:param response_type: The response_type of this SignalResponse. # noqa: E501
180+
:type: str
181+
"""
182+
allowed_values = ["TARGET_WORKFLOW", "BLOCKING_WORKFLOW", "BLOCKING_TASK", "BLOCKING_TASK_INPUT"] # noqa: E501
183+
if response_type not in allowed_values:
184+
raise ValueError(
185+
"Invalid value for `response_type` ({0}), must be one of {1}" # noqa: E501
186+
.format(response_type, allowed_values)
187+
)
188+
189+
self._response_type = response_type
190+
191+
@property
192+
def target_workflow_id(self):
193+
"""Gets the target_workflow_id of this SignalResponse. # noqa: E501
194+
195+
196+
:return: The target_workflow_id of this SignalResponse. # noqa: E501
197+
:rtype: str
198+
"""
199+
return self._target_workflow_id
200+
201+
@target_workflow_id.setter
202+
def target_workflow_id(self, target_workflow_id):
203+
"""Sets the target_workflow_id of this SignalResponse.
204+
205+
206+
:param target_workflow_id: The target_workflow_id of this SignalResponse. # noqa: E501
207+
:type: str
208+
"""
209+
210+
self._target_workflow_id = target_workflow_id
211+
212+
@property
213+
def target_workflow_status(self):
214+
"""Gets the target_workflow_status of this SignalResponse. # noqa: E501
215+
216+
217+
:return: The target_workflow_status of this SignalResponse. # noqa: E501
218+
:rtype: str
219+
"""
220+
return self._target_workflow_status
221+
222+
@target_workflow_status.setter
223+
def target_workflow_status(self, target_workflow_status):
224+
"""Sets the target_workflow_status of this SignalResponse.
225+
226+
227+
:param target_workflow_status: The target_workflow_status of this SignalResponse. # noqa: E501
228+
:type: str
229+
"""
230+
231+
self._target_workflow_status = target_workflow_status
232+
233+
@property
234+
def workflow_id(self):
235+
"""Gets the workflow_id of this SignalResponse. # noqa: E501
236+
237+
238+
:return: The workflow_id of this SignalResponse. # noqa: E501
239+
:rtype: str
240+
"""
241+
return self._workflow_id
242+
243+
@workflow_id.setter
244+
def workflow_id(self, workflow_id):
245+
"""Sets the workflow_id of this SignalResponse.
246+
247+
248+
:param workflow_id: The workflow_id of this SignalResponse. # noqa: E501
249+
:type: str
250+
"""
251+
252+
self._workflow_id = workflow_id
253+
254+
def to_dict(self):
255+
"""Returns the model properties as a dict"""
256+
result = {}
257+
258+
for attr, _ in six.iteritems(self.swagger_types):
259+
value = getattr(self, attr)
260+
if isinstance(value, list):
261+
result[attr] = list(map(
262+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
263+
value
264+
))
265+
elif hasattr(value, "to_dict"):
266+
result[attr] = value.to_dict()
267+
elif isinstance(value, dict):
268+
result[attr] = dict(map(
269+
lambda item: (item[0], item[1].to_dict())
270+
if hasattr(item[1], "to_dict") else item,
271+
value.items()
272+
))
273+
else:
274+
result[attr] = value
275+
if issubclass(SignalResponse, dict):
276+
for key, value in self.items():
277+
result[key] = value
278+
279+
return result
280+
281+
def to_str(self):
282+
"""Returns the string representation of the model"""
283+
return pprint.pformat(self.to_dict())
284+
285+
def __repr__(self):
286+
"""For `print` and `pprint`"""
287+
return self.to_str()
288+
289+
def __eq__(self, other):
290+
"""Returns true if both objects are equal"""
291+
if not isinstance(other, SignalResponse):
292+
return False
293+
294+
return self.__dict__ == other.__dict__
295+
296+
def __ne__(self, other):
297+
"""Returns true if both objects are not equal"""
298+
return not self == other

0 commit comments

Comments
 (0)