blaxel 0.1.9rc37__py3-none-any.whl → 0.1.10rc39__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/__init__.py +11 -2
- blaxel/common/autoload.py +1 -0
- blaxel/common/internal.py +5 -5
- blaxel/sandbox/base.py +68 -0
- blaxel/sandbox/client/__init__.py +8 -0
- blaxel/sandbox/client/api/__init__.py +1 -0
- blaxel/sandbox/client/api/filesystem/__init__.py +0 -0
- blaxel/sandbox/client/api/filesystem/delete_filesystem_path.py +184 -0
- blaxel/sandbox/client/api/filesystem/get_filesystem_path.py +184 -0
- blaxel/sandbox/client/api/filesystem/put_filesystem_path.py +189 -0
- blaxel/sandbox/client/api/network/__init__.py +0 -0
- blaxel/sandbox/client/api/network/delete_network_process_pid_monitor.py +169 -0
- blaxel/sandbox/client/api/network/get_network_process_pid_ports.py +169 -0
- blaxel/sandbox/client/api/network/post_network_process_pid_monitor.py +195 -0
- blaxel/sandbox/client/api/process/__init__.py +0 -0
- blaxel/sandbox/client/api/process/delete_process_identifier.py +163 -0
- blaxel/sandbox/client/api/process/delete_process_identifier_kill.py +189 -0
- blaxel/sandbox/client/api/process/get_process.py +135 -0
- blaxel/sandbox/client/api/process/get_process_identifier.py +159 -0
- blaxel/sandbox/client/api/process/get_process_identifier_logs.py +167 -0
- blaxel/sandbox/client/api/process/post_process.py +176 -0
- blaxel/sandbox/client/client.py +162 -0
- blaxel/sandbox/client/errors.py +16 -0
- blaxel/sandbox/client/models/__init__.py +35 -0
- blaxel/sandbox/client/models/delete_network_process_pid_monitor_response_200.py +45 -0
- blaxel/sandbox/client/models/directory.py +110 -0
- blaxel/sandbox/client/models/error_response.py +60 -0
- blaxel/sandbox/client/models/file.py +105 -0
- blaxel/sandbox/client/models/file_request.py +78 -0
- blaxel/sandbox/client/models/file_with_content.py +114 -0
- blaxel/sandbox/client/models/get_network_process_pid_ports_response_200.py +45 -0
- blaxel/sandbox/client/models/get_process_identifier_logs_response_200.py +45 -0
- blaxel/sandbox/client/models/port_monitor_request.py +60 -0
- blaxel/sandbox/client/models/post_network_process_pid_monitor_response_200.py +45 -0
- blaxel/sandbox/client/models/process_kill_request.py +60 -0
- blaxel/sandbox/client/models/process_request.py +118 -0
- blaxel/sandbox/client/models/process_response.py +123 -0
- blaxel/sandbox/client/models/success_response.py +69 -0
- blaxel/sandbox/client/py.typed +1 -0
- blaxel/sandbox/client/types.py +46 -0
- blaxel/sandbox/filesystem.py +104 -0
- blaxel/sandbox/process.py +57 -0
- blaxel/sandbox/sandbox.py +92 -0
- blaxel/tools/__init__.py +1 -1
- {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10rc39.dist-info}/METADATA +1 -1
- {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10rc39.dist-info}/RECORD +48 -8
- {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10rc39.dist-info}/WHEEL +0 -0
- {blaxel-0.1.9rc37.dist-info → blaxel-0.1.10rc39.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,189 @@
|
|
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.error_response import ErrorResponse
|
9
|
+
from ...models.process_kill_request import ProcessKillRequest
|
10
|
+
from ...models.success_response import SuccessResponse
|
11
|
+
from ...types import Response
|
12
|
+
|
13
|
+
|
14
|
+
def _get_kwargs(
|
15
|
+
identifier: str,
|
16
|
+
*,
|
17
|
+
body: ProcessKillRequest,
|
18
|
+
) -> dict[str, Any]:
|
19
|
+
headers: dict[str, Any] = {}
|
20
|
+
|
21
|
+
_kwargs: dict[str, Any] = {
|
22
|
+
"method": "delete",
|
23
|
+
"url": f"/process/{identifier}/kill",
|
24
|
+
}
|
25
|
+
|
26
|
+
if type(body) == dict:
|
27
|
+
_body = body
|
28
|
+
else:
|
29
|
+
_body = body.to_dict()
|
30
|
+
|
31
|
+
_kwargs["json"] = _body
|
32
|
+
headers["Content-Type"] = "application/json"
|
33
|
+
|
34
|
+
_kwargs["headers"] = headers
|
35
|
+
return _kwargs
|
36
|
+
|
37
|
+
|
38
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ErrorResponse, SuccessResponse]]:
|
39
|
+
if response.status_code == 200:
|
40
|
+
response_200 = SuccessResponse.from_dict(response.json())
|
41
|
+
|
42
|
+
return response_200
|
43
|
+
if response.status_code == 404:
|
44
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
45
|
+
|
46
|
+
return response_404
|
47
|
+
if response.status_code == 500:
|
48
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
49
|
+
|
50
|
+
return response_500
|
51
|
+
if client.raise_on_unexpected_status:
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
53
|
+
else:
|
54
|
+
return None
|
55
|
+
|
56
|
+
|
57
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
58
|
+
return Response(
|
59
|
+
status_code=HTTPStatus(response.status_code),
|
60
|
+
content=response.content,
|
61
|
+
headers=response.headers,
|
62
|
+
parsed=_parse_response(client=client, response=response),
|
63
|
+
)
|
64
|
+
|
65
|
+
|
66
|
+
def sync_detailed(
|
67
|
+
identifier: str,
|
68
|
+
*,
|
69
|
+
client: Union[Client],
|
70
|
+
body: ProcessKillRequest,
|
71
|
+
) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
72
|
+
"""Kill a process
|
73
|
+
|
74
|
+
Forcefully kill a running process
|
75
|
+
|
76
|
+
Args:
|
77
|
+
identifier (str):
|
78
|
+
body (ProcessKillRequest):
|
79
|
+
|
80
|
+
Raises:
|
81
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
83
|
+
|
84
|
+
Returns:
|
85
|
+
Response[Union[ErrorResponse, SuccessResponse]]
|
86
|
+
"""
|
87
|
+
|
88
|
+
kwargs = _get_kwargs(
|
89
|
+
identifier=identifier,
|
90
|
+
body=body,
|
91
|
+
)
|
92
|
+
|
93
|
+
response = client.get_httpx_client().request(
|
94
|
+
**kwargs,
|
95
|
+
)
|
96
|
+
|
97
|
+
return _build_response(client=client, response=response)
|
98
|
+
|
99
|
+
|
100
|
+
def sync(
|
101
|
+
identifier: str,
|
102
|
+
*,
|
103
|
+
client: Union[Client],
|
104
|
+
body: ProcessKillRequest,
|
105
|
+
) -> Optional[Union[ErrorResponse, SuccessResponse]]:
|
106
|
+
"""Kill a process
|
107
|
+
|
108
|
+
Forcefully kill a running process
|
109
|
+
|
110
|
+
Args:
|
111
|
+
identifier (str):
|
112
|
+
body (ProcessKillRequest):
|
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
|
+
Union[ErrorResponse, SuccessResponse]
|
120
|
+
"""
|
121
|
+
|
122
|
+
return sync_detailed(
|
123
|
+
identifier=identifier,
|
124
|
+
client=client,
|
125
|
+
body=body,
|
126
|
+
).parsed
|
127
|
+
|
128
|
+
|
129
|
+
async def asyncio_detailed(
|
130
|
+
identifier: str,
|
131
|
+
*,
|
132
|
+
client: Union[Client],
|
133
|
+
body: ProcessKillRequest,
|
134
|
+
) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
135
|
+
"""Kill a process
|
136
|
+
|
137
|
+
Forcefully kill a running process
|
138
|
+
|
139
|
+
Args:
|
140
|
+
identifier (str):
|
141
|
+
body (ProcessKillRequest):
|
142
|
+
|
143
|
+
Raises:
|
144
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
145
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
146
|
+
|
147
|
+
Returns:
|
148
|
+
Response[Union[ErrorResponse, SuccessResponse]]
|
149
|
+
"""
|
150
|
+
|
151
|
+
kwargs = _get_kwargs(
|
152
|
+
identifier=identifier,
|
153
|
+
body=body,
|
154
|
+
)
|
155
|
+
|
156
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
157
|
+
|
158
|
+
return _build_response(client=client, response=response)
|
159
|
+
|
160
|
+
|
161
|
+
async def asyncio(
|
162
|
+
identifier: str,
|
163
|
+
*,
|
164
|
+
client: Union[Client],
|
165
|
+
body: ProcessKillRequest,
|
166
|
+
) -> Optional[Union[ErrorResponse, SuccessResponse]]:
|
167
|
+
"""Kill a process
|
168
|
+
|
169
|
+
Forcefully kill a running process
|
170
|
+
|
171
|
+
Args:
|
172
|
+
identifier (str):
|
173
|
+
body (ProcessKillRequest):
|
174
|
+
|
175
|
+
Raises:
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
178
|
+
|
179
|
+
Returns:
|
180
|
+
Union[ErrorResponse, SuccessResponse]
|
181
|
+
"""
|
182
|
+
|
183
|
+
return (
|
184
|
+
await asyncio_detailed(
|
185
|
+
identifier=identifier,
|
186
|
+
client=client,
|
187
|
+
body=body,
|
188
|
+
)
|
189
|
+
).parsed
|
@@ -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.process_response import ProcessResponse
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
13
|
+
_kwargs: dict[str, Any] = {
|
14
|
+
"method": "get",
|
15
|
+
"url": "/process",
|
16
|
+
}
|
17
|
+
|
18
|
+
return _kwargs
|
19
|
+
|
20
|
+
|
21
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[list["ProcessResponse"]]:
|
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 = ProcessResponse.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["ProcessResponse"]]:
|
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["ProcessResponse"]]:
|
50
|
+
"""List all processes
|
51
|
+
|
52
|
+
Get a list of all running and completed processes
|
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['ProcessResponse']]
|
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["ProcessResponse"]]:
|
75
|
+
"""List all processes
|
76
|
+
|
77
|
+
Get a list of all running and completed processes
|
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['ProcessResponse']
|
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["ProcessResponse"]]:
|
96
|
+
"""List all processes
|
97
|
+
|
98
|
+
Get a list of all running and completed processes
|
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['ProcessResponse']]
|
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["ProcessResponse"]]:
|
119
|
+
"""List all processes
|
120
|
+
|
121
|
+
Get a list of all running and completed processes
|
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['ProcessResponse']
|
129
|
+
"""
|
130
|
+
|
131
|
+
return (
|
132
|
+
await asyncio_detailed(
|
133
|
+
client=client,
|
134
|
+
)
|
135
|
+
).parsed
|
@@ -0,0 +1,159 @@
|
|
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.error_response import ErrorResponse
|
9
|
+
from ...models.process_response import ProcessResponse
|
10
|
+
from ...types import Response
|
11
|
+
|
12
|
+
|
13
|
+
def _get_kwargs(
|
14
|
+
identifier: str,
|
15
|
+
) -> dict[str, Any]:
|
16
|
+
_kwargs: dict[str, Any] = {
|
17
|
+
"method": "get",
|
18
|
+
"url": f"/process/{identifier}",
|
19
|
+
}
|
20
|
+
|
21
|
+
return _kwargs
|
22
|
+
|
23
|
+
|
24
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[ErrorResponse, ProcessResponse]]:
|
25
|
+
if response.status_code == 200:
|
26
|
+
response_200 = ProcessResponse.from_dict(response.json())
|
27
|
+
|
28
|
+
return response_200
|
29
|
+
if response.status_code == 404:
|
30
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
31
|
+
|
32
|
+
return response_404
|
33
|
+
if client.raise_on_unexpected_status:
|
34
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
35
|
+
else:
|
36
|
+
return None
|
37
|
+
|
38
|
+
|
39
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, ProcessResponse]]:
|
40
|
+
return Response(
|
41
|
+
status_code=HTTPStatus(response.status_code),
|
42
|
+
content=response.content,
|
43
|
+
headers=response.headers,
|
44
|
+
parsed=_parse_response(client=client, response=response),
|
45
|
+
)
|
46
|
+
|
47
|
+
|
48
|
+
def sync_detailed(
|
49
|
+
identifier: str,
|
50
|
+
*,
|
51
|
+
client: Union[Client],
|
52
|
+
) -> Response[Union[ErrorResponse, ProcessResponse]]:
|
53
|
+
"""Get process by identifier
|
54
|
+
|
55
|
+
Get information about a process by its PID or name
|
56
|
+
|
57
|
+
Args:
|
58
|
+
identifier (str):
|
59
|
+
|
60
|
+
Raises:
|
61
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
62
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
63
|
+
|
64
|
+
Returns:
|
65
|
+
Response[Union[ErrorResponse, ProcessResponse]]
|
66
|
+
"""
|
67
|
+
|
68
|
+
kwargs = _get_kwargs(
|
69
|
+
identifier=identifier,
|
70
|
+
)
|
71
|
+
|
72
|
+
response = client.get_httpx_client().request(
|
73
|
+
**kwargs,
|
74
|
+
)
|
75
|
+
|
76
|
+
return _build_response(client=client, response=response)
|
77
|
+
|
78
|
+
|
79
|
+
def sync(
|
80
|
+
identifier: str,
|
81
|
+
*,
|
82
|
+
client: Union[Client],
|
83
|
+
) -> Optional[Union[ErrorResponse, ProcessResponse]]:
|
84
|
+
"""Get process by identifier
|
85
|
+
|
86
|
+
Get information about a process by its PID or name
|
87
|
+
|
88
|
+
Args:
|
89
|
+
identifier (str):
|
90
|
+
|
91
|
+
Raises:
|
92
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
93
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
94
|
+
|
95
|
+
Returns:
|
96
|
+
Union[ErrorResponse, ProcessResponse]
|
97
|
+
"""
|
98
|
+
|
99
|
+
return sync_detailed(
|
100
|
+
identifier=identifier,
|
101
|
+
client=client,
|
102
|
+
).parsed
|
103
|
+
|
104
|
+
|
105
|
+
async def asyncio_detailed(
|
106
|
+
identifier: str,
|
107
|
+
*,
|
108
|
+
client: Union[Client],
|
109
|
+
) -> Response[Union[ErrorResponse, ProcessResponse]]:
|
110
|
+
"""Get process by identifier
|
111
|
+
|
112
|
+
Get information about a process by its PID or name
|
113
|
+
|
114
|
+
Args:
|
115
|
+
identifier (str):
|
116
|
+
|
117
|
+
Raises:
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
120
|
+
|
121
|
+
Returns:
|
122
|
+
Response[Union[ErrorResponse, ProcessResponse]]
|
123
|
+
"""
|
124
|
+
|
125
|
+
kwargs = _get_kwargs(
|
126
|
+
identifier=identifier,
|
127
|
+
)
|
128
|
+
|
129
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
130
|
+
|
131
|
+
return _build_response(client=client, response=response)
|
132
|
+
|
133
|
+
|
134
|
+
async def asyncio(
|
135
|
+
identifier: str,
|
136
|
+
*,
|
137
|
+
client: Union[Client],
|
138
|
+
) -> Optional[Union[ErrorResponse, ProcessResponse]]:
|
139
|
+
"""Get process by identifier
|
140
|
+
|
141
|
+
Get information about a process by its PID or name
|
142
|
+
|
143
|
+
Args:
|
144
|
+
identifier (str):
|
145
|
+
|
146
|
+
Raises:
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
149
|
+
|
150
|
+
Returns:
|
151
|
+
Union[ErrorResponse, ProcessResponse]
|
152
|
+
"""
|
153
|
+
|
154
|
+
return (
|
155
|
+
await asyncio_detailed(
|
156
|
+
identifier=identifier,
|
157
|
+
client=client,
|
158
|
+
)
|
159
|
+
).parsed
|
@@ -0,0 +1,167 @@
|
|
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.error_response import ErrorResponse
|
9
|
+
from ...models.get_process_identifier_logs_response_200 import GetProcessIdentifierLogsResponse200
|
10
|
+
from ...types import Response
|
11
|
+
|
12
|
+
|
13
|
+
def _get_kwargs(
|
14
|
+
identifier: str,
|
15
|
+
) -> dict[str, Any]:
|
16
|
+
_kwargs: dict[str, Any] = {
|
17
|
+
"method": "get",
|
18
|
+
"url": f"/process/{identifier}/logs",
|
19
|
+
}
|
20
|
+
|
21
|
+
return _kwargs
|
22
|
+
|
23
|
+
|
24
|
+
def _parse_response(
|
25
|
+
*, client: Client, response: httpx.Response
|
26
|
+
) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
27
|
+
if response.status_code == 200:
|
28
|
+
response_200 = GetProcessIdentifierLogsResponse200.from_dict(response.json())
|
29
|
+
|
30
|
+
return response_200
|
31
|
+
if response.status_code == 404:
|
32
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
33
|
+
|
34
|
+
return response_404
|
35
|
+
if response.status_code == 500:
|
36
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
37
|
+
|
38
|
+
return response_500
|
39
|
+
if client.raise_on_unexpected_status:
|
40
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
41
|
+
else:
|
42
|
+
return None
|
43
|
+
|
44
|
+
|
45
|
+
def _build_response(
|
46
|
+
*, client: Client, response: httpx.Response
|
47
|
+
) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
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
|
+
identifier: str,
|
58
|
+
*,
|
59
|
+
client: Union[Client],
|
60
|
+
) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
61
|
+
"""Get process logs
|
62
|
+
|
63
|
+
Get the stdout and stderr output of a process
|
64
|
+
|
65
|
+
Args:
|
66
|
+
identifier (str):
|
67
|
+
|
68
|
+
Raises:
|
69
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
70
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
71
|
+
|
72
|
+
Returns:
|
73
|
+
Response[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]
|
74
|
+
"""
|
75
|
+
|
76
|
+
kwargs = _get_kwargs(
|
77
|
+
identifier=identifier,
|
78
|
+
)
|
79
|
+
|
80
|
+
response = client.get_httpx_client().request(
|
81
|
+
**kwargs,
|
82
|
+
)
|
83
|
+
|
84
|
+
return _build_response(client=client, response=response)
|
85
|
+
|
86
|
+
|
87
|
+
def sync(
|
88
|
+
identifier: str,
|
89
|
+
*,
|
90
|
+
client: Union[Client],
|
91
|
+
) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
92
|
+
"""Get process logs
|
93
|
+
|
94
|
+
Get the stdout and stderr output of a process
|
95
|
+
|
96
|
+
Args:
|
97
|
+
identifier (str):
|
98
|
+
|
99
|
+
Raises:
|
100
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
101
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
102
|
+
|
103
|
+
Returns:
|
104
|
+
Union[ErrorResponse, GetProcessIdentifierLogsResponse200]
|
105
|
+
"""
|
106
|
+
|
107
|
+
return sync_detailed(
|
108
|
+
identifier=identifier,
|
109
|
+
client=client,
|
110
|
+
).parsed
|
111
|
+
|
112
|
+
|
113
|
+
async def asyncio_detailed(
|
114
|
+
identifier: str,
|
115
|
+
*,
|
116
|
+
client: Union[Client],
|
117
|
+
) -> Response[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
118
|
+
"""Get process logs
|
119
|
+
|
120
|
+
Get the stdout and stderr output of a process
|
121
|
+
|
122
|
+
Args:
|
123
|
+
identifier (str):
|
124
|
+
|
125
|
+
Raises:
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
128
|
+
|
129
|
+
Returns:
|
130
|
+
Response[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]
|
131
|
+
"""
|
132
|
+
|
133
|
+
kwargs = _get_kwargs(
|
134
|
+
identifier=identifier,
|
135
|
+
)
|
136
|
+
|
137
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
138
|
+
|
139
|
+
return _build_response(client=client, response=response)
|
140
|
+
|
141
|
+
|
142
|
+
async def asyncio(
|
143
|
+
identifier: str,
|
144
|
+
*,
|
145
|
+
client: Union[Client],
|
146
|
+
) -> Optional[Union[ErrorResponse, GetProcessIdentifierLogsResponse200]]:
|
147
|
+
"""Get process logs
|
148
|
+
|
149
|
+
Get the stdout and stderr output of a process
|
150
|
+
|
151
|
+
Args:
|
152
|
+
identifier (str):
|
153
|
+
|
154
|
+
Raises:
|
155
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
156
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
157
|
+
|
158
|
+
Returns:
|
159
|
+
Union[ErrorResponse, GetProcessIdentifierLogsResponse200]
|
160
|
+
"""
|
161
|
+
|
162
|
+
return (
|
163
|
+
await asyncio_detailed(
|
164
|
+
identifier=identifier,
|
165
|
+
client=client,
|
166
|
+
)
|
167
|
+
).parsed
|