volcano-sdk-python 0.15.0__py3-none-any.whl → 0.16.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/_durable_callback_token.py +224 -0
- volcano_sdk/_durable_engine.py +13 -6
- volcano_sdk/_durable_modules.py +5 -1
- volcano_sdk/_durable_protocols.py +6 -1
- volcano_sdk/_generated/api/authentication/auth_forgot_password.py +40 -0
- volcano_sdk/_generated/api/authentication/auth_get_password_policy.py +48 -4
- volcano_sdk/_generated/api/authentication/auth_logout.py +110 -7
- volcano_sdk/_generated/api/authentication/auth_refresh.py +32 -0
- volcano_sdk/_generated/api/authentication/auth_reset_password.py +33 -0
- volcano_sdk/_generated/api/authentication/auth_signin.py +33 -0
- volcano_sdk/_generated/api/authentication/auth_signup.py +33 -0
- volcano_sdk/_generated/api/authentication/auth_signup_anonymous.py +50 -10
- volcano_sdk/_generated/api/autofix/get_autofix_run.py +224 -0
- volcano_sdk/_generated/api/autofix/list_autofix_runs.py +294 -0
- volcano_sdk/_generated/api/autofix/start_autofix_run.py +291 -0
- volcano_sdk/_generated/api/durable_functions/fail_durable_callback.py +256 -0
- volcano_sdk/_generated/api/durable_functions/heartbeat_durable_callback.py +248 -0
- volcano_sdk/_generated/api/durable_functions/publish_durable_message.py +12 -4
- volcano_sdk/_generated/api/durable_functions/register_durable_callback.py +276 -0
- volcano_sdk/_generated/api/durable_functions/succeed_durable_callback.py +260 -0
- volcano_sdk/_generated/api/frontends/create_frontend.py +8 -8
- volcano_sdk/_generated/api/functions/invoke_function.py +24 -0
- volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_exchange.py +33 -0
- volcano_sdk/_generated/api/projects/get_project_health.py +8 -4
- volcano_sdk/_generated/api/storage_policies/delete_storage_policy.py +79 -7
- volcano_sdk/_generated/models/__init__.py +44 -0
- volcano_sdk/_generated/models/autofix_diagnosis.py +132 -0
- volcano_sdk/_generated/models/autofix_diagnosis_confidence.py +10 -0
- volcano_sdk/_generated/models/autofix_edit.py +75 -0
- volcano_sdk/_generated/models/autofix_evidence.py +82 -0
- volcano_sdk/_generated/models/autofix_evidence_kind.py +10 -0
- volcano_sdk/_generated/models/autofix_patch.py +86 -0
- volcano_sdk/_generated/models/autofix_pull_request.py +131 -0
- volcano_sdk/_generated/models/autofix_pull_request_skipped.py +10 -0
- volcano_sdk/_generated/models/autofix_pull_request_state.py +10 -0
- volcano_sdk/_generated/models/autofix_run.py +362 -0
- volcano_sdk/_generated/models/autofix_run_status.py +10 -0
- volcano_sdk/_generated/models/autofix_run_trigger.py +10 -0
- volcano_sdk/_generated/models/autofix_run_usage.py +83 -0
- volcano_sdk/_generated/models/create_service_key_body.py +3 -1
- volcano_sdk/_generated/models/durable_callback_error.py +70 -0
- volcano_sdk/_generated/models/durable_callback_outcome.py +85 -0
- volcano_sdk/_generated/models/durable_callback_registration.py +110 -0
- volcano_sdk/_generated/models/durable_callback_status.py +10 -0
- volcano_sdk/_generated/models/durable_execution.py +2 -2
- volcano_sdk/_generated/models/fail_durable_callback_request.py +75 -0
- volcano_sdk/_generated/models/function_invocation_request.py +3 -0
- volcano_sdk/_generated/models/function_invocation_request_payload.py +3 -0
- volcano_sdk/_generated/models/heartbeat_durable_callback_request.py +59 -0
- volcano_sdk/_generated/models/paginated_autofix_runs.py +120 -0
- volcano_sdk/_generated/models/project_health_check.py +6 -1
- volcano_sdk/_generated/models/project_health_resource_type.py +2 -2
- volcano_sdk/_generated/models/project_health_response.py +6 -1
- volcano_sdk/_generated/models/project_health_status.py +2 -2
- volcano_sdk/_generated/models/project_health_summary.py +6 -1
- volcano_sdk/_generated/models/register_durable_callback_request.py +87 -0
- volcano_sdk/_generated/models/succeed_durable_callback_request.py +69 -0
- volcano_sdk/durable.py +5 -5
- volcano_sdk/durable_authoring.py +89 -2
- {volcano_sdk_python-0.15.0.dist-info → volcano_sdk_python-0.16.0.dist-info}/METADATA +7 -5
- {volcano_sdk_python-0.15.0.dist-info → volcano_sdk_python-0.16.0.dist-info}/RECORD +63 -33
- {volcano_sdk_python-0.15.0.dist-info → volcano_sdk_python-0.16.0.dist-info}/WHEEL +0 -0
- {volcano_sdk_python-0.15.0.dist-info → volcano_sdk_python-0.16.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"""Hand a waiting step to another system, with a token Volcano issues for it."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
import inspect
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
from ._durable_callback import is_mapping
|
|
10
|
+
from ._durable_platform_request import PlatformRequest, post_to_platform
|
|
11
|
+
from ._durable_response import json_value
|
|
12
|
+
from ._transport_response import plain_json
|
|
13
|
+
from ._transport_types import decode_json
|
|
14
|
+
from .errors import ConflictError
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from collections.abc import Callable
|
|
18
|
+
|
|
19
|
+
from .models import JSONValue
|
|
20
|
+
|
|
21
|
+
_NOT_READY = "callback_not_ready"
|
|
22
|
+
_CLOSED = "callback_closed"
|
|
23
|
+
_UNREADABLE_REGISTRATION = (
|
|
24
|
+
"Volcano registered the callback with a token this SDK cannot read"
|
|
25
|
+
)
|
|
26
|
+
_UNREADABLE_RESULT = "Volcano resumed the callback with a result this SDK cannot read"
|
|
27
|
+
SYNCHRONOUS_SUBMITTER = (
|
|
28
|
+
"wait_for_callback() requires a synchronous submitter; "
|
|
29
|
+
"nothing would run an async one's hand-off"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class CallbackFailedError(Exception):
|
|
34
|
+
"""Raised by `ctx.wait_for_callback` when the token's holder fails it.
|
|
35
|
+
|
|
36
|
+
`type` and `message` are what it sent. `type` is a name to branch on, such
|
|
37
|
+
as `CardDeclined`.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def __init__(self, error_type: str, message: str) -> None:
|
|
41
|
+
"""Carry the failure's type and message."""
|
|
42
|
+
super().__init__(message)
|
|
43
|
+
self.type: str = error_type
|
|
44
|
+
self.message: str = message
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def token_submitter(
|
|
48
|
+
api_url: str,
|
|
49
|
+
execution_ref: str,
|
|
50
|
+
name: str,
|
|
51
|
+
hand_off: Callable[[str], object],
|
|
52
|
+
operation_id: str | None = None,
|
|
53
|
+
) -> Callable[[str, object], None]:
|
|
54
|
+
"""Build the runtime's submitter: register the callback, then hand its token on.
|
|
55
|
+
|
|
56
|
+
It runs inside the runtime's checkpointed submitter step, so a replay does
|
|
57
|
+
not register the callback again, and a step that runs again registers the
|
|
58
|
+
same callback and gets the same token. `operation_id` names the operation
|
|
59
|
+
an earlier invocation opened the callback under; see `replayed_operation`.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
The submitter the runtime calls with the callback's id.
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def submit(callback_id: str, _context: object) -> None:
|
|
67
|
+
token = register_callback(
|
|
68
|
+
api_url, execution_ref, callback_id, name, operation_id
|
|
69
|
+
)
|
|
70
|
+
# A closed callback already timed out or was answered; the wait
|
|
71
|
+
# resumes as it did.
|
|
72
|
+
if token is not None:
|
|
73
|
+
handed_off(hand_off(token))
|
|
74
|
+
|
|
75
|
+
return submit
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def replayed_operation(context: object) -> str | None:
|
|
79
|
+
"""Name the operation an earlier invocation opened the next callback under.
|
|
80
|
+
|
|
81
|
+
Volcano then reads back to that callback rather than only through recent
|
|
82
|
+
history. Call it just before the runtime's `wait_for_callback`: the wait
|
|
83
|
+
runs in a child context named by the operation about to start, and opens
|
|
84
|
+
the callback as that context's first operation. Neither the next operation
|
|
85
|
+
nor the checkpoint is public, so a runtime without them names no operation
|
|
86
|
+
and the registration reads as a first run's does.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
The callback's operation id, or None when this invocation opens it.
|
|
90
|
+
|
|
91
|
+
"""
|
|
92
|
+
peek = getattr(context, "_peek_next_operation_id", None)
|
|
93
|
+
checkpoint = getattr(getattr(context, "state", None), "get_checkpoint_result", None)
|
|
94
|
+
if not callable(peek) or not callable(checkpoint):
|
|
95
|
+
return None
|
|
96
|
+
operation_id = callback_operation_id(str(peek()))
|
|
97
|
+
existent = getattr(checkpoint(operation_id), "is_existent", None)
|
|
98
|
+
if not callable(existent) or not existent():
|
|
99
|
+
return None
|
|
100
|
+
return operation_id
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def callback_operation_id(child_id: str) -> str:
|
|
104
|
+
"""Name the callback a wait's child context `child_id` opens first.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
The id the runtime checkpoints the callback under.
|
|
108
|
+
|
|
109
|
+
"""
|
|
110
|
+
return hashlib.blake2b(f"{child_id}-1".encode()).hexdigest()[:64]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def require_synchronous(submitter: object) -> None:
|
|
114
|
+
"""Refuse an `async def` submitter before its callback opens.
|
|
115
|
+
|
|
116
|
+
Raises:
|
|
117
|
+
TypeError: The submitter is a coroutine function.
|
|
118
|
+
|
|
119
|
+
"""
|
|
120
|
+
if inspect.iscoroutinefunction(submitter):
|
|
121
|
+
raise TypeError(SYNCHRONOUS_SUBMITTER)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def handed_off(result: object) -> None:
|
|
125
|
+
"""Refuse a hand-off that returned an awaitable rather than running.
|
|
126
|
+
|
|
127
|
+
The runtime calls the submitter on a thread without an event loop, so an
|
|
128
|
+
awaitable it returns would never run.
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
TypeError: The submitter returned an awaitable.
|
|
132
|
+
|
|
133
|
+
"""
|
|
134
|
+
if not inspect.isawaitable(result):
|
|
135
|
+
return
|
|
136
|
+
if inspect.iscoroutine(result):
|
|
137
|
+
result.close()
|
|
138
|
+
raise TypeError(SYNCHRONOUS_SUBMITTER)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def register_callback(
|
|
142
|
+
api_url: str,
|
|
143
|
+
execution_ref: str,
|
|
144
|
+
callback_id: str,
|
|
145
|
+
name: str,
|
|
146
|
+
operation_id: str | None = None,
|
|
147
|
+
) -> str | None:
|
|
148
|
+
"""Ask Volcano for the token that completes the callback.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
The token, or None when the callback stopped waiting before the
|
|
152
|
+
request landed, normally because its timeout passed first.
|
|
153
|
+
|
|
154
|
+
Raises:
|
|
155
|
+
ConflictError: Volcano refused the callback for another reason, such
|
|
156
|
+
as the step being registered for something else.
|
|
157
|
+
TypeError: Volcano answered without a token this SDK can read.
|
|
158
|
+
|
|
159
|
+
"""
|
|
160
|
+
body: dict[str, JSONValue] = {
|
|
161
|
+
"execution_ref": execution_ref,
|
|
162
|
+
"callback_id": callback_id,
|
|
163
|
+
"name": name,
|
|
164
|
+
}
|
|
165
|
+
if operation_id is not None:
|
|
166
|
+
body["operation_id"] = operation_id
|
|
167
|
+
try:
|
|
168
|
+
answer = post_to_platform(
|
|
169
|
+
api_url, PlatformRequest("/durable-callbacks", body, not_ready=_NOT_READY)
|
|
170
|
+
)
|
|
171
|
+
except ConflictError as error:
|
|
172
|
+
if error.code != _CLOSED:
|
|
173
|
+
raise
|
|
174
|
+
return None
|
|
175
|
+
token = answer.get("token") if is_mapping(answer) else None
|
|
176
|
+
if not isinstance(token, str) or not token:
|
|
177
|
+
raise TypeError(_UNREADABLE_REGISTRATION)
|
|
178
|
+
return token
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def callback_result(result: object) -> JSONValue:
|
|
182
|
+
"""Read the result the token's holder succeeded the callback with.
|
|
183
|
+
|
|
184
|
+
The runtime hands it back as the JSON document Volcano sent, or already
|
|
185
|
+
decoded.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
The result, as plain JSON.
|
|
189
|
+
|
|
190
|
+
Raises:
|
|
191
|
+
TypeError: The result is not JSON.
|
|
192
|
+
|
|
193
|
+
"""
|
|
194
|
+
if isinstance(result, (str, bytes)):
|
|
195
|
+
document = result.encode() if isinstance(result, str) else result
|
|
196
|
+
try:
|
|
197
|
+
result = decode_json(document)
|
|
198
|
+
except ValueError as error:
|
|
199
|
+
raise TypeError(_UNREADABLE_RESULT) from error
|
|
200
|
+
return plain_json(json_value(result, _UNREADABLE_RESULT))
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def callback_failure(data: str | None) -> tuple[str, str] | None:
|
|
204
|
+
"""Read the failure Volcano delivered from the runtime's error data.
|
|
205
|
+
|
|
206
|
+
Volcano sends the failure's type and message as the error's data, because
|
|
207
|
+
on replay the runtime rebuilds the error from its message and data alone.
|
|
208
|
+
|
|
209
|
+
Returns:
|
|
210
|
+
The failure's type and message, or None when the data is not one
|
|
211
|
+
Volcano sent, as for a callback that ended because its execution
|
|
212
|
+
stopped.
|
|
213
|
+
|
|
214
|
+
"""
|
|
215
|
+
if data is None:
|
|
216
|
+
return None
|
|
217
|
+
try:
|
|
218
|
+
value = decode_json(data.encode())
|
|
219
|
+
except ValueError:
|
|
220
|
+
return None
|
|
221
|
+
if not is_mapping(value) or not isinstance(error_type := value.get("type"), str):
|
|
222
|
+
return None
|
|
223
|
+
message = value.get("message")
|
|
224
|
+
return error_type, message if isinstance(message, str) else ""
|
volcano_sdk/_durable_engine.py
CHANGED
|
@@ -31,6 +31,7 @@ if TYPE_CHECKING:
|
|
|
31
31
|
WaitForCallbackConfig,
|
|
32
32
|
)
|
|
33
33
|
from aws_durable_execution_sdk_python.config import Duration as EngineDuration
|
|
34
|
+
from aws_durable_execution_sdk_python.exceptions import CallbackExternalError
|
|
34
35
|
from aws_durable_execution_sdk_python.retries import (
|
|
35
36
|
RetryDecision,
|
|
36
37
|
RetryStrategyConfig,
|
|
@@ -121,6 +122,9 @@ class Engine:
|
|
|
121
122
|
config.WaitForCallbackConfig
|
|
122
123
|
)
|
|
123
124
|
self.callback_timeout_error: type[Exception] = exceptions.CallbackTimeoutError
|
|
125
|
+
self.callback_external_error: type[CallbackExternalError] = (
|
|
126
|
+
exceptions.CallbackExternalError
|
|
127
|
+
)
|
|
124
128
|
|
|
125
129
|
def seconds(self, value: int) -> EngineDuration:
|
|
126
130
|
"""Build the runtime's duration from whole seconds.
|
|
@@ -254,7 +258,9 @@ class Engine:
|
|
|
254
258
|
if options.backoff_rate is not None:
|
|
255
259
|
config.backoff_rate = options.backoff_rate
|
|
256
260
|
|
|
257
|
-
def callback_options(
|
|
261
|
+
def callback_options(
|
|
262
|
+
self, timeout: int | None, heartbeat_timeout: int | None = None
|
|
263
|
+
) -> WaitForCallbackConfig:
|
|
258
264
|
"""Build the runtime's callback options.
|
|
259
265
|
|
|
260
266
|
The submitter is not retried by the runtime: it already retries what is
|
|
@@ -264,11 +270,12 @@ class Engine:
|
|
|
264
270
|
The runtime wait-for-callback configuration.
|
|
265
271
|
|
|
266
272
|
"""
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
config = self.wait_for_callback_config(retry_strategy=self._never_retry())
|
|
274
|
+
if timeout is not None:
|
|
275
|
+
config = replace(config, timeout=self.seconds(timeout))
|
|
276
|
+
if heartbeat_timeout is not None:
|
|
277
|
+
config = replace(config, heartbeat_timeout=self.seconds(heartbeat_timeout))
|
|
278
|
+
return config
|
|
272
279
|
|
|
273
280
|
def map_options(self, options: BatchOptions | None) -> object:
|
|
274
281
|
"""Build the runtime's map options.
|
volcano_sdk/_durable_modules.py
CHANGED
|
@@ -20,7 +20,10 @@ if TYPE_CHECKING:
|
|
|
20
20
|
StepSemantics,
|
|
21
21
|
WaitForCallbackConfig,
|
|
22
22
|
)
|
|
23
|
-
from aws_durable_execution_sdk_python.exceptions import
|
|
23
|
+
from aws_durable_execution_sdk_python.exceptions import (
|
|
24
|
+
CallbackExternalError,
|
|
25
|
+
CallbackTimeoutError,
|
|
26
|
+
)
|
|
24
27
|
from aws_durable_execution_sdk_python.retries import (
|
|
25
28
|
RetryDecision,
|
|
26
29
|
RetryStrategyConfig,
|
|
@@ -97,6 +100,7 @@ class ExceptionsModule(Protocol):
|
|
|
97
100
|
"""Runtime errors the authoring adapter turns into values."""
|
|
98
101
|
|
|
99
102
|
CallbackTimeoutError: type[CallbackTimeoutError]
|
|
103
|
+
CallbackExternalError: type[CallbackExternalError]
|
|
100
104
|
|
|
101
105
|
|
|
102
106
|
@runtime_checkable
|
|
@@ -9,6 +9,8 @@ from typing_extensions import TypeVar
|
|
|
9
9
|
if TYPE_CHECKING:
|
|
10
10
|
from collections.abc import Callable, Mapping
|
|
11
11
|
|
|
12
|
+
from aws_durable_execution_sdk_python.exceptions import CallbackExternalError
|
|
13
|
+
|
|
12
14
|
from ._durable_options import BatchOptions, Retry, WaitUntilOptions
|
|
13
15
|
|
|
14
16
|
T = TypeVar("T", default=object)
|
|
@@ -53,10 +55,13 @@ class DurableEngine(Protocol):
|
|
|
53
55
|
"""The operations the Volcano facade needs from the optional runtime."""
|
|
54
56
|
|
|
55
57
|
callback_timeout_error: type[Exception]
|
|
58
|
+
callback_external_error: type[CallbackExternalError]
|
|
56
59
|
|
|
57
60
|
def seconds(self, value: int) -> object: ...
|
|
58
61
|
|
|
59
|
-
def callback_options(
|
|
62
|
+
def callback_options(
|
|
63
|
+
self, timeout: int | None, heartbeat_timeout: int | None = None
|
|
64
|
+
) -> object: ...
|
|
60
65
|
|
|
61
66
|
def step_options(self, *, retry: Retry, at_most_once: bool) -> object: ...
|
|
62
67
|
|
|
@@ -11,6 +11,7 @@ from ... import errors
|
|
|
11
11
|
from ...models.auth_forgot_password_body import AuthForgotPasswordBody
|
|
12
12
|
from ...models.auth_forgot_password_response_200 import AuthForgotPasswordResponse200
|
|
13
13
|
from ...models.error import Error
|
|
14
|
+
from ...types import UNSET, Unset
|
|
14
15
|
from typing import cast
|
|
15
16
|
|
|
16
17
|
|
|
@@ -18,9 +19,17 @@ from typing import cast
|
|
|
18
19
|
def request_kwargs(
|
|
19
20
|
*,
|
|
20
21
|
body: AuthForgotPasswordBody,
|
|
22
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
23
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
21
24
|
|
|
22
25
|
) -> dict[str, Any]:
|
|
23
26
|
headers: dict[str, Any] = {}
|
|
27
|
+
if not isinstance(x_volcano_proxy_authorization, Unset):
|
|
28
|
+
headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization
|
|
29
|
+
|
|
30
|
+
if not isinstance(x_volcano_client_ip, Unset):
|
|
31
|
+
headers["X-Volcano-Client-IP"] = x_volcano_client_ip
|
|
32
|
+
|
|
24
33
|
|
|
25
34
|
|
|
26
35
|
|
|
@@ -49,6 +58,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res
|
|
|
49
58
|
|
|
50
59
|
return response_200
|
|
51
60
|
|
|
61
|
+
if response.status_code == 401:
|
|
62
|
+
response_401 = Error.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return response_401
|
|
67
|
+
|
|
52
68
|
if response.status_code == 403:
|
|
53
69
|
response_403 = Error.from_dict(response.json())
|
|
54
70
|
|
|
@@ -82,6 +98,8 @@ def sync_detailed(
|
|
|
82
98
|
*,
|
|
83
99
|
client: AuthenticatedClient,
|
|
84
100
|
body: AuthForgotPasswordBody,
|
|
101
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
102
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
85
103
|
|
|
86
104
|
) -> Response[AuthForgotPasswordResponse200 | Error]:
|
|
87
105
|
""" Request password reset
|
|
@@ -91,6 +109,8 @@ def sync_detailed(
|
|
|
91
109
|
Project is identified via the anon key.
|
|
92
110
|
|
|
93
111
|
Args:
|
|
112
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
113
|
+
x_volcano_client_ip (str | Unset):
|
|
94
114
|
body (AuthForgotPasswordBody):
|
|
95
115
|
|
|
96
116
|
Raises:
|
|
@@ -104,6 +124,8 @@ def sync_detailed(
|
|
|
104
124
|
|
|
105
125
|
kwargs = request_kwargs(
|
|
106
126
|
body=body,
|
|
127
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
128
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
107
129
|
|
|
108
130
|
)
|
|
109
131
|
|
|
@@ -117,6 +139,8 @@ def sync(
|
|
|
117
139
|
*,
|
|
118
140
|
client: AuthenticatedClient,
|
|
119
141
|
body: AuthForgotPasswordBody,
|
|
142
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
143
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
120
144
|
|
|
121
145
|
) -> AuthForgotPasswordResponse200 | Error | None:
|
|
122
146
|
""" Request password reset
|
|
@@ -126,6 +150,8 @@ def sync(
|
|
|
126
150
|
Project is identified via the anon key.
|
|
127
151
|
|
|
128
152
|
Args:
|
|
153
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
154
|
+
x_volcano_client_ip (str | Unset):
|
|
129
155
|
body (AuthForgotPasswordBody):
|
|
130
156
|
|
|
131
157
|
Raises:
|
|
@@ -140,6 +166,8 @@ def sync(
|
|
|
140
166
|
return sync_detailed(
|
|
141
167
|
client=client,
|
|
142
168
|
body=body,
|
|
169
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
170
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
143
171
|
|
|
144
172
|
).parsed
|
|
145
173
|
|
|
@@ -147,6 +175,8 @@ async def asyncio_detailed(
|
|
|
147
175
|
*,
|
|
148
176
|
client: AuthenticatedClient,
|
|
149
177
|
body: AuthForgotPasswordBody,
|
|
178
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
179
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
150
180
|
|
|
151
181
|
) -> Response[AuthForgotPasswordResponse200 | Error]:
|
|
152
182
|
""" Request password reset
|
|
@@ -156,6 +186,8 @@ async def asyncio_detailed(
|
|
|
156
186
|
Project is identified via the anon key.
|
|
157
187
|
|
|
158
188
|
Args:
|
|
189
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
190
|
+
x_volcano_client_ip (str | Unset):
|
|
159
191
|
body (AuthForgotPasswordBody):
|
|
160
192
|
|
|
161
193
|
Raises:
|
|
@@ -169,6 +201,8 @@ async def asyncio_detailed(
|
|
|
169
201
|
|
|
170
202
|
kwargs = request_kwargs(
|
|
171
203
|
body=body,
|
|
204
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
205
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
172
206
|
|
|
173
207
|
)
|
|
174
208
|
|
|
@@ -182,6 +216,8 @@ async def asyncio(
|
|
|
182
216
|
*,
|
|
183
217
|
client: AuthenticatedClient,
|
|
184
218
|
body: AuthForgotPasswordBody,
|
|
219
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
220
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
185
221
|
|
|
186
222
|
) -> AuthForgotPasswordResponse200 | Error | None:
|
|
187
223
|
""" Request password reset
|
|
@@ -191,6 +227,8 @@ async def asyncio(
|
|
|
191
227
|
Project is identified via the anon key.
|
|
192
228
|
|
|
193
229
|
Args:
|
|
230
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
231
|
+
x_volcano_client_ip (str | Unset):
|
|
194
232
|
body (AuthForgotPasswordBody):
|
|
195
233
|
|
|
196
234
|
Raises:
|
|
@@ -205,5 +243,7 @@ async def asyncio(
|
|
|
205
243
|
return (await asyncio_detailed(
|
|
206
244
|
client=client,
|
|
207
245
|
body=body,
|
|
246
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
247
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
208
248
|
|
|
209
249
|
)).parsed
|
|
@@ -10,14 +10,25 @@ from ... import errors
|
|
|
10
10
|
|
|
11
11
|
from ...models.auth_password_policy import AuthPasswordPolicy
|
|
12
12
|
from ...models.error import Error
|
|
13
|
+
from ...types import UNSET, Unset
|
|
13
14
|
from typing import cast
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def request_kwargs(
|
|
18
|
-
|
|
19
|
+
*,
|
|
20
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
21
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
22
|
+
|
|
19
23
|
) -> dict[str, Any]:
|
|
20
|
-
|
|
24
|
+
headers: dict[str, Any] = {}
|
|
25
|
+
if not isinstance(x_volcano_proxy_authorization, Unset):
|
|
26
|
+
headers["X-Volcano-Proxy-Authorization"] = x_volcano_proxy_authorization
|
|
27
|
+
|
|
28
|
+
if not isinstance(x_volcano_client_ip, Unset):
|
|
29
|
+
headers["X-Volcano-Client-IP"] = x_volcano_client_ip
|
|
30
|
+
|
|
31
|
+
|
|
21
32
|
|
|
22
33
|
|
|
23
34
|
|
|
@@ -29,6 +40,7 @@ def request_kwargs(
|
|
|
29
40
|
}
|
|
30
41
|
|
|
31
42
|
|
|
43
|
+
_kwargs["headers"] = headers
|
|
32
44
|
return _kwargs
|
|
33
45
|
|
|
34
46
|
|
|
@@ -73,6 +85,8 @@ def build_response(*, client: AuthenticatedClient | Client, response: httpx.Resp
|
|
|
73
85
|
def sync_detailed(
|
|
74
86
|
*,
|
|
75
87
|
client: AuthenticatedClient,
|
|
88
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
89
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
76
90
|
|
|
77
91
|
) -> Response[AuthPasswordPolicy | Error]:
|
|
78
92
|
""" Get the effective password policy
|
|
@@ -81,6 +95,10 @@ def sync_detailed(
|
|
|
81
95
|
screening status for the project identified by the anon key. A valid
|
|
82
96
|
anon key is required, but no route-specific auth permission is needed.
|
|
83
97
|
|
|
98
|
+
Args:
|
|
99
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
100
|
+
x_volcano_client_ip (str | Unset):
|
|
101
|
+
|
|
84
102
|
Raises:
|
|
85
103
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
86
104
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
@@ -91,7 +109,9 @@ def sync_detailed(
|
|
|
91
109
|
|
|
92
110
|
|
|
93
111
|
kwargs = request_kwargs(
|
|
94
|
-
|
|
112
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
113
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
114
|
+
|
|
95
115
|
)
|
|
96
116
|
|
|
97
117
|
response = client.get_httpx_client().request(
|
|
@@ -103,6 +123,8 @@ def sync_detailed(
|
|
|
103
123
|
def sync(
|
|
104
124
|
*,
|
|
105
125
|
client: AuthenticatedClient,
|
|
126
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
127
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
106
128
|
|
|
107
129
|
) -> AuthPasswordPolicy | Error | None:
|
|
108
130
|
""" Get the effective password policy
|
|
@@ -111,6 +133,10 @@ def sync(
|
|
|
111
133
|
screening status for the project identified by the anon key. A valid
|
|
112
134
|
anon key is required, but no route-specific auth permission is needed.
|
|
113
135
|
|
|
136
|
+
Args:
|
|
137
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
138
|
+
x_volcano_client_ip (str | Unset):
|
|
139
|
+
|
|
114
140
|
Raises:
|
|
115
141
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
142
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
@@ -122,12 +148,16 @@ def sync(
|
|
|
122
148
|
|
|
123
149
|
return sync_detailed(
|
|
124
150
|
client=client,
|
|
151
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
152
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
125
153
|
|
|
126
154
|
).parsed
|
|
127
155
|
|
|
128
156
|
async def asyncio_detailed(
|
|
129
157
|
*,
|
|
130
158
|
client: AuthenticatedClient,
|
|
159
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
160
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
131
161
|
|
|
132
162
|
) -> Response[AuthPasswordPolicy | Error]:
|
|
133
163
|
""" Get the effective password policy
|
|
@@ -136,6 +166,10 @@ async def asyncio_detailed(
|
|
|
136
166
|
screening status for the project identified by the anon key. A valid
|
|
137
167
|
anon key is required, but no route-specific auth permission is needed.
|
|
138
168
|
|
|
169
|
+
Args:
|
|
170
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
171
|
+
x_volcano_client_ip (str | Unset):
|
|
172
|
+
|
|
139
173
|
Raises:
|
|
140
174
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
141
175
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
@@ -146,7 +180,9 @@ async def asyncio_detailed(
|
|
|
146
180
|
|
|
147
181
|
|
|
148
182
|
kwargs = request_kwargs(
|
|
149
|
-
|
|
183
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
184
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
185
|
+
|
|
150
186
|
)
|
|
151
187
|
|
|
152
188
|
response = await client.get_async_httpx_client().request(
|
|
@@ -158,6 +194,8 @@ async def asyncio_detailed(
|
|
|
158
194
|
async def asyncio(
|
|
159
195
|
*,
|
|
160
196
|
client: AuthenticatedClient,
|
|
197
|
+
x_volcano_proxy_authorization: str | Unset = UNSET,
|
|
198
|
+
x_volcano_client_ip: str | Unset = UNSET,
|
|
161
199
|
|
|
162
200
|
) -> AuthPasswordPolicy | Error | None:
|
|
163
201
|
""" Get the effective password policy
|
|
@@ -166,6 +204,10 @@ async def asyncio(
|
|
|
166
204
|
screening status for the project identified by the anon key. A valid
|
|
167
205
|
anon key is required, but no route-specific auth permission is needed.
|
|
168
206
|
|
|
207
|
+
Args:
|
|
208
|
+
x_volcano_proxy_authorization (str | Unset):
|
|
209
|
+
x_volcano_client_ip (str | Unset):
|
|
210
|
+
|
|
169
211
|
Raises:
|
|
170
212
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
171
213
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
@@ -177,5 +219,7 @@ async def asyncio(
|
|
|
177
219
|
|
|
178
220
|
return (await asyncio_detailed(
|
|
179
221
|
client=client,
|
|
222
|
+
x_volcano_proxy_authorization=x_volcano_proxy_authorization,
|
|
223
|
+
x_volcano_client_ip=x_volcano_client_ip,
|
|
180
224
|
|
|
181
225
|
)).parsed
|