mithril-client 0.1.0a1__cp314-cp314-macosx_11_0_arm64.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.
- mithril/__init__.py +7 -0
- mithril/_mcli.cpython-314-darwin.so +0 -0
- mithril/_mcli.pyi +7 -0
- mithril/_mcli_entry.py +75 -0
- mithril/api/__init__.py +7 -0
- mithril/api/bindings/.gitattributes +2 -0
- mithril/api/bindings/__init__.py +10 -0
- mithril/api/bindings/api/__init__.py +1 -0
- mithril/api/bindings/api/api_keys/__init__.py +1 -0
- mithril/api/bindings/api/api_keys/create_api_key_v2_api_keys_post.py +179 -0
- mithril/api/bindings/api/api_keys/get_api_keys_v2_api_keys_get.py +141 -0
- mithril/api/bindings/api/api_keys/revoke_api_key_v2_api_keys_key_fid_delete.py +173 -0
- mithril/api/bindings/api/image_versions/__init__.py +1 -0
- mithril/api/bindings/api/image_versions/get_image_versions_v2_image_versions_get.py +141 -0
- mithril/api/bindings/api/image_versions/get_mcc_image_versions_v2_mcc_image_versions_get.py +179 -0
- mithril/api/bindings/api/instance_types/__init__.py +1 -0
- mithril/api/bindings/api/instance_types/get_instance_types_v2_instance_types_get.py +137 -0
- mithril/api/bindings/api/instances/__init__.py +1 -0
- mithril/api/bindings/api/instances/get_instance_status_v2_instances_instance_id_status_get.py +165 -0
- mithril/api/bindings/api/instances/get_instances_v2_instances_get.py +409 -0
- mithril/api/bindings/api/kubernetes_clusters/__init__.py +1 -0
- mithril/api/bindings/api/kubernetes_clusters/create_kubernetes_cluster_v2_kubernetes_clusters_post.py +171 -0
- mithril/api/bindings/api/kubernetes_clusters/delete_kubernetes_cluster_v2_kubernetes_clusters_cluster_fid_delete.py +163 -0
- mithril/api/bindings/api/kubernetes_clusters/get_kubernetes_cluster_v2_kubernetes_clusters_cluster_fid_get.py +165 -0
- mithril/api/bindings/api/kubernetes_clusters/get_kubernetes_clusters_v2_kubernetes_clusters_get.py +175 -0
- mithril/api/bindings/api/lifecycle_scripts/__init__.py +1 -0
- mithril/api/bindings/api/lifecycle_scripts/create_lifecycle_script_v2_lifecycle_scripts_post.py +171 -0
- mithril/api/bindings/api/lifecycle_scripts/delete_lifecycle_script_v2_lifecycle_scripts_ls_fid_delete.py +155 -0
- mithril/api/bindings/api/lifecycle_scripts/get_lifecycle_script_content_v2_lifecycle_scripts_ls_fid_content_get.py +155 -0
- mithril/api/bindings/api/lifecycle_scripts/list_lifecycle_scripts_v2_lifecycle_scripts_get.py +247 -0
- mithril/api/bindings/api/lifecycle_scripts/update_lifecycle_script_v2_lifecycle_scripts_ls_fid_patch.py +179 -0
- mithril/api/bindings/api/pricing/__init__.py +1 -0
- mithril/api/bindings/api/pricing/get_current_prices_v2_v2_pricing_current_get.py +217 -0
- mithril/api/bindings/api/pricing/get_historical_prices_v2_v2_pricing_history_get.py +222 -0
- mithril/api/bindings/api/profile/__init__.py +1 -0
- mithril/api/bindings/api/profile/get_me_v2_me_get.py +132 -0
- mithril/api/bindings/api/profile/get_my_teammates_v2_me_teammates_get.py +153 -0
- mithril/api/bindings/api/projects/__init__.py +1 -0
- mithril/api/bindings/api/projects/get_projects_v2_projects_get.py +137 -0
- mithril/api/bindings/api/quotas/__init__.py +1 -0
- mithril/api/bindings/api/quotas/get_quotas_v2_quotas_get.py +175 -0
- mithril/api/bindings/api/reservations/__init__.py +1 -0
- mithril/api/bindings/api/reservations/create_reservation_v2_reservation_post.py +171 -0
- mithril/api/bindings/api/reservations/extend_reservation_v2_reservation_reservation_fid_extend_post.py +187 -0
- mithril/api/bindings/api/reservations/get_availability_v2_reservation_availability_get.py +664 -0
- mithril/api/bindings/api/reservations/get_extension_availability_v2_reservation_reservation_fid_extension_availability_get.py +165 -0
- mithril/api/bindings/api/reservations/get_reservations_v2_reservation_get.py +309 -0
- mithril/api/bindings/api/reservations/update_reservation_v2_reservation_reservation_fid_patch.py +187 -0
- mithril/api/bindings/api/spot/__init__.py +1 -0
- mithril/api/bindings/api/spot/cancel_bid_v2_spot_bids_bid_fid_delete.py +161 -0
- mithril/api/bindings/api/spot/create_bid_v2_spot_bids_post.py +171 -0
- mithril/api/bindings/api/spot/get_auctions_v2_spot_availability_get.py +137 -0
- mithril/api/bindings/api/spot/get_bid_history_v2_spot_bids_bid_fid_history_get.py +193 -0
- mithril/api/bindings/api/spot/get_bid_status_v2_spot_bids_bid_fid_status_get.py +189 -0
- mithril/api/bindings/api/spot/get_bid_v2_spot_bids_bid_fid_get.py +163 -0
- mithril/api/bindings/api/spot/get_bids_v2_spot_bids_get.py +330 -0
- mithril/api/bindings/api/spot/update_bid_v2_spot_bids_bid_fid_patch.py +185 -0
- mithril/api/bindings/api/ssh_keys/__init__.py +1 -0
- mithril/api/bindings/api/ssh_keys/create_ssh_key_v2_ssh_keys_post.py +175 -0
- mithril/api/bindings/api/ssh_keys/delete_ssh_key_v2_ssh_keys_ssh_key_fid_delete.py +167 -0
- mithril/api/bindings/api/ssh_keys/get_ssh_keys_v2_ssh_keys_get.py +175 -0
- mithril/api/bindings/api/ssh_keys/update_ssh_key_v2_ssh_keys_ssh_key_fid_patch.py +187 -0
- mithril/api/bindings/api/volumes/__init__.py +1 -0
- mithril/api/bindings/api/volumes/create_volume_v2_volumes_post.py +211 -0
- mithril/api/bindings/api/volumes/delete_volume_v2_volumes_volume_fid_delete.py +199 -0
- mithril/api/bindings/api/volumes/get_volumes_v2_volumes_get.py +239 -0
- mithril/api/bindings/api/volumes/update_volume_v2_volumes_volume_fid_patch.py +243 -0
- mithril/api/bindings/client.py +284 -0
- mithril/api/bindings/errors.py +18 -0
- mithril/api/bindings/models/__init__.py +169 -0
- mithril/api/bindings/models/api_key_model.py +114 -0
- mithril/api/bindings/models/auction_model.py +146 -0
- mithril/api/bindings/models/availability_slot_model.py +76 -0
- mithril/api/bindings/models/bid_history_event_model.py +157 -0
- mithril/api/bindings/models/bid_history_event_model_event_type.py +19 -0
- mithril/api/bindings/models/bid_history_response.py +84 -0
- mithril/api/bindings/models/bid_model.py +191 -0
- mithril/api/bindings/models/bid_model_status.py +14 -0
- mithril/api/bindings/models/bid_status_response.py +72 -0
- mithril/api/bindings/models/bid_status_response_status.py +15 -0
- mithril/api/bindings/models/check_availability_response.py +60 -0
- mithril/api/bindings/models/create_api_key_request.py +68 -0
- mithril/api/bindings/models/create_api_key_response.py +122 -0
- mithril/api/bindings/models/create_bid_request.py +116 -0
- mithril/api/bindings/models/create_kubernetes_cluster_request.py +136 -0
- mithril/api/bindings/models/create_kubernetes_cluster_request_k8s_version.py +11 -0
- mithril/api/bindings/models/create_lifecycle_script_request.py +115 -0
- mithril/api/bindings/models/create_reservation_request.py +124 -0
- mithril/api/bindings/models/create_ssh_key_request.py +99 -0
- mithril/api/bindings/models/create_volume_request.py +98 -0
- mithril/api/bindings/models/create_volume_request_disk_interface.py +11 -0
- mithril/api/bindings/models/created_ssh_key_model.py +122 -0
- mithril/api/bindings/models/current_prices_response.py +202 -0
- mithril/api/bindings/models/extend_reservation_request.py +60 -0
- mithril/api/bindings/models/extension_availability_response.py +68 -0
- mithril/api/bindings/models/get_availability_v2_reservation_availability_get_mode.py +12 -0
- mithril/api/bindings/models/get_bids_response.py +96 -0
- mithril/api/bindings/models/get_bids_v2_spot_bids_get_sort_by.py +11 -0
- mithril/api/bindings/models/get_bids_v2_spot_bids_get_status.py +14 -0
- mithril/api/bindings/models/get_instances_response.py +96 -0
- mithril/api/bindings/models/get_instances_v2_instances_get_order_type_in_type_0_item.py +11 -0
- mithril/api/bindings/models/get_instances_v2_instances_get_sort_by.py +12 -0
- mithril/api/bindings/models/get_instances_v2_instances_get_status_in_type_0_item.py +24 -0
- mithril/api/bindings/models/get_latest_end_time_response.py +68 -0
- mithril/api/bindings/models/get_reservations_response.py +96 -0
- mithril/api/bindings/models/get_reservations_v2_reservation_get_sort_by.py +11 -0
- mithril/api/bindings/models/get_reservations_v2_reservation_get_status.py +14 -0
- mithril/api/bindings/models/historical_price_point_model.py +94 -0
- mithril/api/bindings/models/historical_prices_response_model.py +76 -0
- mithril/api/bindings/models/http_validation_error.py +78 -0
- mithril/api/bindings/models/image_version_model.py +224 -0
- mithril/api/bindings/models/instance_model.py +211 -0
- mithril/api/bindings/models/instance_model_status.py +24 -0
- mithril/api/bindings/models/instance_status_response.py +141 -0
- mithril/api/bindings/models/instance_status_response_status.py +24 -0
- mithril/api/bindings/models/instance_type_model.py +170 -0
- mithril/api/bindings/models/kubernetes_cluster_model.py +207 -0
- mithril/api/bindings/models/kubernetes_cluster_model_status.py +12 -0
- mithril/api/bindings/models/launch_specification_model.py +152 -0
- mithril/api/bindings/models/lifecycle_script_model.py +134 -0
- mithril/api/bindings/models/lifecycle_script_scope.py +12 -0
- mithril/api/bindings/models/list_lifecycle_scripts_response.py +96 -0
- mithril/api/bindings/models/list_lifecycle_scripts_v2_lifecycle_scripts_get_sort_by.py +11 -0
- mithril/api/bindings/models/me_response.py +126 -0
- mithril/api/bindings/models/new_ssh_key_model.py +100 -0
- mithril/api/bindings/models/persistent_disk_change.py +92 -0
- mithril/api/bindings/models/project_model.py +76 -0
- mithril/api/bindings/models/public_lifecycle_script_scope.py +11 -0
- mithril/api/bindings/models/quota_model.py +132 -0
- mithril/api/bindings/models/reservation_model.py +215 -0
- mithril/api/bindings/models/reservation_model_status.py +14 -0
- mithril/api/bindings/models/size.py +70 -0
- mithril/api/bindings/models/size_unit.py +18 -0
- mithril/api/bindings/models/sort_direction.py +11 -0
- mithril/api/bindings/models/teammate_response.py +158 -0
- mithril/api/bindings/models/update_bid_request.py +143 -0
- mithril/api/bindings/models/update_lifecycle_script_request.py +109 -0
- mithril/api/bindings/models/update_reservation_request.py +103 -0
- mithril/api/bindings/models/update_ssh_key_request.py +60 -0
- mithril/api/bindings/models/update_volume_request.py +65 -0
- mithril/api/bindings/models/validation_error.py +89 -0
- mithril/api/bindings/models/volume_model.py +140 -0
- mithril/api/bindings/models/volume_model_attachments.py +46 -0
- mithril/api/bindings/models/volume_model_interface.py +11 -0
- mithril/api/bindings/types.py +56 -0
- mithril/api/client.py +138 -0
- mithril/cli/__init__.py +7 -0
- mithril/cli/commands/__init__.py +15 -0
- mithril/cli/commands/help.py +88 -0
- mithril/cli/commands/launch.py +353 -0
- mithril/cli/main.py +68 -0
- mithril/cli/utils/__init__.py +1 -0
- mithril/cli/utils/skypilot_passthrough.py +38 -0
- mithril/cli/utils/streaming.py +235 -0
- mithril/cli/utils/volumes.py +110 -0
- mithril/config.py +47 -0
- mithril/py.typed +0 -0
- mithril/sky/__init__.py +141 -0
- mithril/sky/client.py +176 -0
- mithril_client-0.1.0a1.dist-info/METADATA +56 -0
- mithril_client-0.1.0a1.dist-info/RECORD +163 -0
- mithril_client-0.1.0a1.dist-info/WHEEL +4 -0
- mithril_client-0.1.0a1.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from http import HTTPStatus
|
|
4
|
+
from typing import Any
|
|
5
|
+
from urllib.parse import quote
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ... import errors
|
|
10
|
+
from ...client import AuthenticatedClient, Client
|
|
11
|
+
from ...models.bid_status_response import BidStatusResponse
|
|
12
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
bid_fid: str,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "get",
|
|
21
|
+
"url": "/v2/spot/bids/{bid_fid}/status".format(
|
|
22
|
+
bid_fid=quote(str(bid_fid), safe="")
|
|
23
|
+
),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _kwargs
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _parse_response(
|
|
30
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
31
|
+
) -> BidStatusResponse | HTTPValidationError | None:
|
|
32
|
+
if response.status_code == 200:
|
|
33
|
+
response_200 = BidStatusResponse.from_dict(response.json())
|
|
34
|
+
|
|
35
|
+
return response_200
|
|
36
|
+
|
|
37
|
+
if response.status_code == 422:
|
|
38
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_422
|
|
41
|
+
|
|
42
|
+
if client.raise_on_unexpected_status:
|
|
43
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
49
|
+
) -> Response[BidStatusResponse | HTTPValidationError]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
bid_fid: str,
|
|
60
|
+
*,
|
|
61
|
+
client: AuthenticatedClient,
|
|
62
|
+
) -> Response[BidStatusResponse | HTTPValidationError]:
|
|
63
|
+
r"""Get Bid Status
|
|
64
|
+
|
|
65
|
+
Get detailed status of a Spot bid.
|
|
66
|
+
|
|
67
|
+
Returns a detailed status that includes instance-level status information.
|
|
68
|
+
The status can be one of: Open, Allocated, Preempting, Terminated,
|
|
69
|
+
Paused, Relocating.
|
|
70
|
+
|
|
71
|
+
\"Relocating\" indicates that part of the order is being relocated.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
bid_fid (str):
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
78
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Response[BidStatusResponse | HTTPValidationError]
|
|
82
|
+
"""
|
|
83
|
+
kwargs = _get_kwargs(
|
|
84
|
+
bid_fid=bid_fid,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
response = client.get_httpx_client().request(
|
|
88
|
+
**kwargs,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return _build_response(client=client, response=response)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync(
|
|
95
|
+
bid_fid: str,
|
|
96
|
+
*,
|
|
97
|
+
client: AuthenticatedClient,
|
|
98
|
+
) -> BidStatusResponse | HTTPValidationError | None:
|
|
99
|
+
r"""Get Bid Status
|
|
100
|
+
|
|
101
|
+
Get detailed status of a Spot bid.
|
|
102
|
+
|
|
103
|
+
Returns a detailed status that includes instance-level status information.
|
|
104
|
+
The status can be one of: Open, Allocated, Preempting, Terminated,
|
|
105
|
+
Paused, Relocating.
|
|
106
|
+
|
|
107
|
+
\"Relocating\" indicates that part of the order is being relocated.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
bid_fid (str):
|
|
111
|
+
|
|
112
|
+
Raises:
|
|
113
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
114
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
BidStatusResponse | HTTPValidationError
|
|
118
|
+
"""
|
|
119
|
+
return sync_detailed(
|
|
120
|
+
bid_fid=bid_fid,
|
|
121
|
+
client=client,
|
|
122
|
+
).parsed
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
async def asyncio_detailed(
|
|
126
|
+
bid_fid: str,
|
|
127
|
+
*,
|
|
128
|
+
client: AuthenticatedClient,
|
|
129
|
+
) -> Response[BidStatusResponse | HTTPValidationError]:
|
|
130
|
+
r"""Get Bid Status
|
|
131
|
+
|
|
132
|
+
Get detailed status of a Spot bid.
|
|
133
|
+
|
|
134
|
+
Returns a detailed status that includes instance-level status information.
|
|
135
|
+
The status can be one of: Open, Allocated, Preempting, Terminated,
|
|
136
|
+
Paused, Relocating.
|
|
137
|
+
|
|
138
|
+
\"Relocating\" indicates that part of the order is being relocated.
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
bid_fid (str):
|
|
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[BidStatusResponse | HTTPValidationError]
|
|
149
|
+
"""
|
|
150
|
+
kwargs = _get_kwargs(
|
|
151
|
+
bid_fid=bid_fid,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
155
|
+
|
|
156
|
+
return _build_response(client=client, response=response)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
async def asyncio(
|
|
160
|
+
bid_fid: str,
|
|
161
|
+
*,
|
|
162
|
+
client: AuthenticatedClient,
|
|
163
|
+
) -> BidStatusResponse | HTTPValidationError | None:
|
|
164
|
+
r"""Get Bid Status
|
|
165
|
+
|
|
166
|
+
Get detailed status of a Spot bid.
|
|
167
|
+
|
|
168
|
+
Returns a detailed status that includes instance-level status information.
|
|
169
|
+
The status can be one of: Open, Allocated, Preempting, Terminated,
|
|
170
|
+
Paused, Relocating.
|
|
171
|
+
|
|
172
|
+
\"Relocating\" indicates that part of the order is being relocated.
|
|
173
|
+
|
|
174
|
+
Args:
|
|
175
|
+
bid_fid (str):
|
|
176
|
+
|
|
177
|
+
Raises:
|
|
178
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
179
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
BidStatusResponse | HTTPValidationError
|
|
183
|
+
"""
|
|
184
|
+
return (
|
|
185
|
+
await asyncio_detailed(
|
|
186
|
+
bid_fid=bid_fid,
|
|
187
|
+
client=client,
|
|
188
|
+
)
|
|
189
|
+
).parsed
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from http import HTTPStatus
|
|
4
|
+
from typing import Any
|
|
5
|
+
from urllib.parse import quote
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ... import errors
|
|
10
|
+
from ...client import AuthenticatedClient, Client
|
|
11
|
+
from ...models.bid_model import BidModel
|
|
12
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
bid_fid: str,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "get",
|
|
21
|
+
"url": "/v2/spot/bids/{bid_fid}".format(bid_fid=quote(str(bid_fid), safe="")),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return _kwargs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_response(
|
|
28
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
29
|
+
) -> BidModel | HTTPValidationError | None:
|
|
30
|
+
if response.status_code == 200:
|
|
31
|
+
response_200 = BidModel.from_dict(response.json())
|
|
32
|
+
|
|
33
|
+
return response_200
|
|
34
|
+
|
|
35
|
+
if response.status_code == 422:
|
|
36
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_422
|
|
39
|
+
|
|
40
|
+
if client.raise_on_unexpected_status:
|
|
41
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _build_response(
|
|
46
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
47
|
+
) -> Response[BidModel | HTTPValidationError]:
|
|
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
|
+
bid_fid: str,
|
|
58
|
+
*,
|
|
59
|
+
client: AuthenticatedClient,
|
|
60
|
+
) -> Response[BidModel | HTTPValidationError]:
|
|
61
|
+
"""Get Bid
|
|
62
|
+
|
|
63
|
+
Get a single Spot bid by FID
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
bid_fid (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[BidModel | HTTPValidationError]
|
|
74
|
+
"""
|
|
75
|
+
kwargs = _get_kwargs(
|
|
76
|
+
bid_fid=bid_fid,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
response = client.get_httpx_client().request(
|
|
80
|
+
**kwargs,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return _build_response(client=client, response=response)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def sync(
|
|
87
|
+
bid_fid: str,
|
|
88
|
+
*,
|
|
89
|
+
client: AuthenticatedClient,
|
|
90
|
+
) -> BidModel | HTTPValidationError | None:
|
|
91
|
+
"""Get Bid
|
|
92
|
+
|
|
93
|
+
Get a single Spot bid by FID
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
bid_fid (str):
|
|
97
|
+
|
|
98
|
+
Raises:
|
|
99
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
100
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
BidModel | HTTPValidationError
|
|
104
|
+
"""
|
|
105
|
+
return sync_detailed(
|
|
106
|
+
bid_fid=bid_fid,
|
|
107
|
+
client=client,
|
|
108
|
+
).parsed
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def asyncio_detailed(
|
|
112
|
+
bid_fid: str,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
) -> Response[BidModel | HTTPValidationError]:
|
|
116
|
+
"""Get Bid
|
|
117
|
+
|
|
118
|
+
Get a single Spot bid by FID
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
bid_fid (str):
|
|
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
|
+
Response[BidModel | HTTPValidationError]
|
|
129
|
+
"""
|
|
130
|
+
kwargs = _get_kwargs(
|
|
131
|
+
bid_fid=bid_fid,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
135
|
+
|
|
136
|
+
return _build_response(client=client, response=response)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio(
|
|
140
|
+
bid_fid: str,
|
|
141
|
+
*,
|
|
142
|
+
client: AuthenticatedClient,
|
|
143
|
+
) -> BidModel | HTTPValidationError | None:
|
|
144
|
+
"""Get Bid
|
|
145
|
+
|
|
146
|
+
Get a single Spot bid by FID
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
bid_fid (str):
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
BidModel | HTTPValidationError
|
|
157
|
+
"""
|
|
158
|
+
return (
|
|
159
|
+
await asyncio_detailed(
|
|
160
|
+
bid_fid=bid_fid,
|
|
161
|
+
client=client,
|
|
162
|
+
)
|
|
163
|
+
).parsed
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from http import HTTPStatus
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
from ... import errors
|
|
9
|
+
from ...client import AuthenticatedClient, Client
|
|
10
|
+
from ...models.get_bids_response import GetBidsResponse
|
|
11
|
+
from ...models.get_bids_v2_spot_bids_get_sort_by import GetBidsV2SpotBidsGetSortBy
|
|
12
|
+
from ...models.get_bids_v2_spot_bids_get_status import GetBidsV2SpotBidsGetStatus
|
|
13
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
14
|
+
from ...models.sort_direction import SortDirection
|
|
15
|
+
from ...types import UNSET, Response, Unset
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _get_kwargs(
|
|
19
|
+
*,
|
|
20
|
+
next_cursor: Any | Unset = UNSET,
|
|
21
|
+
sort_by: GetBidsV2SpotBidsGetSortBy | Unset = UNSET,
|
|
22
|
+
sort_dir: SortDirection | Unset = UNSET,
|
|
23
|
+
project: None | str | Unset = UNSET,
|
|
24
|
+
instance_type: None | str | Unset = UNSET,
|
|
25
|
+
region: None | str | Unset = UNSET,
|
|
26
|
+
status: GetBidsV2SpotBidsGetStatus | Unset = UNSET,
|
|
27
|
+
name: None | str | Unset = UNSET,
|
|
28
|
+
limit: int | None | Unset = UNSET,
|
|
29
|
+
) -> dict[str, Any]:
|
|
30
|
+
params: dict[str, Any] = {}
|
|
31
|
+
|
|
32
|
+
params["next_cursor"] = next_cursor
|
|
33
|
+
|
|
34
|
+
json_sort_by: str | Unset = UNSET
|
|
35
|
+
if not isinstance(sort_by, Unset):
|
|
36
|
+
json_sort_by = sort_by.value
|
|
37
|
+
|
|
38
|
+
params["sort_by"] = json_sort_by
|
|
39
|
+
|
|
40
|
+
json_sort_dir: str | Unset = UNSET
|
|
41
|
+
if not isinstance(sort_dir, Unset):
|
|
42
|
+
json_sort_dir = sort_dir.value
|
|
43
|
+
|
|
44
|
+
params["sort_dir"] = json_sort_dir
|
|
45
|
+
|
|
46
|
+
json_project: None | str | Unset
|
|
47
|
+
if isinstance(project, Unset):
|
|
48
|
+
json_project = UNSET
|
|
49
|
+
else:
|
|
50
|
+
json_project = project
|
|
51
|
+
params["project"] = json_project
|
|
52
|
+
|
|
53
|
+
json_instance_type: None | str | Unset
|
|
54
|
+
if isinstance(instance_type, Unset):
|
|
55
|
+
json_instance_type = UNSET
|
|
56
|
+
else:
|
|
57
|
+
json_instance_type = instance_type
|
|
58
|
+
params["instance_type"] = json_instance_type
|
|
59
|
+
|
|
60
|
+
json_region: None | str | Unset
|
|
61
|
+
if isinstance(region, Unset):
|
|
62
|
+
json_region = UNSET
|
|
63
|
+
else:
|
|
64
|
+
json_region = region
|
|
65
|
+
params["region"] = json_region
|
|
66
|
+
|
|
67
|
+
json_status: str | Unset = UNSET
|
|
68
|
+
if not isinstance(status, Unset):
|
|
69
|
+
json_status = status.value
|
|
70
|
+
|
|
71
|
+
params["status"] = json_status
|
|
72
|
+
|
|
73
|
+
json_name: None | str | Unset
|
|
74
|
+
if isinstance(name, Unset):
|
|
75
|
+
json_name = UNSET
|
|
76
|
+
else:
|
|
77
|
+
json_name = name
|
|
78
|
+
params["name"] = json_name
|
|
79
|
+
|
|
80
|
+
json_limit: int | None | Unset
|
|
81
|
+
if isinstance(limit, Unset):
|
|
82
|
+
json_limit = UNSET
|
|
83
|
+
else:
|
|
84
|
+
json_limit = limit
|
|
85
|
+
params["limit"] = json_limit
|
|
86
|
+
|
|
87
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
88
|
+
|
|
89
|
+
_kwargs: dict[str, Any] = {
|
|
90
|
+
"method": "get",
|
|
91
|
+
"url": "/v2/spot/bids",
|
|
92
|
+
"params": params,
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return _kwargs
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _parse_response(
|
|
99
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
100
|
+
) -> GetBidsResponse | HTTPValidationError | None:
|
|
101
|
+
if response.status_code == 200:
|
|
102
|
+
response_200 = GetBidsResponse.from_dict(response.json())
|
|
103
|
+
|
|
104
|
+
return response_200
|
|
105
|
+
|
|
106
|
+
if response.status_code == 422:
|
|
107
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
108
|
+
|
|
109
|
+
return response_422
|
|
110
|
+
|
|
111
|
+
if client.raise_on_unexpected_status:
|
|
112
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
113
|
+
return None
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _build_response(
|
|
117
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
118
|
+
) -> Response[GetBidsResponse | HTTPValidationError]:
|
|
119
|
+
return Response(
|
|
120
|
+
status_code=HTTPStatus(response.status_code),
|
|
121
|
+
content=response.content,
|
|
122
|
+
headers=response.headers,
|
|
123
|
+
parsed=_parse_response(client=client, response=response),
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def sync_detailed(
|
|
128
|
+
*,
|
|
129
|
+
client: AuthenticatedClient,
|
|
130
|
+
next_cursor: Any | Unset = UNSET,
|
|
131
|
+
sort_by: GetBidsV2SpotBidsGetSortBy | Unset = UNSET,
|
|
132
|
+
sort_dir: SortDirection | Unset = UNSET,
|
|
133
|
+
project: None | str | Unset = UNSET,
|
|
134
|
+
instance_type: None | str | Unset = UNSET,
|
|
135
|
+
region: None | str | Unset = UNSET,
|
|
136
|
+
status: GetBidsV2SpotBidsGetStatus | Unset = UNSET,
|
|
137
|
+
name: None | str | Unset = UNSET,
|
|
138
|
+
limit: int | None | Unset = UNSET,
|
|
139
|
+
) -> Response[GetBidsResponse | HTTPValidationError]:
|
|
140
|
+
"""Get Bids
|
|
141
|
+
|
|
142
|
+
Get all Spot bids for a project, or all user's projects if not specified
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
next_cursor (Any | Unset):
|
|
146
|
+
sort_by (GetBidsV2SpotBidsGetSortBy | Unset):
|
|
147
|
+
sort_dir (SortDirection | Unset):
|
|
148
|
+
project (None | str | Unset):
|
|
149
|
+
instance_type (None | str | Unset):
|
|
150
|
+
region (None | str | Unset):
|
|
151
|
+
status (GetBidsV2SpotBidsGetStatus | Unset):
|
|
152
|
+
name (None | str | Unset):
|
|
153
|
+
limit (int | None | Unset):
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
Response[GetBidsResponse | HTTPValidationError]
|
|
161
|
+
"""
|
|
162
|
+
kwargs = _get_kwargs(
|
|
163
|
+
next_cursor=next_cursor,
|
|
164
|
+
sort_by=sort_by,
|
|
165
|
+
sort_dir=sort_dir,
|
|
166
|
+
project=project,
|
|
167
|
+
instance_type=instance_type,
|
|
168
|
+
region=region,
|
|
169
|
+
status=status,
|
|
170
|
+
name=name,
|
|
171
|
+
limit=limit,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
response = client.get_httpx_client().request(
|
|
175
|
+
**kwargs,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
return _build_response(client=client, response=response)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def sync(
|
|
182
|
+
*,
|
|
183
|
+
client: AuthenticatedClient,
|
|
184
|
+
next_cursor: Any | Unset = UNSET,
|
|
185
|
+
sort_by: GetBidsV2SpotBidsGetSortBy | Unset = UNSET,
|
|
186
|
+
sort_dir: SortDirection | Unset = UNSET,
|
|
187
|
+
project: None | str | Unset = UNSET,
|
|
188
|
+
instance_type: None | str | Unset = UNSET,
|
|
189
|
+
region: None | str | Unset = UNSET,
|
|
190
|
+
status: GetBidsV2SpotBidsGetStatus | Unset = UNSET,
|
|
191
|
+
name: None | str | Unset = UNSET,
|
|
192
|
+
limit: int | None | Unset = UNSET,
|
|
193
|
+
) -> GetBidsResponse | HTTPValidationError | None:
|
|
194
|
+
"""Get Bids
|
|
195
|
+
|
|
196
|
+
Get all Spot bids for a project, or all user's projects if not specified
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
next_cursor (Any | Unset):
|
|
200
|
+
sort_by (GetBidsV2SpotBidsGetSortBy | Unset):
|
|
201
|
+
sort_dir (SortDirection | Unset):
|
|
202
|
+
project (None | str | Unset):
|
|
203
|
+
instance_type (None | str | Unset):
|
|
204
|
+
region (None | str | Unset):
|
|
205
|
+
status (GetBidsV2SpotBidsGetStatus | Unset):
|
|
206
|
+
name (None | str | Unset):
|
|
207
|
+
limit (int | None | Unset):
|
|
208
|
+
|
|
209
|
+
Raises:
|
|
210
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
211
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
212
|
+
|
|
213
|
+
Returns:
|
|
214
|
+
GetBidsResponse | HTTPValidationError
|
|
215
|
+
"""
|
|
216
|
+
return sync_detailed(
|
|
217
|
+
client=client,
|
|
218
|
+
next_cursor=next_cursor,
|
|
219
|
+
sort_by=sort_by,
|
|
220
|
+
sort_dir=sort_dir,
|
|
221
|
+
project=project,
|
|
222
|
+
instance_type=instance_type,
|
|
223
|
+
region=region,
|
|
224
|
+
status=status,
|
|
225
|
+
name=name,
|
|
226
|
+
limit=limit,
|
|
227
|
+
).parsed
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
async def asyncio_detailed(
|
|
231
|
+
*,
|
|
232
|
+
client: AuthenticatedClient,
|
|
233
|
+
next_cursor: Any | Unset = UNSET,
|
|
234
|
+
sort_by: GetBidsV2SpotBidsGetSortBy | Unset = UNSET,
|
|
235
|
+
sort_dir: SortDirection | Unset = UNSET,
|
|
236
|
+
project: None | str | Unset = UNSET,
|
|
237
|
+
instance_type: None | str | Unset = UNSET,
|
|
238
|
+
region: None | str | Unset = UNSET,
|
|
239
|
+
status: GetBidsV2SpotBidsGetStatus | Unset = UNSET,
|
|
240
|
+
name: None | str | Unset = UNSET,
|
|
241
|
+
limit: int | None | Unset = UNSET,
|
|
242
|
+
) -> Response[GetBidsResponse | HTTPValidationError]:
|
|
243
|
+
"""Get Bids
|
|
244
|
+
|
|
245
|
+
Get all Spot bids for a project, or all user's projects if not specified
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
next_cursor (Any | Unset):
|
|
249
|
+
sort_by (GetBidsV2SpotBidsGetSortBy | Unset):
|
|
250
|
+
sort_dir (SortDirection | Unset):
|
|
251
|
+
project (None | str | Unset):
|
|
252
|
+
instance_type (None | str | Unset):
|
|
253
|
+
region (None | str | Unset):
|
|
254
|
+
status (GetBidsV2SpotBidsGetStatus | Unset):
|
|
255
|
+
name (None | str | Unset):
|
|
256
|
+
limit (int | None | Unset):
|
|
257
|
+
|
|
258
|
+
Raises:
|
|
259
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
260
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
261
|
+
|
|
262
|
+
Returns:
|
|
263
|
+
Response[GetBidsResponse | HTTPValidationError]
|
|
264
|
+
"""
|
|
265
|
+
kwargs = _get_kwargs(
|
|
266
|
+
next_cursor=next_cursor,
|
|
267
|
+
sort_by=sort_by,
|
|
268
|
+
sort_dir=sort_dir,
|
|
269
|
+
project=project,
|
|
270
|
+
instance_type=instance_type,
|
|
271
|
+
region=region,
|
|
272
|
+
status=status,
|
|
273
|
+
name=name,
|
|
274
|
+
limit=limit,
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
278
|
+
|
|
279
|
+
return _build_response(client=client, response=response)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
async def asyncio(
|
|
283
|
+
*,
|
|
284
|
+
client: AuthenticatedClient,
|
|
285
|
+
next_cursor: Any | Unset = UNSET,
|
|
286
|
+
sort_by: GetBidsV2SpotBidsGetSortBy | Unset = UNSET,
|
|
287
|
+
sort_dir: SortDirection | Unset = UNSET,
|
|
288
|
+
project: None | str | Unset = UNSET,
|
|
289
|
+
instance_type: None | str | Unset = UNSET,
|
|
290
|
+
region: None | str | Unset = UNSET,
|
|
291
|
+
status: GetBidsV2SpotBidsGetStatus | Unset = UNSET,
|
|
292
|
+
name: None | str | Unset = UNSET,
|
|
293
|
+
limit: int | None | Unset = UNSET,
|
|
294
|
+
) -> GetBidsResponse | HTTPValidationError | None:
|
|
295
|
+
"""Get Bids
|
|
296
|
+
|
|
297
|
+
Get all Spot bids for a project, or all user's projects if not specified
|
|
298
|
+
|
|
299
|
+
Args:
|
|
300
|
+
next_cursor (Any | Unset):
|
|
301
|
+
sort_by (GetBidsV2SpotBidsGetSortBy | Unset):
|
|
302
|
+
sort_dir (SortDirection | Unset):
|
|
303
|
+
project (None | str | Unset):
|
|
304
|
+
instance_type (None | str | Unset):
|
|
305
|
+
region (None | str | Unset):
|
|
306
|
+
status (GetBidsV2SpotBidsGetStatus | Unset):
|
|
307
|
+
name (None | str | Unset):
|
|
308
|
+
limit (int | None | Unset):
|
|
309
|
+
|
|
310
|
+
Raises:
|
|
311
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
312
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
313
|
+
|
|
314
|
+
Returns:
|
|
315
|
+
GetBidsResponse | HTTPValidationError
|
|
316
|
+
"""
|
|
317
|
+
return (
|
|
318
|
+
await asyncio_detailed(
|
|
319
|
+
client=client,
|
|
320
|
+
next_cursor=next_cursor,
|
|
321
|
+
sort_by=sort_by,
|
|
322
|
+
sort_dir=sort_dir,
|
|
323
|
+
project=project,
|
|
324
|
+
instance_type=instance_type,
|
|
325
|
+
region=region,
|
|
326
|
+
status=status,
|
|
327
|
+
name=name,
|
|
328
|
+
limit=limit,
|
|
329
|
+
)
|
|
330
|
+
).parsed
|