volcano-sdk-python 0.9.4__py3-none-any.whl → 0.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- volcano_sdk/__init__.py +8 -0
- volcano_sdk/_generated/api/databases/list_database_regions.py +8 -0
- volcano_sdk/_generated/api/durable_functions/__init__.py +1 -0
- volcano_sdk/_generated/api/durable_functions/create_durable_function.py +295 -0
- volcano_sdk/_generated/api/durable_functions/create_durable_function_scheduler.py +259 -0
- volcano_sdk/_generated/api/durable_functions/delete_durable_function.py +213 -0
- volcano_sdk/_generated/api/durable_functions/delete_durable_function_scheduler.py +202 -0
- volcano_sdk/_generated/api/durable_functions/get_durable_execution.py +225 -0
- volcano_sdk/_generated/api/durable_functions/get_durable_function.py +193 -0
- volcano_sdk/_generated/api/durable_functions/get_durable_function_scheduler.py +206 -0
- volcano_sdk/_generated/api/durable_functions/list_durable_executions.py +318 -0
- volcano_sdk/_generated/api/durable_functions/list_durable_function_deployments.py +230 -0
- volcano_sdk/_generated/api/durable_functions/list_durable_function_schedulers.py +213 -0
- volcano_sdk/_generated/api/durable_functions/list_durable_functions.py +251 -0
- volcano_sdk/_generated/api/durable_functions/start_durable_execution.py +333 -0
- volcano_sdk/_generated/api/durable_functions/start_durable_execution_from_application.py +389 -0
- volcano_sdk/_generated/api/durable_functions/stop_durable_execution.py +268 -0
- volcano_sdk/_generated/api/durable_functions/update_durable_function_scheduler.py +233 -0
- volcano_sdk/_generated/api/frontends/create_frontend.py +4 -4
- volcano_sdk/_generated/api/functions/create_function_scheduler.py +14 -0
- volcano_sdk/_generated/api/functions/create_functions_batch.py +21 -0
- volcano_sdk/_generated/api/functions/delete_function_scheduler.py +79 -7
- volcano_sdk/_generated/api/functions/get_function_scheduler.py +18 -10
- volcano_sdk/_generated/api/functions/invoke_function.py +24 -0
- volcano_sdk/_generated/api/functions/list_function_schedulers.py +18 -10
- volcano_sdk/_generated/api/functions/update_function_scheduler.py +25 -10
- volcano_sdk/_generated/api/o_auth_authentication/call_o_auth_provider_api.py +12 -4
- volcano_sdk/_generated/api/projects/apply_project_config.py +7 -0
- volcano_sdk/_generated/api/projects/get_project_config.py +19 -8
- volcano_sdk/_generated/api/projects/replace_shared_variables.py +249 -0
- volcano_sdk/_generated/api/variables/create_variable.py +7 -0
- volcano_sdk/_generated/api/variables/update_variable.py +7 -0
- volcano_sdk/_generated/models/__init__.py +30 -2
- volcano_sdk/_generated/models/create_database_request.py +8 -9
- volcano_sdk/_generated/models/create_durable_function_body.py +223 -0
- volcano_sdk/_generated/models/create_durable_function_body_runtime.py +10 -0
- volcano_sdk/_generated/models/create_durable_function_body_variable_scope.py +10 -0
- volcano_sdk/_generated/models/create_function_body.py +50 -2
- volcano_sdk/_generated/models/create_function_body_variable_scope.py +10 -0
- volcano_sdk/_generated/models/create_functions_batch_body.py +11 -0
- volcano_sdk/_generated/models/create_variable_request.py +12 -0
- volcano_sdk/_generated/models/durable_execution.py +216 -0
- volcano_sdk/_generated/models/durable_execution_error.py +88 -0
- volcano_sdk/_generated/models/durable_execution_status.py +10 -0
- volcano_sdk/_generated/models/durable_function.py +290 -0
- volcano_sdk/_generated/models/durable_function_config.py +97 -0
- volcano_sdk/_generated/models/durable_function_status.py +10 -0
- volcano_sdk/_generated/models/function_kind.py +10 -0
- volcano_sdk/_generated/models/function_runtime_option.py +9 -0
- volcano_sdk/_generated/models/function_scheduler.py +26 -0
- volcano_sdk/_generated/models/list_database_regions_response_200_item.py +1 -1
- volcano_sdk/_generated/models/metric_usage_data.py +11 -2
- volcano_sdk/_generated/models/paginated_durable_executions.py +126 -0
- volcano_sdk/_generated/models/paginated_durable_functions.py +126 -0
- volcano_sdk/_generated/models/project_config.py +15 -0
- volcano_sdk/_generated/models/project_config_function.py +74 -1
- volcano_sdk/_generated/models/project_config_function_variable_scope.py +10 -0
- volcano_sdk/_generated/models/project_config_variable.py +12 -0
- volcano_sdk/_generated/models/project_deployment_resource.py +27 -0
- volcano_sdk/_generated/models/project_health_resource.py +27 -0
- volcano_sdk/_generated/models/replace_shared_variables_body.py +88 -0
- volcano_sdk/_generated/models/update_variable_request.py +12 -0
- volcano_sdk/_generated/models/variable.py +11 -0
- volcano_sdk/_transport.py +89 -0
- volcano_sdk/client.py +2 -0
- volcano_sdk/durable.py +336 -0
- volcano_sdk/durable_authoring.py +811 -0
- volcano_sdk/models.py +73 -0
- {volcano_sdk_python-0.9.4.dist-info → volcano_sdk_python-0.10.0.dist-info}/METADATA +132 -3
- {volcano_sdk_python-0.9.4.dist-info → volcano_sdk_python-0.10.0.dist-info}/RECORD +72 -39
- volcano_sdk/_generated/models/create_database_request_region.py +0 -10
- {volcano_sdk_python-0.9.4.dist-info → volcano_sdk_python-0.10.0.dist-info}/WHEEL +0 -0
- {volcano_sdk_python-0.9.4.dist-info → volcano_sdk_python-0.10.0.dist-info}/licenses/LICENSE +0 -0
volcano_sdk/__init__.py
CHANGED
|
@@ -19,6 +19,10 @@ from .models import (
|
|
|
19
19
|
AuthSession,
|
|
20
20
|
AuthStateCallback,
|
|
21
21
|
AuthSubscription,
|
|
22
|
+
DurableExecution,
|
|
23
|
+
DurableExecutionFailure,
|
|
24
|
+
DurableExecutionPage,
|
|
25
|
+
DurableExecutionStatus,
|
|
22
26
|
EmailChangeResult,
|
|
23
27
|
FunctionResponse,
|
|
24
28
|
LinkedOAuthProvider,
|
|
@@ -54,6 +58,10 @@ __all__ = [
|
|
|
54
58
|
"AuthSubscription",
|
|
55
59
|
"AuthenticationError",
|
|
56
60
|
"ConflictError",
|
|
61
|
+
"DurableExecution",
|
|
62
|
+
"DurableExecutionFailure",
|
|
63
|
+
"DurableExecutionPage",
|
|
64
|
+
"DurableExecutionStatus",
|
|
57
65
|
"EmailChangeResult",
|
|
58
66
|
"FunctionResponse",
|
|
59
67
|
"LinkedOAuthProvider",
|
|
@@ -68,6 +68,8 @@ def sync_detailed(
|
|
|
68
68
|
""" List platform-supported regions for database provisioning
|
|
69
69
|
|
|
70
70
|
Returns the regions enabled for database provisioning in this platform environment.
|
|
71
|
+
These are the same regions offered for function deployment, and the only values
|
|
72
|
+
the `region` field of a database accepts.
|
|
71
73
|
This is a public endpoint that doesn't require authentication.
|
|
72
74
|
|
|
73
75
|
Raises:
|
|
@@ -97,6 +99,8 @@ def sync(
|
|
|
97
99
|
""" List platform-supported regions for database provisioning
|
|
98
100
|
|
|
99
101
|
Returns the regions enabled for database provisioning in this platform environment.
|
|
102
|
+
These are the same regions offered for function deployment, and the only values
|
|
103
|
+
the `region` field of a database accepts.
|
|
100
104
|
This is a public endpoint that doesn't require authentication.
|
|
101
105
|
|
|
102
106
|
Raises:
|
|
@@ -121,6 +125,8 @@ async def asyncio_detailed(
|
|
|
121
125
|
""" List platform-supported regions for database provisioning
|
|
122
126
|
|
|
123
127
|
Returns the regions enabled for database provisioning in this platform environment.
|
|
128
|
+
These are the same regions offered for function deployment, and the only values
|
|
129
|
+
the `region` field of a database accepts.
|
|
124
130
|
This is a public endpoint that doesn't require authentication.
|
|
125
131
|
|
|
126
132
|
Raises:
|
|
@@ -150,6 +156,8 @@ async def asyncio(
|
|
|
150
156
|
""" List platform-supported regions for database provisioning
|
|
151
157
|
|
|
152
158
|
Returns the regions enabled for database provisioning in this platform environment.
|
|
159
|
+
These are the same regions offered for function deployment, and the only values
|
|
160
|
+
the `region` field of a database accepts.
|
|
153
161
|
This is a public endpoint that doesn't require authentication.
|
|
154
162
|
|
|
155
163
|
Raises:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
""" Contains endpoint functions for accessing the API """
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.create_durable_function_body import CreateDurableFunctionBody
|
|
12
|
+
from ...models.durable_function import DurableFunction
|
|
13
|
+
from ...models.error import Error
|
|
14
|
+
from typing import cast
|
|
15
|
+
from uuid import UUID
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
id: UUID,
|
|
21
|
+
*,
|
|
22
|
+
body: CreateDurableFunctionBody,
|
|
23
|
+
|
|
24
|
+
) -> dict[str, Any]:
|
|
25
|
+
headers: dict[str, Any] = {}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
_kwargs: dict[str, Any] = {
|
|
33
|
+
"method": "post",
|
|
34
|
+
"url": "/projects/{id}/durable-functions".format(id=quote(str(id), safe=""),),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_kwargs["files"] = body.to_multipart()
|
|
38
|
+
|
|
39
|
+
headers["Content-Type"] = "multipart/form-data; boundary=+++"
|
|
40
|
+
|
|
41
|
+
_kwargs["headers"] = headers
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableFunction | Error | None:
|
|
47
|
+
if response.status_code == 200:
|
|
48
|
+
response_200 = DurableFunction.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
return response_200
|
|
53
|
+
|
|
54
|
+
if response.status_code == 201:
|
|
55
|
+
response_201 = DurableFunction.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
return response_201
|
|
60
|
+
|
|
61
|
+
if response.status_code == 400:
|
|
62
|
+
response_400 = Error.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return response_400
|
|
67
|
+
|
|
68
|
+
if response.status_code == 403:
|
|
69
|
+
response_403 = Error.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
return response_403
|
|
74
|
+
|
|
75
|
+
if response.status_code == 409:
|
|
76
|
+
response_409 = Error.from_dict(response.json())
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
return response_409
|
|
81
|
+
|
|
82
|
+
if response.status_code == 500:
|
|
83
|
+
response_500 = Error.from_dict(response.json())
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
return response_500
|
|
88
|
+
|
|
89
|
+
if response.status_code == 503:
|
|
90
|
+
response_503 = Error.from_dict(response.json())
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
return response_503
|
|
95
|
+
|
|
96
|
+
if client.raise_on_unexpected_status:
|
|
97
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
98
|
+
else:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DurableFunction | Error]:
|
|
103
|
+
return Response(
|
|
104
|
+
status_code=HTTPStatus(response.status_code),
|
|
105
|
+
content=response.content,
|
|
106
|
+
headers=response.headers,
|
|
107
|
+
parsed=_parse_response(client=client, response=response),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def sync_detailed(
|
|
112
|
+
id: UUID,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
body: CreateDurableFunctionBody,
|
|
116
|
+
|
|
117
|
+
) -> Response[DurableFunction | Error]:
|
|
118
|
+
""" Create or update a durable function
|
|
119
|
+
|
|
120
|
+
Upload a durable function source bundle. Creates the function on the
|
|
121
|
+
first call for a name and redeploys it on every call after that, the
|
|
122
|
+
same create-or-update contract `POST /projects/{id}/functions` has.
|
|
123
|
+
|
|
124
|
+
Volcano builds and deploys asynchronously. A deployment that starts
|
|
125
|
+
immediately returns `status: provisioning`, then transitions to `active`
|
|
126
|
+
or `failed`; a deployment that has to wait for a running one is exposed
|
|
127
|
+
through `pending_deployment_id`. Existing executions keep running
|
|
128
|
+
against the runtime they started on.
|
|
129
|
+
|
|
130
|
+
The `durable` configuration is derived from the project's plan rather
|
|
131
|
+
than supplied here, and is fixed once the function exists. A name
|
|
132
|
+
already held by a standard function is rejected with 409: a function
|
|
133
|
+
cannot change kind.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
id (UUID):
|
|
137
|
+
body (CreateDurableFunctionBody):
|
|
138
|
+
|
|
139
|
+
Raises:
|
|
140
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
141
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
Response[DurableFunction | Error]
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
kwargs = _get_kwargs(
|
|
149
|
+
id=id,
|
|
150
|
+
body=body,
|
|
151
|
+
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
response = client.get_httpx_client().request(
|
|
155
|
+
**kwargs,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
return _build_response(client=client, response=response)
|
|
159
|
+
|
|
160
|
+
def sync(
|
|
161
|
+
id: UUID,
|
|
162
|
+
*,
|
|
163
|
+
client: AuthenticatedClient,
|
|
164
|
+
body: CreateDurableFunctionBody,
|
|
165
|
+
|
|
166
|
+
) -> DurableFunction | Error | None:
|
|
167
|
+
""" Create or update a durable function
|
|
168
|
+
|
|
169
|
+
Upload a durable function source bundle. Creates the function on the
|
|
170
|
+
first call for a name and redeploys it on every call after that, the
|
|
171
|
+
same create-or-update contract `POST /projects/{id}/functions` has.
|
|
172
|
+
|
|
173
|
+
Volcano builds and deploys asynchronously. A deployment that starts
|
|
174
|
+
immediately returns `status: provisioning`, then transitions to `active`
|
|
175
|
+
or `failed`; a deployment that has to wait for a running one is exposed
|
|
176
|
+
through `pending_deployment_id`. Existing executions keep running
|
|
177
|
+
against the runtime they started on.
|
|
178
|
+
|
|
179
|
+
The `durable` configuration is derived from the project's plan rather
|
|
180
|
+
than supplied here, and is fixed once the function exists. A name
|
|
181
|
+
already held by a standard function is rejected with 409: a function
|
|
182
|
+
cannot change kind.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
id (UUID):
|
|
186
|
+
body (CreateDurableFunctionBody):
|
|
187
|
+
|
|
188
|
+
Raises:
|
|
189
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
190
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
DurableFunction | Error
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
return sync_detailed(
|
|
198
|
+
id=id,
|
|
199
|
+
client=client,
|
|
200
|
+
body=body,
|
|
201
|
+
|
|
202
|
+
).parsed
|
|
203
|
+
|
|
204
|
+
async def asyncio_detailed(
|
|
205
|
+
id: UUID,
|
|
206
|
+
*,
|
|
207
|
+
client: AuthenticatedClient,
|
|
208
|
+
body: CreateDurableFunctionBody,
|
|
209
|
+
|
|
210
|
+
) -> Response[DurableFunction | Error]:
|
|
211
|
+
""" Create or update a durable function
|
|
212
|
+
|
|
213
|
+
Upload a durable function source bundle. Creates the function on the
|
|
214
|
+
first call for a name and redeploys it on every call after that, the
|
|
215
|
+
same create-or-update contract `POST /projects/{id}/functions` has.
|
|
216
|
+
|
|
217
|
+
Volcano builds and deploys asynchronously. A deployment that starts
|
|
218
|
+
immediately returns `status: provisioning`, then transitions to `active`
|
|
219
|
+
or `failed`; a deployment that has to wait for a running one is exposed
|
|
220
|
+
through `pending_deployment_id`. Existing executions keep running
|
|
221
|
+
against the runtime they started on.
|
|
222
|
+
|
|
223
|
+
The `durable` configuration is derived from the project's plan rather
|
|
224
|
+
than supplied here, and is fixed once the function exists. A name
|
|
225
|
+
already held by a standard function is rejected with 409: a function
|
|
226
|
+
cannot change kind.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
id (UUID):
|
|
230
|
+
body (CreateDurableFunctionBody):
|
|
231
|
+
|
|
232
|
+
Raises:
|
|
233
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
234
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
Response[DurableFunction | Error]
|
|
238
|
+
"""
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
kwargs = _get_kwargs(
|
|
242
|
+
id=id,
|
|
243
|
+
body=body,
|
|
244
|
+
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
response = await client.get_async_httpx_client().request(
|
|
248
|
+
**kwargs
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
return _build_response(client=client, response=response)
|
|
252
|
+
|
|
253
|
+
async def asyncio(
|
|
254
|
+
id: UUID,
|
|
255
|
+
*,
|
|
256
|
+
client: AuthenticatedClient,
|
|
257
|
+
body: CreateDurableFunctionBody,
|
|
258
|
+
|
|
259
|
+
) -> DurableFunction | Error | None:
|
|
260
|
+
""" Create or update a durable function
|
|
261
|
+
|
|
262
|
+
Upload a durable function source bundle. Creates the function on the
|
|
263
|
+
first call for a name and redeploys it on every call after that, the
|
|
264
|
+
same create-or-update contract `POST /projects/{id}/functions` has.
|
|
265
|
+
|
|
266
|
+
Volcano builds and deploys asynchronously. A deployment that starts
|
|
267
|
+
immediately returns `status: provisioning`, then transitions to `active`
|
|
268
|
+
or `failed`; a deployment that has to wait for a running one is exposed
|
|
269
|
+
through `pending_deployment_id`. Existing executions keep running
|
|
270
|
+
against the runtime they started on.
|
|
271
|
+
|
|
272
|
+
The `durable` configuration is derived from the project's plan rather
|
|
273
|
+
than supplied here, and is fixed once the function exists. A name
|
|
274
|
+
already held by a standard function is rejected with 409: a function
|
|
275
|
+
cannot change kind.
|
|
276
|
+
|
|
277
|
+
Args:
|
|
278
|
+
id (UUID):
|
|
279
|
+
body (CreateDurableFunctionBody):
|
|
280
|
+
|
|
281
|
+
Raises:
|
|
282
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
283
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
284
|
+
|
|
285
|
+
Returns:
|
|
286
|
+
DurableFunction | Error
|
|
287
|
+
"""
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
return (await asyncio_detailed(
|
|
291
|
+
id=id,
|
|
292
|
+
client=client,
|
|
293
|
+
body=body,
|
|
294
|
+
|
|
295
|
+
)).parsed
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...types import Response, UNSET
|
|
9
|
+
from ... import errors
|
|
10
|
+
|
|
11
|
+
from ...models.create_function_scheduler_request import CreateFunctionSchedulerRequest
|
|
12
|
+
from ...models.error import Error
|
|
13
|
+
from ...models.function_scheduler import FunctionScheduler
|
|
14
|
+
from typing import cast
|
|
15
|
+
from uuid import UUID
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _get_kwargs(
|
|
20
|
+
id: UUID,
|
|
21
|
+
function_id: str,
|
|
22
|
+
*,
|
|
23
|
+
body: CreateFunctionSchedulerRequest,
|
|
24
|
+
|
|
25
|
+
) -> dict[str, Any]:
|
|
26
|
+
headers: dict[str, Any] = {}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
_kwargs: dict[str, Any] = {
|
|
34
|
+
"method": "post",
|
|
35
|
+
"url": "/projects/{id}/durable-functions/{function_id}/schedulers".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),),
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_kwargs["json"] = body.to_dict()
|
|
39
|
+
|
|
40
|
+
headers["Content-Type"] = "application/json"
|
|
41
|
+
|
|
42
|
+
_kwargs["headers"] = headers
|
|
43
|
+
return _kwargs
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionScheduler | None:
|
|
48
|
+
if response.status_code == 201:
|
|
49
|
+
response_201 = FunctionScheduler.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
return response_201
|
|
54
|
+
|
|
55
|
+
if response.status_code == 400:
|
|
56
|
+
response_400 = Error.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
return response_400
|
|
61
|
+
|
|
62
|
+
if response.status_code == 403:
|
|
63
|
+
response_403 = Error.from_dict(response.json())
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
return response_403
|
|
68
|
+
|
|
69
|
+
if response.status_code == 404:
|
|
70
|
+
response_404 = Error.from_dict(response.json())
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
return response_404
|
|
75
|
+
|
|
76
|
+
if client.raise_on_unexpected_status:
|
|
77
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
78
|
+
else:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionScheduler]:
|
|
83
|
+
return Response(
|
|
84
|
+
status_code=HTTPStatus(response.status_code),
|
|
85
|
+
content=response.content,
|
|
86
|
+
headers=response.headers,
|
|
87
|
+
parsed=_parse_response(client=client, response=response),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync_detailed(
|
|
92
|
+
id: UUID,
|
|
93
|
+
function_id: str,
|
|
94
|
+
*,
|
|
95
|
+
client: AuthenticatedClient,
|
|
96
|
+
body: CreateFunctionSchedulerRequest,
|
|
97
|
+
|
|
98
|
+
) -> Response[Error | FunctionScheduler]:
|
|
99
|
+
""" Create a scheduler for a durable function
|
|
100
|
+
|
|
101
|
+
Each tick starts an execution rather than invoking the function, under
|
|
102
|
+
an execution name derived from the run, so a retried tick resolves to
|
|
103
|
+
the execution it already started. Requested regions must be a subset of
|
|
104
|
+
the function's deployed regions.
|
|
105
|
+
|
|
106
|
+
A tick draws on the same durable allowances and concurrency cap a
|
|
107
|
+
manual start does, and a tick that would exceed the cap fails that run.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
id (UUID):
|
|
111
|
+
function_id (str):
|
|
112
|
+
body (CreateFunctionSchedulerRequest):
|
|
113
|
+
|
|
114
|
+
Raises:
|
|
115
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Response[Error | FunctionScheduler]
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
kwargs = _get_kwargs(
|
|
124
|
+
id=id,
|
|
125
|
+
function_id=function_id,
|
|
126
|
+
body=body,
|
|
127
|
+
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
response = client.get_httpx_client().request(
|
|
131
|
+
**kwargs,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
return _build_response(client=client, response=response)
|
|
135
|
+
|
|
136
|
+
def sync(
|
|
137
|
+
id: UUID,
|
|
138
|
+
function_id: str,
|
|
139
|
+
*,
|
|
140
|
+
client: AuthenticatedClient,
|
|
141
|
+
body: CreateFunctionSchedulerRequest,
|
|
142
|
+
|
|
143
|
+
) -> Error | FunctionScheduler | None:
|
|
144
|
+
""" Create a scheduler for a durable function
|
|
145
|
+
|
|
146
|
+
Each tick starts an execution rather than invoking the function, under
|
|
147
|
+
an execution name derived from the run, so a retried tick resolves to
|
|
148
|
+
the execution it already started. Requested regions must be a subset of
|
|
149
|
+
the function's deployed regions.
|
|
150
|
+
|
|
151
|
+
A tick draws on the same durable allowances and concurrency cap a
|
|
152
|
+
manual start does, and a tick that would exceed the cap fails that run.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
id (UUID):
|
|
156
|
+
function_id (str):
|
|
157
|
+
body (CreateFunctionSchedulerRequest):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Error | FunctionScheduler
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
return sync_detailed(
|
|
169
|
+
id=id,
|
|
170
|
+
function_id=function_id,
|
|
171
|
+
client=client,
|
|
172
|
+
body=body,
|
|
173
|
+
|
|
174
|
+
).parsed
|
|
175
|
+
|
|
176
|
+
async def asyncio_detailed(
|
|
177
|
+
id: UUID,
|
|
178
|
+
function_id: str,
|
|
179
|
+
*,
|
|
180
|
+
client: AuthenticatedClient,
|
|
181
|
+
body: CreateFunctionSchedulerRequest,
|
|
182
|
+
|
|
183
|
+
) -> Response[Error | FunctionScheduler]:
|
|
184
|
+
""" Create a scheduler for a durable function
|
|
185
|
+
|
|
186
|
+
Each tick starts an execution rather than invoking the function, under
|
|
187
|
+
an execution name derived from the run, so a retried tick resolves to
|
|
188
|
+
the execution it already started. Requested regions must be a subset of
|
|
189
|
+
the function's deployed regions.
|
|
190
|
+
|
|
191
|
+
A tick draws on the same durable allowances and concurrency cap a
|
|
192
|
+
manual start does, and a tick that would exceed the cap fails that run.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
id (UUID):
|
|
196
|
+
function_id (str):
|
|
197
|
+
body (CreateFunctionSchedulerRequest):
|
|
198
|
+
|
|
199
|
+
Raises:
|
|
200
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
201
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
202
|
+
|
|
203
|
+
Returns:
|
|
204
|
+
Response[Error | FunctionScheduler]
|
|
205
|
+
"""
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
kwargs = _get_kwargs(
|
|
209
|
+
id=id,
|
|
210
|
+
function_id=function_id,
|
|
211
|
+
body=body,
|
|
212
|
+
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
response = await client.get_async_httpx_client().request(
|
|
216
|
+
**kwargs
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
return _build_response(client=client, response=response)
|
|
220
|
+
|
|
221
|
+
async def asyncio(
|
|
222
|
+
id: UUID,
|
|
223
|
+
function_id: str,
|
|
224
|
+
*,
|
|
225
|
+
client: AuthenticatedClient,
|
|
226
|
+
body: CreateFunctionSchedulerRequest,
|
|
227
|
+
|
|
228
|
+
) -> Error | FunctionScheduler | None:
|
|
229
|
+
""" Create a scheduler for a durable function
|
|
230
|
+
|
|
231
|
+
Each tick starts an execution rather than invoking the function, under
|
|
232
|
+
an execution name derived from the run, so a retried tick resolves to
|
|
233
|
+
the execution it already started. Requested regions must be a subset of
|
|
234
|
+
the function's deployed regions.
|
|
235
|
+
|
|
236
|
+
A tick draws on the same durable allowances and concurrency cap a
|
|
237
|
+
manual start does, and a tick that would exceed the cap fails that run.
|
|
238
|
+
|
|
239
|
+
Args:
|
|
240
|
+
id (UUID):
|
|
241
|
+
function_id (str):
|
|
242
|
+
body (CreateFunctionSchedulerRequest):
|
|
243
|
+
|
|
244
|
+
Raises:
|
|
245
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
246
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
247
|
+
|
|
248
|
+
Returns:
|
|
249
|
+
Error | FunctionScheduler
|
|
250
|
+
"""
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
return (await asyncio_detailed(
|
|
254
|
+
id=id,
|
|
255
|
+
function_id=function_id,
|
|
256
|
+
client=client,
|
|
257
|
+
body=body,
|
|
258
|
+
|
|
259
|
+
)).parsed
|