blaxel 0.1.16__py3-none-any.whl → 0.1.17__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.
- blaxel/authentication/clientcredentials.py +1 -1
- blaxel/client/api/jobs/__init__.py +0 -0
- blaxel/client/api/{default/get_template_file_contents.py → jobs/create_job.py} +57 -44
- blaxel/client/api/jobs/delete_job.py +154 -0
- blaxel/client/api/{default/get_template_contents.py → jobs/get_job.py} +43 -30
- blaxel/client/api/jobs/list_job_revisions.py +159 -0
- blaxel/client/api/jobs/list_jobs.py +135 -0
- blaxel/client/api/jobs/update_job.py +179 -0
- blaxel/client/models/__init__.py +34 -0
- blaxel/client/models/job.py +129 -0
- blaxel/client/models/job_execution_config.py +79 -0
- blaxel/client/models/job_metrics.py +199 -0
- blaxel/client/models/job_metrics_executions_chart.py +45 -0
- blaxel/client/models/job_metrics_executions_total.py +45 -0
- blaxel/client/models/job_metrics_tasks_chart.py +45 -0
- blaxel/client/models/job_metrics_tasks_total.py +45 -0
- blaxel/client/models/job_spec.py +208 -0
- blaxel/client/models/jobs_chart.py +94 -0
- blaxel/client/models/jobs_chart_value.py +70 -0
- blaxel/client/models/jobs_executions.py +88 -0
- blaxel/client/models/jobs_network_chart.py +94 -0
- blaxel/client/models/jobs_success_failed_chart.py +139 -0
- blaxel/client/models/jobs_tasks.py +88 -0
- blaxel/client/models/jobs_total.py +97 -0
- blaxel/client/models/preview_spec.py +55 -1
- blaxel/client/models/preview_spec_request_headers.py +48 -0
- blaxel/{sandbox/client/models/get_process_identifier_logs_response_200.py → client/models/preview_spec_response_headers.py} +6 -6
- blaxel/client/models/runtime.py +18 -0
- blaxel/client/models/serverless_config.py +9 -0
- blaxel/common/internal.py +0 -2
- blaxel/common/logger.py +2 -0
- blaxel/instrumentation/manager.py +1 -1
- blaxel/jobs/__init__.py +4 -8
- blaxel/sandbox/client/api/filesystem/delete_filesystem_path.py +4 -0
- blaxel/sandbox/client/api/filesystem/get_filesystem_path.py +4 -0
- blaxel/sandbox/client/api/filesystem/get_watch_filesystem_path.py +22 -1
- blaxel/sandbox/client/api/filesystem/put_filesystem_path.py +8 -4
- blaxel/sandbox/client/api/network/delete_network_process_pid_monitor.py +4 -0
- blaxel/sandbox/client/api/network/get_network_process_pid_ports.py +4 -0
- blaxel/sandbox/client/api/network/post_network_process_pid_monitor.py +4 -0
- blaxel/sandbox/client/api/process/delete_process_identifier.py +4 -0
- blaxel/sandbox/client/api/process/delete_process_identifier_kill.py +4 -0
- blaxel/sandbox/client/api/process/get_process_identifier_logs.py +16 -16
- blaxel/sandbox/client/api/process/get_process_identifier_logs_stream.py +4 -0
- blaxel/sandbox/client/api/process/get_ws_process_identifier_logs_stream.py +8 -8
- blaxel/sandbox/client/api/process/post_process.py +4 -0
- blaxel/sandbox/client/models/__init__.py +4 -2
- blaxel/sandbox/client/models/directory.py +9 -0
- blaxel/sandbox/client/models/file.py +9 -0
- blaxel/sandbox/client/models/file_with_content.py +9 -0
- blaxel/sandbox/client/models/process_logs.py +78 -0
- blaxel/sandbox/client/models/process_response.py +12 -4
- blaxel/sandbox/client/models/process_response_status.py +12 -0
- blaxel/sandbox/client/models/subdirectory.py +9 -0
- blaxel/sandbox/preview.py +13 -17
- blaxel/sandbox/process.py +8 -9
- {blaxel-0.1.16.dist-info → blaxel-0.1.17.dist-info}/METADATA +1 -1
- {blaxel-0.1.16.dist-info → blaxel-0.1.17.dist-info}/RECORD +60 -37
- {blaxel-0.1.16.dist-info → blaxel-0.1.17.dist-info}/WHEEL +0 -0
- {blaxel-0.1.16.dist-info → blaxel-0.1.17.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="PreviewSpecRequestHeaders")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class PreviewSpecRequestHeaders:
|
11
|
+
"""Those headers will be set in all requests to your preview. This is especially useful to set the Authorization
|
12
|
+
header.
|
13
|
+
|
14
|
+
"""
|
15
|
+
|
16
|
+
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
17
|
+
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
19
|
+
field_dict: dict[str, Any] = {}
|
20
|
+
field_dict.update(self.additional_properties)
|
21
|
+
|
22
|
+
return field_dict
|
23
|
+
|
24
|
+
@classmethod
|
25
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
26
|
+
if not src_dict:
|
27
|
+
return None
|
28
|
+
d = src_dict.copy()
|
29
|
+
preview_spec_request_headers = cls()
|
30
|
+
|
31
|
+
preview_spec_request_headers.additional_properties = d
|
32
|
+
return preview_spec_request_headers
|
33
|
+
|
34
|
+
@property
|
35
|
+
def additional_keys(self) -> list[str]:
|
36
|
+
return list(self.additional_properties.keys())
|
37
|
+
|
38
|
+
def __getitem__(self, key: str) -> str:
|
39
|
+
return self.additional_properties[key]
|
40
|
+
|
41
|
+
def __setitem__(self, key: str, value: str) -> None:
|
42
|
+
self.additional_properties[key] = value
|
43
|
+
|
44
|
+
def __delitem__(self, key: str) -> None:
|
45
|
+
del self.additional_properties[key]
|
46
|
+
|
47
|
+
def __contains__(self, key: str) -> bool:
|
48
|
+
return key in self.additional_properties
|
@@ -3,12 +3,12 @@ from typing import Any, TypeVar
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
|
-
T = TypeVar("T", bound="
|
6
|
+
T = TypeVar("T", bound="PreviewSpecResponseHeaders")
|
7
7
|
|
8
8
|
|
9
9
|
@_attrs_define
|
10
|
-
class
|
11
|
-
""" """
|
10
|
+
class PreviewSpecResponseHeaders:
|
11
|
+
"""Those headers will be set in all responses of your preview. This is especially useful to set the CORS headers."""
|
12
12
|
|
13
13
|
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
14
14
|
|
@@ -23,10 +23,10 @@ class GetProcessIdentifierLogsResponse200:
|
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
26
|
-
|
26
|
+
preview_spec_response_headers = cls()
|
27
27
|
|
28
|
-
|
29
|
-
return
|
28
|
+
preview_spec_response_headers.additional_properties = d
|
29
|
+
return preview_spec_response_headers
|
30
30
|
|
31
31
|
@property
|
32
32
|
def additional_keys(self) -> list[str]:
|
blaxel/client/models/runtime.py
CHANGED
@@ -29,6 +29,8 @@ class Runtime:
|
|
29
29
|
EnvVar types
|
30
30
|
generation (Union[Unset, str]): The generation of the deployment
|
31
31
|
image (Union[Unset, str]): The Docker image for the deployment
|
32
|
+
max_concurrent_tasks (Union[Unset, int]): The maximum number of concurrent task for an execution
|
33
|
+
max_retries (Union[Unset, int]): The maximum number of retries for the deployment
|
32
34
|
max_scale (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which case
|
33
35
|
the deployment is always running in at least one location).
|
34
36
|
memory (Union[Unset, int]): The memory for the deployment in MB
|
@@ -50,6 +52,8 @@ class Runtime:
|
|
50
52
|
envs: Union[Unset, list[Any]] = UNSET
|
51
53
|
generation: Union[Unset, str] = UNSET
|
52
54
|
image: Union[Unset, str] = UNSET
|
55
|
+
max_concurrent_tasks: Union[Unset, int] = UNSET
|
56
|
+
max_retries: Union[Unset, int] = UNSET
|
53
57
|
max_scale: Union[Unset, int] = UNSET
|
54
58
|
memory: Union[Unset, int] = UNSET
|
55
59
|
metric_port: Union[Unset, int] = UNSET
|
@@ -93,6 +97,10 @@ class Runtime:
|
|
93
97
|
|
94
98
|
image = self.image
|
95
99
|
|
100
|
+
max_concurrent_tasks = self.max_concurrent_tasks
|
101
|
+
|
102
|
+
max_retries = self.max_retries
|
103
|
+
|
96
104
|
max_scale = self.max_scale
|
97
105
|
|
98
106
|
memory = self.memory
|
@@ -148,6 +156,10 @@ class Runtime:
|
|
148
156
|
field_dict["generation"] = generation
|
149
157
|
if image is not UNSET:
|
150
158
|
field_dict["image"] = image
|
159
|
+
if max_concurrent_tasks is not UNSET:
|
160
|
+
field_dict["maxConcurrentTasks"] = max_concurrent_tasks
|
161
|
+
if max_retries is not UNSET:
|
162
|
+
field_dict["maxRetries"] = max_retries
|
151
163
|
if max_scale is not UNSET:
|
152
164
|
field_dict["maxScale"] = max_scale
|
153
165
|
if memory is not UNSET:
|
@@ -201,6 +213,10 @@ class Runtime:
|
|
201
213
|
|
202
214
|
image = d.pop("image", UNSET)
|
203
215
|
|
216
|
+
max_concurrent_tasks = d.pop("maxConcurrentTasks", UNSET)
|
217
|
+
|
218
|
+
max_retries = d.pop("maxRetries", UNSET)
|
219
|
+
|
204
220
|
max_scale = d.pop("maxScale", UNSET)
|
205
221
|
|
206
222
|
memory = d.pop("memory", UNSET)
|
@@ -240,6 +256,8 @@ class Runtime:
|
|
240
256
|
envs=envs,
|
241
257
|
generation=generation,
|
242
258
|
image=image,
|
259
|
+
max_concurrent_tasks=max_concurrent_tasks,
|
260
|
+
max_retries=max_retries,
|
243
261
|
max_scale=max_scale,
|
244
262
|
memory=memory,
|
245
263
|
metric_port=metric_port,
|
@@ -18,6 +18,7 @@ class ServerlessConfig:
|
|
18
18
|
|
19
19
|
Attributes:
|
20
20
|
configuration (Union[Unset, ServerlessConfigConfiguration]): The configuration for the deployment
|
21
|
+
max_retries (Union[Unset, int]): The maximum number of retries for the deployment
|
21
22
|
max_scale (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which case
|
22
23
|
the deployment is always running in at least one location).
|
23
24
|
min_scale (Union[Unset, int]): The maximum number of replicas for the deployment.
|
@@ -25,6 +26,7 @@ class ServerlessConfig:
|
|
25
26
|
"""
|
26
27
|
|
27
28
|
configuration: Union[Unset, "ServerlessConfigConfiguration"] = UNSET
|
29
|
+
max_retries: Union[Unset, int] = UNSET
|
28
30
|
max_scale: Union[Unset, int] = UNSET
|
29
31
|
min_scale: Union[Unset, int] = UNSET
|
30
32
|
timeout: Union[Unset, int] = UNSET
|
@@ -41,6 +43,8 @@ class ServerlessConfig:
|
|
41
43
|
elif self.configuration and isinstance(self.configuration, dict):
|
42
44
|
configuration = self.configuration
|
43
45
|
|
46
|
+
max_retries = self.max_retries
|
47
|
+
|
44
48
|
max_scale = self.max_scale
|
45
49
|
|
46
50
|
min_scale = self.min_scale
|
@@ -52,6 +56,8 @@ class ServerlessConfig:
|
|
52
56
|
field_dict.update({})
|
53
57
|
if configuration is not UNSET:
|
54
58
|
field_dict["configuration"] = configuration
|
59
|
+
if max_retries is not UNSET:
|
60
|
+
field_dict["maxRetries"] = max_retries
|
55
61
|
if max_scale is not UNSET:
|
56
62
|
field_dict["maxScale"] = max_scale
|
57
63
|
if min_scale is not UNSET:
|
@@ -75,6 +81,8 @@ class ServerlessConfig:
|
|
75
81
|
else:
|
76
82
|
configuration = ServerlessConfigConfiguration.from_dict(_configuration)
|
77
83
|
|
84
|
+
max_retries = d.pop("maxRetries", UNSET)
|
85
|
+
|
78
86
|
max_scale = d.pop("maxScale", UNSET)
|
79
87
|
|
80
88
|
min_scale = d.pop("minScale", UNSET)
|
@@ -83,6 +91,7 @@ class ServerlessConfig:
|
|
83
91
|
|
84
92
|
serverless_config = cls(
|
85
93
|
configuration=configuration,
|
94
|
+
max_retries=max_retries,
|
86
95
|
max_scale=max_scale,
|
87
96
|
min_scale=min_scale,
|
88
97
|
timeout=timeout,
|
blaxel/common/internal.py
CHANGED
blaxel/common/logger.py
CHANGED
@@ -5,9 +5,9 @@ It includes classes and functions for configuring tracers, meters, loggers, and
|
|
5
5
|
|
6
6
|
import importlib
|
7
7
|
import logging
|
8
|
+
import os
|
8
9
|
import signal
|
9
10
|
import time
|
10
|
-
import os
|
11
11
|
from typing import Any, Dict, List, Optional, Type
|
12
12
|
|
13
13
|
from opentelemetry import metrics, trace
|
blaxel/jobs/__init__.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import argparse
|
2
|
+
import asyncio
|
2
3
|
import os
|
3
4
|
import sys
|
4
|
-
import
|
5
|
-
import
|
5
|
+
from logging import getLogger
|
6
|
+
from typing import Any, Awaitable, Callable, Dict
|
6
7
|
|
8
|
+
import requests
|
7
9
|
|
8
|
-
from typing import Any, Dict, Callable, Awaitable
|
9
|
-
from logging import getLogger
|
10
10
|
from ..client import client
|
11
11
|
from ..common.env import env
|
12
12
|
from ..common.internal import get_global_unique_hash
|
@@ -14,7 +14,6 @@ from ..common.settings import settings
|
|
14
14
|
from ..instrumentation.span import SpanManager
|
15
15
|
|
16
16
|
|
17
|
-
|
18
17
|
class BlJobWrapper:
|
19
18
|
def get_arguments(self) -> Dict[str, Any]:
|
20
19
|
if not os.getenv('BL_EXECUTION_DATA_URL'):
|
@@ -50,9 +49,6 @@ class BlJobWrapper:
|
|
50
49
|
Handles both async and sync functions.
|
51
50
|
Arguments are passed as keyword arguments to the function.
|
52
51
|
"""
|
53
|
-
attributes = {
|
54
|
-
"span.type": "job.start",
|
55
|
-
}
|
56
52
|
try:
|
57
53
|
parsed_args = self.get_arguments()
|
58
54
|
if asyncio.iscoroutinefunction(func):
|
@@ -39,6 +39,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
39
39
|
response_404 = ErrorResponse.from_dict(response.json())
|
40
40
|
|
41
41
|
return response_404
|
42
|
+
if response.status_code == 422:
|
43
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
44
|
+
|
45
|
+
return response_422
|
42
46
|
if response.status_code == 500:
|
43
47
|
response_500 = ErrorResponse.from_dict(response.json())
|
44
48
|
|
@@ -49,6 +49,10 @@ def _parse_response(
|
|
49
49
|
response_404 = ErrorResponse.from_dict(response.json())
|
50
50
|
|
51
51
|
return response_404
|
52
|
+
if response.status_code == 422:
|
53
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
54
|
+
|
55
|
+
return response_422
|
52
56
|
if response.status_code == 500:
|
53
57
|
response_500 = ErrorResponse.from_dict(response.json())
|
54
58
|
|
@@ -6,15 +6,24 @@ import httpx
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import Client
|
8
8
|
from ...models.error_response import ErrorResponse
|
9
|
-
from ...types import Response
|
9
|
+
from ...types import UNSET, Response, Unset
|
10
10
|
|
11
11
|
|
12
12
|
def _get_kwargs(
|
13
13
|
path: str,
|
14
|
+
*,
|
15
|
+
ignore: Union[Unset, str] = UNSET,
|
14
16
|
) -> dict[str, Any]:
|
17
|
+
params: dict[str, Any] = {}
|
18
|
+
|
19
|
+
params["ignore"] = ignore
|
20
|
+
|
21
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
22
|
+
|
15
23
|
_kwargs: dict[str, Any] = {
|
16
24
|
"method": "get",
|
17
25
|
"url": f"/watch/filesystem/{path}",
|
26
|
+
"params": params,
|
18
27
|
}
|
19
28
|
|
20
29
|
return _kwargs
|
@@ -51,6 +60,7 @@ def sync_detailed(
|
|
51
60
|
path: str,
|
52
61
|
*,
|
53
62
|
client: Union[Client],
|
63
|
+
ignore: Union[Unset, str] = UNSET,
|
54
64
|
) -> Response[Union[ErrorResponse, str]]:
|
55
65
|
"""Stream file modification events in a directory
|
56
66
|
|
@@ -59,6 +69,7 @@ def sync_detailed(
|
|
59
69
|
|
60
70
|
Args:
|
61
71
|
path (str):
|
72
|
+
ignore (Union[Unset, str]):
|
62
73
|
|
63
74
|
Raises:
|
64
75
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -70,6 +81,7 @@ def sync_detailed(
|
|
70
81
|
|
71
82
|
kwargs = _get_kwargs(
|
72
83
|
path=path,
|
84
|
+
ignore=ignore,
|
73
85
|
)
|
74
86
|
|
75
87
|
response = client.get_httpx_client().request(
|
@@ -83,6 +95,7 @@ def sync(
|
|
83
95
|
path: str,
|
84
96
|
*,
|
85
97
|
client: Union[Client],
|
98
|
+
ignore: Union[Unset, str] = UNSET,
|
86
99
|
) -> Optional[Union[ErrorResponse, str]]:
|
87
100
|
"""Stream file modification events in a directory
|
88
101
|
|
@@ -91,6 +104,7 @@ def sync(
|
|
91
104
|
|
92
105
|
Args:
|
93
106
|
path (str):
|
107
|
+
ignore (Union[Unset, str]):
|
94
108
|
|
95
109
|
Raises:
|
96
110
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -103,6 +117,7 @@ def sync(
|
|
103
117
|
return sync_detailed(
|
104
118
|
path=path,
|
105
119
|
client=client,
|
120
|
+
ignore=ignore,
|
106
121
|
).parsed
|
107
122
|
|
108
123
|
|
@@ -110,6 +125,7 @@ async def asyncio_detailed(
|
|
110
125
|
path: str,
|
111
126
|
*,
|
112
127
|
client: Union[Client],
|
128
|
+
ignore: Union[Unset, str] = UNSET,
|
113
129
|
) -> Response[Union[ErrorResponse, str]]:
|
114
130
|
"""Stream file modification events in a directory
|
115
131
|
|
@@ -118,6 +134,7 @@ async def asyncio_detailed(
|
|
118
134
|
|
119
135
|
Args:
|
120
136
|
path (str):
|
137
|
+
ignore (Union[Unset, str]):
|
121
138
|
|
122
139
|
Raises:
|
123
140
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -129,6 +146,7 @@ async def asyncio_detailed(
|
|
129
146
|
|
130
147
|
kwargs = _get_kwargs(
|
131
148
|
path=path,
|
149
|
+
ignore=ignore,
|
132
150
|
)
|
133
151
|
|
134
152
|
response = await client.get_async_httpx_client().request(**kwargs)
|
@@ -140,6 +158,7 @@ async def asyncio(
|
|
140
158
|
path: str,
|
141
159
|
*,
|
142
160
|
client: Union[Client],
|
161
|
+
ignore: Union[Unset, str] = UNSET,
|
143
162
|
) -> Optional[Union[ErrorResponse, str]]:
|
144
163
|
"""Stream file modification events in a directory
|
145
164
|
|
@@ -148,6 +167,7 @@ async def asyncio(
|
|
148
167
|
|
149
168
|
Args:
|
150
169
|
path (str):
|
170
|
+
ignore (Union[Unset, str]):
|
151
171
|
|
152
172
|
Raises:
|
153
173
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -161,5 +181,6 @@ async def asyncio(
|
|
161
181
|
await asyncio_detailed(
|
162
182
|
path=path,
|
163
183
|
client=client,
|
184
|
+
ignore=ignore,
|
164
185
|
)
|
165
186
|
).parsed
|
@@ -44,6 +44,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
44
44
|
response_400 = ErrorResponse.from_dict(response.json())
|
45
45
|
|
46
46
|
return response_400
|
47
|
+
if response.status_code == 422:
|
48
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
49
|
+
|
50
|
+
return response_422
|
47
51
|
if response.status_code == 500:
|
48
52
|
response_500 = ErrorResponse.from_dict(response.json())
|
49
53
|
|
@@ -69,7 +73,7 @@ def sync_detailed(
|
|
69
73
|
client: Union[Client],
|
70
74
|
body: FileRequest,
|
71
75
|
) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
72
|
-
"""Create or update file or directory
|
76
|
+
"""Create or update a file or directory
|
73
77
|
|
74
78
|
Create or update a file or directory
|
75
79
|
|
@@ -103,7 +107,7 @@ def sync(
|
|
103
107
|
client: Union[Client],
|
104
108
|
body: FileRequest,
|
105
109
|
) -> Optional[Union[ErrorResponse, SuccessResponse]]:
|
106
|
-
"""Create or update file or directory
|
110
|
+
"""Create or update a file or directory
|
107
111
|
|
108
112
|
Create or update a file or directory
|
109
113
|
|
@@ -132,7 +136,7 @@ async def asyncio_detailed(
|
|
132
136
|
client: Union[Client],
|
133
137
|
body: FileRequest,
|
134
138
|
) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
135
|
-
"""Create or update file or directory
|
139
|
+
"""Create or update a file or directory
|
136
140
|
|
137
141
|
Create or update a file or directory
|
138
142
|
|
@@ -164,7 +168,7 @@ async def asyncio(
|
|
164
168
|
client: Union[Client],
|
165
169
|
body: FileRequest,
|
166
170
|
) -> Optional[Union[ErrorResponse, SuccessResponse]]:
|
167
|
-
"""Create or update file or directory
|
171
|
+
"""Create or update a file or directory
|
168
172
|
|
169
173
|
Create or update a file or directory
|
170
174
|
|
@@ -34,6 +34,10 @@ def _parse_response(
|
|
34
34
|
response_400 = ErrorResponse.from_dict(response.json())
|
35
35
|
|
36
36
|
return response_400
|
37
|
+
if response.status_code == 422:
|
38
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
39
|
+
|
40
|
+
return response_422
|
37
41
|
if response.status_code == 500:
|
38
42
|
response_500 = ErrorResponse.from_dict(response.json())
|
39
43
|
|
@@ -34,6 +34,10 @@ def _parse_response(
|
|
34
34
|
response_400 = ErrorResponse.from_dict(response.json())
|
35
35
|
|
36
36
|
return response_400
|
37
|
+
if response.status_code == 422:
|
38
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
39
|
+
|
40
|
+
return response_422
|
37
41
|
if response.status_code == 500:
|
38
42
|
response_500 = ErrorResponse.from_dict(response.json())
|
39
43
|
|
@@ -48,6 +48,10 @@ def _parse_response(
|
|
48
48
|
response_400 = ErrorResponse.from_dict(response.json())
|
49
49
|
|
50
50
|
return response_400
|
51
|
+
if response.status_code == 422:
|
52
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
53
|
+
|
54
|
+
return response_422
|
51
55
|
if response.status_code == 500:
|
52
56
|
response_500 = ErrorResponse.from_dict(response.json())
|
53
57
|
|
@@ -30,6 +30,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
30
30
|
response_404 = ErrorResponse.from_dict(response.json())
|
31
31
|
|
32
32
|
return response_404
|
33
|
+
if response.status_code == 422:
|
34
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
35
|
+
|
36
|
+
return response_422
|
33
37
|
if response.status_code == 500:
|
34
38
|
response_500 = ErrorResponse.from_dict(response.json())
|
35
39
|
|
@@ -44,6 +44,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
44
44
|
response_404 = ErrorResponse.from_dict(response.json())
|
45
45
|
|
46
46
|
return response_404
|
47
|
+
if response.status_code == 422:
|
48
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
49
|
+
|
50
|
+
return response_422
|
47
51
|
if response.status_code == 500:
|
48
52
|
response_500 = ErrorResponse.from_dict(response.json())
|
49
53
|
|
@@ -6,7 +6,7 @@ import httpx
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import Client
|
8
8
|
from ...models.error_response import ErrorResponse
|
9
|
-
from ...models.
|
9
|
+
from ...models.process_logs import ProcessLogs
|
10
10
|
from ...types import Response
|
11
11
|
|
12
12
|
|
@@ -21,17 +21,19 @@ def _get_kwargs(
|
|
21
21
|
return _kwargs
|
22
22
|
|
23
23
|
|
24
|
-
def _parse_response(
|
25
|
-
*, client: Client, response: httpx.Response
|
26
|
-
) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
24
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ErrorResponse, ProcessLogs]]:
|
27
25
|
if response.status_code == 200:
|
28
|
-
response_200 =
|
26
|
+
response_200 = ProcessLogs.from_dict(response.json())
|
29
27
|
|
30
28
|
return response_200
|
31
29
|
if response.status_code == 404:
|
32
30
|
response_404 = ErrorResponse.from_dict(response.json())
|
33
31
|
|
34
32
|
return response_404
|
33
|
+
if response.status_code == 422:
|
34
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
35
|
+
|
36
|
+
return response_422
|
35
37
|
if response.status_code == 500:
|
36
38
|
response_500 = ErrorResponse.from_dict(response.json())
|
37
39
|
|
@@ -42,9 +44,7 @@ def _parse_response(
|
|
42
44
|
return None
|
43
45
|
|
44
46
|
|
45
|
-
def _build_response(
|
46
|
-
*, client: Client, response: httpx.Response
|
47
|
-
) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
47
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, ProcessLogs]]:
|
48
48
|
return Response(
|
49
49
|
status_code=HTTPStatus(response.status_code),
|
50
50
|
content=response.content,
|
@@ -57,7 +57,7 @@ def sync_detailed(
|
|
57
57
|
identifier: str,
|
58
58
|
*,
|
59
59
|
client: Union[Client],
|
60
|
-
) -> Response[Union[ErrorResponse,
|
60
|
+
) -> Response[Union[ErrorResponse, ProcessLogs]]:
|
61
61
|
"""Get process logs
|
62
62
|
|
63
63
|
Get the stdout and stderr output of a process
|
@@ -70,7 +70,7 @@ def sync_detailed(
|
|
70
70
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
71
71
|
|
72
72
|
Returns:
|
73
|
-
Response[Union[ErrorResponse,
|
73
|
+
Response[Union[ErrorResponse, ProcessLogs]]
|
74
74
|
"""
|
75
75
|
|
76
76
|
kwargs = _get_kwargs(
|
@@ -88,7 +88,7 @@ def sync(
|
|
88
88
|
identifier: str,
|
89
89
|
*,
|
90
90
|
client: Union[Client],
|
91
|
-
) -> Optional[Union[ErrorResponse,
|
91
|
+
) -> Optional[Union[ErrorResponse, ProcessLogs]]:
|
92
92
|
"""Get process logs
|
93
93
|
|
94
94
|
Get the stdout and stderr output of a process
|
@@ -101,7 +101,7 @@ def sync(
|
|
101
101
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
102
102
|
|
103
103
|
Returns:
|
104
|
-
Union[ErrorResponse,
|
104
|
+
Union[ErrorResponse, ProcessLogs]
|
105
105
|
"""
|
106
106
|
|
107
107
|
return sync_detailed(
|
@@ -114,7 +114,7 @@ async def asyncio_detailed(
|
|
114
114
|
identifier: str,
|
115
115
|
*,
|
116
116
|
client: Union[Client],
|
117
|
-
) -> Response[Union[ErrorResponse,
|
117
|
+
) -> Response[Union[ErrorResponse, ProcessLogs]]:
|
118
118
|
"""Get process logs
|
119
119
|
|
120
120
|
Get the stdout and stderr output of a process
|
@@ -127,7 +127,7 @@ async def asyncio_detailed(
|
|
127
127
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
128
128
|
|
129
129
|
Returns:
|
130
|
-
Response[Union[ErrorResponse,
|
130
|
+
Response[Union[ErrorResponse, ProcessLogs]]
|
131
131
|
"""
|
132
132
|
|
133
133
|
kwargs = _get_kwargs(
|
@@ -143,7 +143,7 @@ async def asyncio(
|
|
143
143
|
identifier: str,
|
144
144
|
*,
|
145
145
|
client: Union[Client],
|
146
|
-
) -> Optional[Union[ErrorResponse,
|
146
|
+
) -> Optional[Union[ErrorResponse, ProcessLogs]]:
|
147
147
|
"""Get process logs
|
148
148
|
|
149
149
|
Get the stdout and stderr output of a process
|
@@ -156,7 +156,7 @@ async def asyncio(
|
|
156
156
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
157
157
|
|
158
158
|
Returns:
|
159
|
-
Union[ErrorResponse,
|
159
|
+
Union[ErrorResponse, ProcessLogs]
|
160
160
|
"""
|
161
161
|
|
162
162
|
return (
|
@@ -28,6 +28,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
28
28
|
response_404 = ErrorResponse.from_dict(response.text)
|
29
29
|
|
30
30
|
return response_404
|
31
|
+
if response.status_code == 422:
|
32
|
+
response_422 = ErrorResponse.from_dict(response.text)
|
33
|
+
|
34
|
+
return response_422
|
31
35
|
if response.status_code == 500:
|
32
36
|
response_500 = ErrorResponse.from_dict(response.text)
|
33
37
|
|
@@ -28,6 +28,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
28
28
|
response_404 = ErrorResponse.from_dict(response.json())
|
29
29
|
|
30
30
|
return response_404
|
31
|
+
if response.status_code == 422:
|
32
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
33
|
+
|
34
|
+
return response_422
|
31
35
|
if response.status_code == 500:
|
32
36
|
response_500 = ErrorResponse.from_dict(response.json())
|
33
37
|
|
@@ -54,8 +58,7 @@ def sync_detailed(
|
|
54
58
|
) -> Response[Union[ErrorResponse, str]]:
|
55
59
|
"""Stream process logs in real time via WebSocket
|
56
60
|
|
57
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
58
|
-
process exits or the client disconnects.
|
61
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
59
62
|
|
60
63
|
Args:
|
61
64
|
identifier (str):
|
@@ -86,8 +89,7 @@ def sync(
|
|
86
89
|
) -> Optional[Union[ErrorResponse, str]]:
|
87
90
|
"""Stream process logs in real time via WebSocket
|
88
91
|
|
89
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
90
|
-
process exits or the client disconnects.
|
92
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
91
93
|
|
92
94
|
Args:
|
93
95
|
identifier (str):
|
@@ -113,8 +115,7 @@ async def asyncio_detailed(
|
|
113
115
|
) -> Response[Union[ErrorResponse, str]]:
|
114
116
|
"""Stream process logs in real time via WebSocket
|
115
117
|
|
116
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
117
|
-
process exits or the client disconnects.
|
118
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
118
119
|
|
119
120
|
Args:
|
120
121
|
identifier (str):
|
@@ -143,8 +144,7 @@ async def asyncio(
|
|
143
144
|
) -> Optional[Union[ErrorResponse, str]]:
|
144
145
|
"""Stream process logs in real time via WebSocket
|
145
146
|
|
146
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
147
|
-
process exits or the client disconnects.
|
147
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
148
148
|
|
149
149
|
Args:
|
150
150
|
identifier (str):
|