mlops-python-sdk 1.0.0__py3-none-any.whl → 1.0.2__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.
- mlops/__init__.py +3 -3
- mlops/api/client/api/storage/__init__.py +1 -0
- mlops/api/client/api/storage/get_storage_presign_download.py +175 -0
- mlops/api/client/api/storage/get_storage_presign_upload.py +175 -0
- mlops/api/client/api/tasks/cancel_task.py +14 -14
- mlops/api/client/api/tasks/delete_task.py +14 -14
- mlops/api/client/api/tasks/get_task.py +15 -15
- mlops/api/client/api/tasks/get_task_by_task_id.py +204 -0
- mlops/api/client/api/tasks/get_task_logs.py +300 -0
- mlops/api/client/api/tasks/list_tasks.py +14 -14
- mlops/api/client/models/__init__.py +16 -0
- mlops/api/client/models/get_storage_presign_download_response_200.py +60 -0
- mlops/api/client/models/get_storage_presign_upload_response_200.py +79 -0
- mlops/api/client/models/get_task_logs_direction.py +9 -0
- mlops/api/client/models/get_task_logs_log_type.py +10 -0
- mlops/api/client/models/log_pagination.py +90 -0
- mlops/api/client/models/task_log_entry.py +105 -0
- mlops/api/client/models/task_log_entry_log_type.py +9 -0
- mlops/api/client/models/task_logs_response.py +112 -0
- mlops/api/client/models/task_submit_request.py +50 -6
- mlops/connection_config.py +2 -9
- mlops/exceptions.py +10 -10
- mlops/task/__init__.py +1 -1
- mlops/task/client.py +11 -35
- mlops/task/task.py +194 -64
- mlops_python_sdk-1.0.2.dist-info/METADATA +254 -0
- mlops_python_sdk-1.0.2.dist-info/RECORD +52 -0
- mlops_python_sdk-1.0.0.dist-info/METADATA +0 -416
- mlops_python_sdk-1.0.0.dist-info/RECORD +0 -39
- {mlops_python_sdk-1.0.0.dist-info → mlops_python_sdk-1.0.2.dist-info}/WHEEL +0 -0
|
@@ -7,17 +7,17 @@ from ... import errors
|
|
|
7
7
|
from ...client import AuthenticatedClient, Client
|
|
8
8
|
from ...models.error_response import ErrorResponse
|
|
9
9
|
from ...models.task import Task
|
|
10
|
-
from ...types import UNSET, Response
|
|
10
|
+
from ...types import UNSET, Response
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def _get_kwargs(
|
|
14
14
|
id: int,
|
|
15
15
|
*,
|
|
16
|
-
|
|
16
|
+
cluster_name: str,
|
|
17
17
|
) -> dict[str, Any]:
|
|
18
18
|
params: dict[str, Any] = {}
|
|
19
19
|
|
|
20
|
-
params["
|
|
20
|
+
params["cluster_name"] = cluster_name
|
|
21
21
|
|
|
22
22
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
23
23
|
|
|
@@ -74,7 +74,7 @@ def sync_detailed(
|
|
|
74
74
|
id: int,
|
|
75
75
|
*,
|
|
76
76
|
client: AuthenticatedClient,
|
|
77
|
-
|
|
77
|
+
cluster_name: str,
|
|
78
78
|
) -> Response[Union[ErrorResponse, Task]]:
|
|
79
79
|
"""Get task details
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ def sync_detailed(
|
|
|
82
82
|
|
|
83
83
|
Args:
|
|
84
84
|
id (int):
|
|
85
|
-
|
|
85
|
+
cluster_name (str):
|
|
86
86
|
|
|
87
87
|
Raises:
|
|
88
88
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -94,7 +94,7 @@ def sync_detailed(
|
|
|
94
94
|
|
|
95
95
|
kwargs = _get_kwargs(
|
|
96
96
|
id=id,
|
|
97
|
-
|
|
97
|
+
cluster_name=cluster_name,
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
response = client.get_httpx_client().request(
|
|
@@ -108,7 +108,7 @@ def sync(
|
|
|
108
108
|
id: int,
|
|
109
109
|
*,
|
|
110
110
|
client: AuthenticatedClient,
|
|
111
|
-
|
|
111
|
+
cluster_name: str,
|
|
112
112
|
) -> Optional[Union[ErrorResponse, Task]]:
|
|
113
113
|
"""Get task details
|
|
114
114
|
|
|
@@ -116,7 +116,7 @@ def sync(
|
|
|
116
116
|
|
|
117
117
|
Args:
|
|
118
118
|
id (int):
|
|
119
|
-
|
|
119
|
+
cluster_name (str):
|
|
120
120
|
|
|
121
121
|
Raises:
|
|
122
122
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -129,7 +129,7 @@ def sync(
|
|
|
129
129
|
return sync_detailed(
|
|
130
130
|
id=id,
|
|
131
131
|
client=client,
|
|
132
|
-
|
|
132
|
+
cluster_name=cluster_name,
|
|
133
133
|
).parsed
|
|
134
134
|
|
|
135
135
|
|
|
@@ -137,7 +137,7 @@ async def asyncio_detailed(
|
|
|
137
137
|
id: int,
|
|
138
138
|
*,
|
|
139
139
|
client: AuthenticatedClient,
|
|
140
|
-
|
|
140
|
+
cluster_name: str,
|
|
141
141
|
) -> Response[Union[ErrorResponse, Task]]:
|
|
142
142
|
"""Get task details
|
|
143
143
|
|
|
@@ -145,7 +145,7 @@ async def asyncio_detailed(
|
|
|
145
145
|
|
|
146
146
|
Args:
|
|
147
147
|
id (int):
|
|
148
|
-
|
|
148
|
+
cluster_name (str):
|
|
149
149
|
|
|
150
150
|
Raises:
|
|
151
151
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -157,7 +157,7 @@ async def asyncio_detailed(
|
|
|
157
157
|
|
|
158
158
|
kwargs = _get_kwargs(
|
|
159
159
|
id=id,
|
|
160
|
-
|
|
160
|
+
cluster_name=cluster_name,
|
|
161
161
|
)
|
|
162
162
|
|
|
163
163
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -169,7 +169,7 @@ async def asyncio(
|
|
|
169
169
|
id: int,
|
|
170
170
|
*,
|
|
171
171
|
client: AuthenticatedClient,
|
|
172
|
-
|
|
172
|
+
cluster_name: str,
|
|
173
173
|
) -> Optional[Union[ErrorResponse, Task]]:
|
|
174
174
|
"""Get task details
|
|
175
175
|
|
|
@@ -177,7 +177,7 @@ async def asyncio(
|
|
|
177
177
|
|
|
178
178
|
Args:
|
|
179
179
|
id (int):
|
|
180
|
-
|
|
180
|
+
cluster_name (str):
|
|
181
181
|
|
|
182
182
|
Raises:
|
|
183
183
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -191,6 +191,6 @@ async def asyncio(
|
|
|
191
191
|
await asyncio_detailed(
|
|
192
192
|
id=id,
|
|
193
193
|
client=client,
|
|
194
|
-
|
|
194
|
+
cluster_name=cluster_name,
|
|
195
195
|
)
|
|
196
196
|
).parsed
|
|
@@ -0,0 +1,204 @@
|
|
|
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 AuthenticatedClient, Client
|
|
8
|
+
from ...models.error_response import ErrorResponse
|
|
9
|
+
from ...models.task import Task
|
|
10
|
+
from ...types import UNSET, Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
task_id: str,
|
|
15
|
+
*,
|
|
16
|
+
cluster_name: str,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
params: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
params["cluster_name"] = cluster_name
|
|
21
|
+
|
|
22
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
23
|
+
|
|
24
|
+
_kwargs: dict[str, Any] = {
|
|
25
|
+
"method": "get",
|
|
26
|
+
"url": f"/tasks/by-task-id/{task_id}",
|
|
27
|
+
"params": params,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Optional[Union[ErrorResponse, Task]]:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = Task.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
40
|
+
if response.status_code == 400:
|
|
41
|
+
response_400 = ErrorResponse.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_400
|
|
44
|
+
if response.status_code == 401:
|
|
45
|
+
response_401 = ErrorResponse.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_401
|
|
48
|
+
if response.status_code == 403:
|
|
49
|
+
response_403 = ErrorResponse.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
return response_403
|
|
52
|
+
if response.status_code == 404:
|
|
53
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
54
|
+
|
|
55
|
+
return response_404
|
|
56
|
+
if response.status_code == 500:
|
|
57
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_500
|
|
60
|
+
if client.raise_on_unexpected_status:
|
|
61
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
62
|
+
else:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _build_response(
|
|
67
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
68
|
+
) -> Response[Union[ErrorResponse, Task]]:
|
|
69
|
+
return Response(
|
|
70
|
+
status_code=HTTPStatus(response.status_code),
|
|
71
|
+
content=response.content,
|
|
72
|
+
headers=response.headers,
|
|
73
|
+
parsed=_parse_response(client=client, response=response),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync_detailed(
|
|
78
|
+
task_id: str,
|
|
79
|
+
*,
|
|
80
|
+
client: AuthenticatedClient,
|
|
81
|
+
cluster_name: str,
|
|
82
|
+
) -> Response[Union[ErrorResponse, Task]]:
|
|
83
|
+
"""Get task details by task_id
|
|
84
|
+
|
|
85
|
+
Get detailed task information by internal task_id (UUID). Used for tasks that failed before a Slurm
|
|
86
|
+
job ID was created.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
task_id (str):
|
|
90
|
+
cluster_name (str):
|
|
91
|
+
|
|
92
|
+
Raises:
|
|
93
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
94
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
Response[Union[ErrorResponse, Task]]
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
kwargs = _get_kwargs(
|
|
101
|
+
task_id=task_id,
|
|
102
|
+
cluster_name=cluster_name,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
response = client.get_httpx_client().request(
|
|
106
|
+
**kwargs,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return _build_response(client=client, response=response)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def sync(
|
|
113
|
+
task_id: str,
|
|
114
|
+
*,
|
|
115
|
+
client: AuthenticatedClient,
|
|
116
|
+
cluster_name: str,
|
|
117
|
+
) -> Optional[Union[ErrorResponse, Task]]:
|
|
118
|
+
"""Get task details by task_id
|
|
119
|
+
|
|
120
|
+
Get detailed task information by internal task_id (UUID). Used for tasks that failed before a Slurm
|
|
121
|
+
job ID was created.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
task_id (str):
|
|
125
|
+
cluster_name (str):
|
|
126
|
+
|
|
127
|
+
Raises:
|
|
128
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
129
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
Union[ErrorResponse, Task]
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
return sync_detailed(
|
|
136
|
+
task_id=task_id,
|
|
137
|
+
client=client,
|
|
138
|
+
cluster_name=cluster_name,
|
|
139
|
+
).parsed
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
async def asyncio_detailed(
|
|
143
|
+
task_id: str,
|
|
144
|
+
*,
|
|
145
|
+
client: AuthenticatedClient,
|
|
146
|
+
cluster_name: str,
|
|
147
|
+
) -> Response[Union[ErrorResponse, Task]]:
|
|
148
|
+
"""Get task details by task_id
|
|
149
|
+
|
|
150
|
+
Get detailed task information by internal task_id (UUID). Used for tasks that failed before a Slurm
|
|
151
|
+
job ID was created.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
task_id (str):
|
|
155
|
+
cluster_name (str):
|
|
156
|
+
|
|
157
|
+
Raises:
|
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
Response[Union[ErrorResponse, Task]]
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
kwargs = _get_kwargs(
|
|
166
|
+
task_id=task_id,
|
|
167
|
+
cluster_name=cluster_name,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
171
|
+
|
|
172
|
+
return _build_response(client=client, response=response)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
async def asyncio(
|
|
176
|
+
task_id: str,
|
|
177
|
+
*,
|
|
178
|
+
client: AuthenticatedClient,
|
|
179
|
+
cluster_name: str,
|
|
180
|
+
) -> Optional[Union[ErrorResponse, Task]]:
|
|
181
|
+
"""Get task details by task_id
|
|
182
|
+
|
|
183
|
+
Get detailed task information by internal task_id (UUID). Used for tasks that failed before a Slurm
|
|
184
|
+
job ID was created.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
task_id (str):
|
|
188
|
+
cluster_name (str):
|
|
189
|
+
|
|
190
|
+
Raises:
|
|
191
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
192
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
193
|
+
|
|
194
|
+
Returns:
|
|
195
|
+
Union[ErrorResponse, Task]
|
|
196
|
+
"""
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
await asyncio_detailed(
|
|
200
|
+
task_id=task_id,
|
|
201
|
+
client=client,
|
|
202
|
+
cluster_name=cluster_name,
|
|
203
|
+
)
|
|
204
|
+
).parsed
|
|
@@ -0,0 +1,300 @@
|
|
|
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 AuthenticatedClient, Client
|
|
8
|
+
from ...models.error_response import ErrorResponse
|
|
9
|
+
from ...models.get_task_logs_direction import GetTaskLogsDirection
|
|
10
|
+
from ...models.get_task_logs_log_type import GetTaskLogsLogType
|
|
11
|
+
from ...models.task_logs_response import TaskLogsResponse
|
|
12
|
+
from ...types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
id: int,
|
|
17
|
+
*,
|
|
18
|
+
cluster_name: str,
|
|
19
|
+
log_type: Union[Unset, GetTaskLogsLogType] = GetTaskLogsLogType.ALL,
|
|
20
|
+
start: Union[Unset, str] = UNSET,
|
|
21
|
+
end: Union[Unset, str] = UNSET,
|
|
22
|
+
limit: Union[Unset, int] = 1000,
|
|
23
|
+
direction: Union[Unset, GetTaskLogsDirection] = GetTaskLogsDirection.BACKWARD,
|
|
24
|
+
cursor: Union[Unset, str] = UNSET,
|
|
25
|
+
) -> dict[str, Any]:
|
|
26
|
+
params: dict[str, Any] = {}
|
|
27
|
+
|
|
28
|
+
params["cluster_name"] = cluster_name
|
|
29
|
+
|
|
30
|
+
json_log_type: Union[Unset, str] = UNSET
|
|
31
|
+
if not isinstance(log_type, Unset):
|
|
32
|
+
json_log_type = log_type.value
|
|
33
|
+
|
|
34
|
+
params["log_type"] = json_log_type
|
|
35
|
+
|
|
36
|
+
params["start"] = start
|
|
37
|
+
|
|
38
|
+
params["end"] = end
|
|
39
|
+
|
|
40
|
+
params["limit"] = limit
|
|
41
|
+
|
|
42
|
+
json_direction: Union[Unset, str] = UNSET
|
|
43
|
+
if not isinstance(direction, Unset):
|
|
44
|
+
json_direction = direction.value
|
|
45
|
+
|
|
46
|
+
params["direction"] = json_direction
|
|
47
|
+
|
|
48
|
+
params["cursor"] = cursor
|
|
49
|
+
|
|
50
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
51
|
+
|
|
52
|
+
_kwargs: dict[str, Any] = {
|
|
53
|
+
"method": "get",
|
|
54
|
+
"url": f"/tasks/{id}/logs",
|
|
55
|
+
"params": params,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return _kwargs
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _parse_response(
|
|
62
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
63
|
+
) -> Optional[Union[ErrorResponse, TaskLogsResponse]]:
|
|
64
|
+
if response.status_code == 200:
|
|
65
|
+
response_200 = TaskLogsResponse.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_200
|
|
68
|
+
if response.status_code == 401:
|
|
69
|
+
response_401 = ErrorResponse.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_401
|
|
72
|
+
if response.status_code == 403:
|
|
73
|
+
response_403 = ErrorResponse.from_dict(response.json())
|
|
74
|
+
|
|
75
|
+
return response_403
|
|
76
|
+
if response.status_code == 404:
|
|
77
|
+
response_404 = ErrorResponse.from_dict(response.json())
|
|
78
|
+
|
|
79
|
+
return response_404
|
|
80
|
+
if response.status_code == 500:
|
|
81
|
+
response_500 = ErrorResponse.from_dict(response.json())
|
|
82
|
+
|
|
83
|
+
return response_500
|
|
84
|
+
if response.status_code == 503:
|
|
85
|
+
response_503 = ErrorResponse.from_dict(response.json())
|
|
86
|
+
|
|
87
|
+
return response_503
|
|
88
|
+
if client.raise_on_unexpected_status:
|
|
89
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
90
|
+
else:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _build_response(
|
|
95
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
96
|
+
) -> Response[Union[ErrorResponse, TaskLogsResponse]]:
|
|
97
|
+
return Response(
|
|
98
|
+
status_code=HTTPStatus(response.status_code),
|
|
99
|
+
content=response.content,
|
|
100
|
+
headers=response.headers,
|
|
101
|
+
parsed=_parse_response(client=client, response=response),
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def sync_detailed(
|
|
106
|
+
id: int,
|
|
107
|
+
*,
|
|
108
|
+
client: AuthenticatedClient,
|
|
109
|
+
cluster_name: str,
|
|
110
|
+
log_type: Union[Unset, GetTaskLogsLogType] = GetTaskLogsLogType.ALL,
|
|
111
|
+
start: Union[Unset, str] = UNSET,
|
|
112
|
+
end: Union[Unset, str] = UNSET,
|
|
113
|
+
limit: Union[Unset, int] = 1000,
|
|
114
|
+
direction: Union[Unset, GetTaskLogsDirection] = GetTaskLogsDirection.BACKWARD,
|
|
115
|
+
cursor: Union[Unset, str] = UNSET,
|
|
116
|
+
) -> Response[Union[ErrorResponse, TaskLogsResponse]]:
|
|
117
|
+
"""Get task logs
|
|
118
|
+
|
|
119
|
+
Get stdout/stderr logs for a task from Loki. Supports pagination via cursor-based navigation.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
id (int):
|
|
123
|
+
cluster_name (str):
|
|
124
|
+
log_type (Union[Unset, GetTaskLogsLogType]): Default: GetTaskLogsLogType.ALL.
|
|
125
|
+
start (Union[Unset, str]):
|
|
126
|
+
end (Union[Unset, str]):
|
|
127
|
+
limit (Union[Unset, int]): Default: 1000.
|
|
128
|
+
direction (Union[Unset, GetTaskLogsDirection]): Default: GetTaskLogsDirection.BACKWARD.
|
|
129
|
+
cursor (Union[Unset, str]):
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Response[Union[ErrorResponse, TaskLogsResponse]]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = _get_kwargs(
|
|
140
|
+
id=id,
|
|
141
|
+
cluster_name=cluster_name,
|
|
142
|
+
log_type=log_type,
|
|
143
|
+
start=start,
|
|
144
|
+
end=end,
|
|
145
|
+
limit=limit,
|
|
146
|
+
direction=direction,
|
|
147
|
+
cursor=cursor,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
response = client.get_httpx_client().request(
|
|
151
|
+
**kwargs,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
return _build_response(client=client, response=response)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def sync(
|
|
158
|
+
id: int,
|
|
159
|
+
*,
|
|
160
|
+
client: AuthenticatedClient,
|
|
161
|
+
cluster_name: str,
|
|
162
|
+
log_type: Union[Unset, GetTaskLogsLogType] = GetTaskLogsLogType.ALL,
|
|
163
|
+
start: Union[Unset, str] = UNSET,
|
|
164
|
+
end: Union[Unset, str] = UNSET,
|
|
165
|
+
limit: Union[Unset, int] = 1000,
|
|
166
|
+
direction: Union[Unset, GetTaskLogsDirection] = GetTaskLogsDirection.BACKWARD,
|
|
167
|
+
cursor: Union[Unset, str] = UNSET,
|
|
168
|
+
) -> Optional[Union[ErrorResponse, TaskLogsResponse]]:
|
|
169
|
+
"""Get task logs
|
|
170
|
+
|
|
171
|
+
Get stdout/stderr logs for a task from Loki. Supports pagination via cursor-based navigation.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
id (int):
|
|
175
|
+
cluster_name (str):
|
|
176
|
+
log_type (Union[Unset, GetTaskLogsLogType]): Default: GetTaskLogsLogType.ALL.
|
|
177
|
+
start (Union[Unset, str]):
|
|
178
|
+
end (Union[Unset, str]):
|
|
179
|
+
limit (Union[Unset, int]): Default: 1000.
|
|
180
|
+
direction (Union[Unset, GetTaskLogsDirection]): Default: GetTaskLogsDirection.BACKWARD.
|
|
181
|
+
cursor (Union[Unset, str]):
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
185
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Union[ErrorResponse, TaskLogsResponse]
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
return sync_detailed(
|
|
192
|
+
id=id,
|
|
193
|
+
client=client,
|
|
194
|
+
cluster_name=cluster_name,
|
|
195
|
+
log_type=log_type,
|
|
196
|
+
start=start,
|
|
197
|
+
end=end,
|
|
198
|
+
limit=limit,
|
|
199
|
+
direction=direction,
|
|
200
|
+
cursor=cursor,
|
|
201
|
+
).parsed
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
async def asyncio_detailed(
|
|
205
|
+
id: int,
|
|
206
|
+
*,
|
|
207
|
+
client: AuthenticatedClient,
|
|
208
|
+
cluster_name: str,
|
|
209
|
+
log_type: Union[Unset, GetTaskLogsLogType] = GetTaskLogsLogType.ALL,
|
|
210
|
+
start: Union[Unset, str] = UNSET,
|
|
211
|
+
end: Union[Unset, str] = UNSET,
|
|
212
|
+
limit: Union[Unset, int] = 1000,
|
|
213
|
+
direction: Union[Unset, GetTaskLogsDirection] = GetTaskLogsDirection.BACKWARD,
|
|
214
|
+
cursor: Union[Unset, str] = UNSET,
|
|
215
|
+
) -> Response[Union[ErrorResponse, TaskLogsResponse]]:
|
|
216
|
+
"""Get task logs
|
|
217
|
+
|
|
218
|
+
Get stdout/stderr logs for a task from Loki. Supports pagination via cursor-based navigation.
|
|
219
|
+
|
|
220
|
+
Args:
|
|
221
|
+
id (int):
|
|
222
|
+
cluster_name (str):
|
|
223
|
+
log_type (Union[Unset, GetTaskLogsLogType]): Default: GetTaskLogsLogType.ALL.
|
|
224
|
+
start (Union[Unset, str]):
|
|
225
|
+
end (Union[Unset, str]):
|
|
226
|
+
limit (Union[Unset, int]): Default: 1000.
|
|
227
|
+
direction (Union[Unset, GetTaskLogsDirection]): Default: GetTaskLogsDirection.BACKWARD.
|
|
228
|
+
cursor (Union[Unset, str]):
|
|
229
|
+
|
|
230
|
+
Raises:
|
|
231
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
232
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
233
|
+
|
|
234
|
+
Returns:
|
|
235
|
+
Response[Union[ErrorResponse, TaskLogsResponse]]
|
|
236
|
+
"""
|
|
237
|
+
|
|
238
|
+
kwargs = _get_kwargs(
|
|
239
|
+
id=id,
|
|
240
|
+
cluster_name=cluster_name,
|
|
241
|
+
log_type=log_type,
|
|
242
|
+
start=start,
|
|
243
|
+
end=end,
|
|
244
|
+
limit=limit,
|
|
245
|
+
direction=direction,
|
|
246
|
+
cursor=cursor,
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
250
|
+
|
|
251
|
+
return _build_response(client=client, response=response)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
async def asyncio(
|
|
255
|
+
id: int,
|
|
256
|
+
*,
|
|
257
|
+
client: AuthenticatedClient,
|
|
258
|
+
cluster_name: str,
|
|
259
|
+
log_type: Union[Unset, GetTaskLogsLogType] = GetTaskLogsLogType.ALL,
|
|
260
|
+
start: Union[Unset, str] = UNSET,
|
|
261
|
+
end: Union[Unset, str] = UNSET,
|
|
262
|
+
limit: Union[Unset, int] = 1000,
|
|
263
|
+
direction: Union[Unset, GetTaskLogsDirection] = GetTaskLogsDirection.BACKWARD,
|
|
264
|
+
cursor: Union[Unset, str] = UNSET,
|
|
265
|
+
) -> Optional[Union[ErrorResponse, TaskLogsResponse]]:
|
|
266
|
+
"""Get task logs
|
|
267
|
+
|
|
268
|
+
Get stdout/stderr logs for a task from Loki. Supports pagination via cursor-based navigation.
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
id (int):
|
|
272
|
+
cluster_name (str):
|
|
273
|
+
log_type (Union[Unset, GetTaskLogsLogType]): Default: GetTaskLogsLogType.ALL.
|
|
274
|
+
start (Union[Unset, str]):
|
|
275
|
+
end (Union[Unset, str]):
|
|
276
|
+
limit (Union[Unset, int]): Default: 1000.
|
|
277
|
+
direction (Union[Unset, GetTaskLogsDirection]): Default: GetTaskLogsDirection.BACKWARD.
|
|
278
|
+
cursor (Union[Unset, str]):
|
|
279
|
+
|
|
280
|
+
Raises:
|
|
281
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
282
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
283
|
+
|
|
284
|
+
Returns:
|
|
285
|
+
Union[ErrorResponse, TaskLogsResponse]
|
|
286
|
+
"""
|
|
287
|
+
|
|
288
|
+
return (
|
|
289
|
+
await asyncio_detailed(
|
|
290
|
+
id=id,
|
|
291
|
+
client=client,
|
|
292
|
+
cluster_name=cluster_name,
|
|
293
|
+
log_type=log_type,
|
|
294
|
+
start=start,
|
|
295
|
+
end=end,
|
|
296
|
+
limit=limit,
|
|
297
|
+
direction=direction,
|
|
298
|
+
cursor=cursor,
|
|
299
|
+
)
|
|
300
|
+
).parsed
|