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,135 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import Client
|
8
|
+
from ...models.job import Job
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
13
|
+
_kwargs: dict[str, Any] = {
|
14
|
+
"method": "get",
|
15
|
+
"url": "/jobs",
|
16
|
+
}
|
17
|
+
|
18
|
+
return _kwargs
|
19
|
+
|
20
|
+
|
21
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[list["Job"]]:
|
22
|
+
if response.status_code == 200:
|
23
|
+
response_200 = []
|
24
|
+
_response_200 = response.json()
|
25
|
+
for response_200_item_data in _response_200:
|
26
|
+
response_200_item = Job.from_dict(response_200_item_data)
|
27
|
+
|
28
|
+
response_200.append(response_200_item)
|
29
|
+
|
30
|
+
return response_200
|
31
|
+
if client.raise_on_unexpected_status:
|
32
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
33
|
+
else:
|
34
|
+
return None
|
35
|
+
|
36
|
+
|
37
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[list["Job"]]:
|
38
|
+
return Response(
|
39
|
+
status_code=HTTPStatus(response.status_code),
|
40
|
+
content=response.content,
|
41
|
+
headers=response.headers,
|
42
|
+
parsed=_parse_response(client=client, response=response),
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
def sync_detailed(
|
47
|
+
*,
|
48
|
+
client: Union[Client],
|
49
|
+
) -> Response[list["Job"]]:
|
50
|
+
"""List jobs
|
51
|
+
|
52
|
+
Returns a list of all jobs in the workspace.
|
53
|
+
|
54
|
+
Raises:
|
55
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
56
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
57
|
+
|
58
|
+
Returns:
|
59
|
+
Response[list['Job']]
|
60
|
+
"""
|
61
|
+
|
62
|
+
kwargs = _get_kwargs()
|
63
|
+
|
64
|
+
response = client.get_httpx_client().request(
|
65
|
+
**kwargs,
|
66
|
+
)
|
67
|
+
|
68
|
+
return _build_response(client=client, response=response)
|
69
|
+
|
70
|
+
|
71
|
+
def sync(
|
72
|
+
*,
|
73
|
+
client: Union[Client],
|
74
|
+
) -> Optional[list["Job"]]:
|
75
|
+
"""List jobs
|
76
|
+
|
77
|
+
Returns a list of all jobs in the workspace.
|
78
|
+
|
79
|
+
Raises:
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
82
|
+
|
83
|
+
Returns:
|
84
|
+
list['Job']
|
85
|
+
"""
|
86
|
+
|
87
|
+
return sync_detailed(
|
88
|
+
client=client,
|
89
|
+
).parsed
|
90
|
+
|
91
|
+
|
92
|
+
async def asyncio_detailed(
|
93
|
+
*,
|
94
|
+
client: Union[Client],
|
95
|
+
) -> Response[list["Job"]]:
|
96
|
+
"""List jobs
|
97
|
+
|
98
|
+
Returns a list of all jobs in the workspace.
|
99
|
+
|
100
|
+
Raises:
|
101
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
102
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
103
|
+
|
104
|
+
Returns:
|
105
|
+
Response[list['Job']]
|
106
|
+
"""
|
107
|
+
|
108
|
+
kwargs = _get_kwargs()
|
109
|
+
|
110
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
111
|
+
|
112
|
+
return _build_response(client=client, response=response)
|
113
|
+
|
114
|
+
|
115
|
+
async def asyncio(
|
116
|
+
*,
|
117
|
+
client: Union[Client],
|
118
|
+
) -> Optional[list["Job"]]:
|
119
|
+
"""List jobs
|
120
|
+
|
121
|
+
Returns a list of all jobs in the workspace.
|
122
|
+
|
123
|
+
Raises:
|
124
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
125
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
126
|
+
|
127
|
+
Returns:
|
128
|
+
list['Job']
|
129
|
+
"""
|
130
|
+
|
131
|
+
return (
|
132
|
+
await asyncio_detailed(
|
133
|
+
client=client,
|
134
|
+
)
|
135
|
+
).parsed
|
@@ -0,0 +1,179 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import Client
|
8
|
+
from ...models.job import Job
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
job_id: str,
|
14
|
+
*,
|
15
|
+
body: Job,
|
16
|
+
) -> dict[str, Any]:
|
17
|
+
headers: dict[str, Any] = {}
|
18
|
+
|
19
|
+
_kwargs: dict[str, Any] = {
|
20
|
+
"method": "put",
|
21
|
+
"url": f"/jobs/{job_id}",
|
22
|
+
}
|
23
|
+
|
24
|
+
if type(body) == dict:
|
25
|
+
_body = body
|
26
|
+
else:
|
27
|
+
_body = body.to_dict()
|
28
|
+
|
29
|
+
_kwargs["json"] = _body
|
30
|
+
headers["Content-Type"] = "application/json"
|
31
|
+
|
32
|
+
_kwargs["headers"] = headers
|
33
|
+
return _kwargs
|
34
|
+
|
35
|
+
|
36
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Job]:
|
37
|
+
if response.status_code == 200:
|
38
|
+
response_200 = Job.from_dict(response.json())
|
39
|
+
|
40
|
+
return response_200
|
41
|
+
if client.raise_on_unexpected_status:
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
43
|
+
else:
|
44
|
+
return None
|
45
|
+
|
46
|
+
|
47
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Job]:
|
48
|
+
return Response(
|
49
|
+
status_code=HTTPStatus(response.status_code),
|
50
|
+
content=response.content,
|
51
|
+
headers=response.headers,
|
52
|
+
parsed=_parse_response(client=client, response=response),
|
53
|
+
)
|
54
|
+
|
55
|
+
|
56
|
+
def sync_detailed(
|
57
|
+
job_id: str,
|
58
|
+
*,
|
59
|
+
client: Union[Client],
|
60
|
+
body: Job,
|
61
|
+
) -> Response[Job]:
|
62
|
+
"""Create or update job
|
63
|
+
|
64
|
+
Update a job by name.
|
65
|
+
|
66
|
+
Args:
|
67
|
+
job_id (str):
|
68
|
+
body (Job): Job
|
69
|
+
|
70
|
+
Raises:
|
71
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
72
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
73
|
+
|
74
|
+
Returns:
|
75
|
+
Response[Job]
|
76
|
+
"""
|
77
|
+
|
78
|
+
kwargs = _get_kwargs(
|
79
|
+
job_id=job_id,
|
80
|
+
body=body,
|
81
|
+
)
|
82
|
+
|
83
|
+
response = client.get_httpx_client().request(
|
84
|
+
**kwargs,
|
85
|
+
)
|
86
|
+
|
87
|
+
return _build_response(client=client, response=response)
|
88
|
+
|
89
|
+
|
90
|
+
def sync(
|
91
|
+
job_id: str,
|
92
|
+
*,
|
93
|
+
client: Union[Client],
|
94
|
+
body: Job,
|
95
|
+
) -> Optional[Job]:
|
96
|
+
"""Create or update job
|
97
|
+
|
98
|
+
Update a job by name.
|
99
|
+
|
100
|
+
Args:
|
101
|
+
job_id (str):
|
102
|
+
body (Job): Job
|
103
|
+
|
104
|
+
Raises:
|
105
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
106
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
107
|
+
|
108
|
+
Returns:
|
109
|
+
Job
|
110
|
+
"""
|
111
|
+
|
112
|
+
return sync_detailed(
|
113
|
+
job_id=job_id,
|
114
|
+
client=client,
|
115
|
+
body=body,
|
116
|
+
).parsed
|
117
|
+
|
118
|
+
|
119
|
+
async def asyncio_detailed(
|
120
|
+
job_id: str,
|
121
|
+
*,
|
122
|
+
client: Union[Client],
|
123
|
+
body: Job,
|
124
|
+
) -> Response[Job]:
|
125
|
+
"""Create or update job
|
126
|
+
|
127
|
+
Update a job by name.
|
128
|
+
|
129
|
+
Args:
|
130
|
+
job_id (str):
|
131
|
+
body (Job): Job
|
132
|
+
|
133
|
+
Raises:
|
134
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
135
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
136
|
+
|
137
|
+
Returns:
|
138
|
+
Response[Job]
|
139
|
+
"""
|
140
|
+
|
141
|
+
kwargs = _get_kwargs(
|
142
|
+
job_id=job_id,
|
143
|
+
body=body,
|
144
|
+
)
|
145
|
+
|
146
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
147
|
+
|
148
|
+
return _build_response(client=client, response=response)
|
149
|
+
|
150
|
+
|
151
|
+
async def asyncio(
|
152
|
+
job_id: str,
|
153
|
+
*,
|
154
|
+
client: Union[Client],
|
155
|
+
body: Job,
|
156
|
+
) -> Optional[Job]:
|
157
|
+
"""Create or update job
|
158
|
+
|
159
|
+
Update a job by name.
|
160
|
+
|
161
|
+
Args:
|
162
|
+
job_id (str):
|
163
|
+
body (Job): Job
|
164
|
+
|
165
|
+
Raises:
|
166
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
167
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
168
|
+
|
169
|
+
Returns:
|
170
|
+
Job
|
171
|
+
"""
|
172
|
+
|
173
|
+
return (
|
174
|
+
await asyncio_detailed(
|
175
|
+
job_id=job_id,
|
176
|
+
client=client,
|
177
|
+
body=body,
|
178
|
+
)
|
179
|
+
).parsed
|
blaxel/client/models/__init__.py
CHANGED
@@ -50,6 +50,21 @@ from .integration_organization import IntegrationOrganization
|
|
50
50
|
from .integration_query_params import IntegrationQueryParams
|
51
51
|
from .integration_repository import IntegrationRepository
|
52
52
|
from .invite_workspace_user_body import InviteWorkspaceUserBody
|
53
|
+
from .job import Job
|
54
|
+
from .job_execution_config import JobExecutionConfig
|
55
|
+
from .job_metrics import JobMetrics
|
56
|
+
from .job_metrics_executions_chart import JobMetricsExecutionsChart
|
57
|
+
from .job_metrics_executions_total import JobMetricsExecutionsTotal
|
58
|
+
from .job_metrics_tasks_chart import JobMetricsTasksChart
|
59
|
+
from .job_metrics_tasks_total import JobMetricsTasksTotal
|
60
|
+
from .job_spec import JobSpec
|
61
|
+
from .jobs_chart import JobsChart
|
62
|
+
from .jobs_chart_value import JobsChartValue
|
63
|
+
from .jobs_executions import JobsExecutions
|
64
|
+
from .jobs_network_chart import JobsNetworkChart
|
65
|
+
from .jobs_success_failed_chart import JobsSuccessFailedChart
|
66
|
+
from .jobs_tasks import JobsTasks
|
67
|
+
from .jobs_total import JobsTotal
|
53
68
|
from .knowledgebase import Knowledgebase
|
54
69
|
from .knowledgebase_spec import KnowledgebaseSpec
|
55
70
|
from .knowledgebase_spec_options import KnowledgebaseSpecOptions
|
@@ -87,6 +102,8 @@ from .port import Port
|
|
87
102
|
from .preview import Preview
|
88
103
|
from .preview_metadata import PreviewMetadata
|
89
104
|
from .preview_spec import PreviewSpec
|
105
|
+
from .preview_spec_request_headers import PreviewSpecRequestHeaders
|
106
|
+
from .preview_spec_response_headers import PreviewSpecResponseHeaders
|
90
107
|
from .preview_token import PreviewToken
|
91
108
|
from .preview_token_metadata import PreviewTokenMetadata
|
92
109
|
from .preview_token_spec import PreviewTokenSpec
|
@@ -199,6 +216,21 @@ __all__ = (
|
|
199
216
|
"IntegrationQueryParams",
|
200
217
|
"IntegrationRepository",
|
201
218
|
"InviteWorkspaceUserBody",
|
219
|
+
"Job",
|
220
|
+
"JobExecutionConfig",
|
221
|
+
"JobMetrics",
|
222
|
+
"JobMetricsExecutionsChart",
|
223
|
+
"JobMetricsExecutionsTotal",
|
224
|
+
"JobMetricsTasksChart",
|
225
|
+
"JobMetricsTasksTotal",
|
226
|
+
"JobsChart",
|
227
|
+
"JobsChartValue",
|
228
|
+
"JobsExecutions",
|
229
|
+
"JobsNetworkChart",
|
230
|
+
"JobSpec",
|
231
|
+
"JobsSuccessFailedChart",
|
232
|
+
"JobsTasks",
|
233
|
+
"JobsTotal",
|
202
234
|
"Knowledgebase",
|
203
235
|
"KnowledgebaseSpec",
|
204
236
|
"KnowledgebaseSpecOptions",
|
@@ -236,6 +268,8 @@ __all__ = (
|
|
236
268
|
"Preview",
|
237
269
|
"PreviewMetadata",
|
238
270
|
"PreviewSpec",
|
271
|
+
"PreviewSpecRequestHeaders",
|
272
|
+
"PreviewSpecResponseHeaders",
|
239
273
|
"PreviewToken",
|
240
274
|
"PreviewTokenMetadata",
|
241
275
|
"PreviewTokenSpec",
|
@@ -0,0 +1,129 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.core_event import CoreEvent
|
10
|
+
from ..models.job_spec import JobSpec
|
11
|
+
from ..models.metadata import Metadata
|
12
|
+
|
13
|
+
|
14
|
+
T = TypeVar("T", bound="Job")
|
15
|
+
|
16
|
+
|
17
|
+
@_attrs_define
|
18
|
+
class Job:
|
19
|
+
"""Job
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
events (Union[Unset, list['CoreEvent']]): Core events
|
23
|
+
metadata (Union[Unset, Metadata]): Metadata
|
24
|
+
spec (Union[Unset, JobSpec]): Job specification
|
25
|
+
status (Union[Unset, str]): Job status
|
26
|
+
"""
|
27
|
+
|
28
|
+
events: Union[Unset, list["CoreEvent"]] = UNSET
|
29
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
30
|
+
spec: Union[Unset, "JobSpec"] = UNSET
|
31
|
+
status: Union[Unset, str] = UNSET
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
33
|
+
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
35
|
+
events: Union[Unset, list[dict[str, Any]]] = UNSET
|
36
|
+
if not isinstance(self.events, Unset):
|
37
|
+
events = []
|
38
|
+
for componentsschemas_core_events_item_data in self.events:
|
39
|
+
if type(componentsschemas_core_events_item_data) == dict:
|
40
|
+
componentsschemas_core_events_item = componentsschemas_core_events_item_data
|
41
|
+
else:
|
42
|
+
componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
|
43
|
+
events.append(componentsschemas_core_events_item)
|
44
|
+
|
45
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
46
|
+
if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
|
47
|
+
metadata = self.metadata.to_dict()
|
48
|
+
elif self.metadata and isinstance(self.metadata, dict):
|
49
|
+
metadata = self.metadata
|
50
|
+
|
51
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
52
|
+
if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
|
53
|
+
spec = self.spec.to_dict()
|
54
|
+
elif self.spec and isinstance(self.spec, dict):
|
55
|
+
spec = self.spec
|
56
|
+
|
57
|
+
status = self.status
|
58
|
+
|
59
|
+
field_dict: dict[str, Any] = {}
|
60
|
+
field_dict.update(self.additional_properties)
|
61
|
+
field_dict.update({})
|
62
|
+
if events is not UNSET:
|
63
|
+
field_dict["events"] = events
|
64
|
+
if metadata is not UNSET:
|
65
|
+
field_dict["metadata"] = metadata
|
66
|
+
if spec is not UNSET:
|
67
|
+
field_dict["spec"] = spec
|
68
|
+
if status is not UNSET:
|
69
|
+
field_dict["status"] = status
|
70
|
+
|
71
|
+
return field_dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
75
|
+
from ..models.core_event import CoreEvent
|
76
|
+
from ..models.job_spec import JobSpec
|
77
|
+
from ..models.metadata import Metadata
|
78
|
+
|
79
|
+
if not src_dict:
|
80
|
+
return None
|
81
|
+
d = src_dict.copy()
|
82
|
+
events = []
|
83
|
+
_events = d.pop("events", UNSET)
|
84
|
+
for componentsschemas_core_events_item_data in _events or []:
|
85
|
+
componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
|
86
|
+
|
87
|
+
events.append(componentsschemas_core_events_item)
|
88
|
+
|
89
|
+
_metadata = d.pop("metadata", UNSET)
|
90
|
+
metadata: Union[Unset, Metadata]
|
91
|
+
if isinstance(_metadata, Unset):
|
92
|
+
metadata = UNSET
|
93
|
+
else:
|
94
|
+
metadata = Metadata.from_dict(_metadata)
|
95
|
+
|
96
|
+
_spec = d.pop("spec", UNSET)
|
97
|
+
spec: Union[Unset, JobSpec]
|
98
|
+
if isinstance(_spec, Unset):
|
99
|
+
spec = UNSET
|
100
|
+
else:
|
101
|
+
spec = JobSpec.from_dict(_spec)
|
102
|
+
|
103
|
+
status = d.pop("status", UNSET)
|
104
|
+
|
105
|
+
job = cls(
|
106
|
+
events=events,
|
107
|
+
metadata=metadata,
|
108
|
+
spec=spec,
|
109
|
+
status=status,
|
110
|
+
)
|
111
|
+
|
112
|
+
job.additional_properties = d
|
113
|
+
return job
|
114
|
+
|
115
|
+
@property
|
116
|
+
def additional_keys(self) -> list[str]:
|
117
|
+
return list(self.additional_properties.keys())
|
118
|
+
|
119
|
+
def __getitem__(self, key: str) -> Any:
|
120
|
+
return self.additional_properties[key]
|
121
|
+
|
122
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
123
|
+
self.additional_properties[key] = value
|
124
|
+
|
125
|
+
def __delitem__(self, key: str) -> None:
|
126
|
+
del self.additional_properties[key]
|
127
|
+
|
128
|
+
def __contains__(self, key: str) -> bool:
|
129
|
+
return key in self.additional_properties
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="JobExecutionConfig")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class JobExecutionConfig:
|
13
|
+
"""Configuration for a job execution
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
max_concurrent_tasks (Union[Unset, int]): The maximum number of concurrent tasks for an execution
|
17
|
+
max_retries (Union[Unset, int]): The maximum number of retries for the job execution
|
18
|
+
timeout (Union[Unset, int]): The timeout for the job execution in seconds
|
19
|
+
"""
|
20
|
+
|
21
|
+
max_concurrent_tasks: Union[Unset, int] = UNSET
|
22
|
+
max_retries: Union[Unset, int] = UNSET
|
23
|
+
timeout: Union[Unset, int] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
max_concurrent_tasks = self.max_concurrent_tasks
|
28
|
+
|
29
|
+
max_retries = self.max_retries
|
30
|
+
|
31
|
+
timeout = self.timeout
|
32
|
+
|
33
|
+
field_dict: dict[str, Any] = {}
|
34
|
+
field_dict.update(self.additional_properties)
|
35
|
+
field_dict.update({})
|
36
|
+
if max_concurrent_tasks is not UNSET:
|
37
|
+
field_dict["maxConcurrentTasks"] = max_concurrent_tasks
|
38
|
+
if max_retries is not UNSET:
|
39
|
+
field_dict["maxRetries"] = max_retries
|
40
|
+
if timeout is not UNSET:
|
41
|
+
field_dict["timeout"] = timeout
|
42
|
+
|
43
|
+
return field_dict
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
47
|
+
if not src_dict:
|
48
|
+
return None
|
49
|
+
d = src_dict.copy()
|
50
|
+
max_concurrent_tasks = d.pop("maxConcurrentTasks", UNSET)
|
51
|
+
|
52
|
+
max_retries = d.pop("maxRetries", UNSET)
|
53
|
+
|
54
|
+
timeout = d.pop("timeout", UNSET)
|
55
|
+
|
56
|
+
job_execution_config = cls(
|
57
|
+
max_concurrent_tasks=max_concurrent_tasks,
|
58
|
+
max_retries=max_retries,
|
59
|
+
timeout=timeout,
|
60
|
+
)
|
61
|
+
|
62
|
+
job_execution_config.additional_properties = d
|
63
|
+
return job_execution_config
|
64
|
+
|
65
|
+
@property
|
66
|
+
def additional_keys(self) -> list[str]:
|
67
|
+
return list(self.additional_properties.keys())
|
68
|
+
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
70
|
+
return self.additional_properties[key]
|
71
|
+
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
73
|
+
self.additional_properties[key] = value
|
74
|
+
|
75
|
+
def __delitem__(self, key: str) -> None:
|
76
|
+
del self.additional_properties[key]
|
77
|
+
|
78
|
+
def __contains__(self, key: str) -> bool:
|
79
|
+
return key in self.additional_properties
|