blaxel 0.1.9rc36__py3-none-any.whl → 0.1.10__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/agents/__init__.py +52 -15
- blaxel/authentication/__init__.py +11 -2
- blaxel/client/api/compute/create_sandbox_preview.py +179 -0
- blaxel/client/api/compute/create_sandbox_preview_token.py +192 -0
- blaxel/client/api/compute/delete_sandbox_preview.py +167 -0
- blaxel/client/api/compute/delete_sandbox_preview_token.py +180 -0
- blaxel/client/api/compute/get_sandbox_preview.py +167 -0
- blaxel/client/api/compute/list_sandbox_preview_tokens.py +172 -0
- blaxel/client/api/compute/list_sandbox_previews.py +159 -0
- blaxel/client/api/compute/update_sandbox_preview.py +192 -0
- blaxel/client/api/integrations/get_integration.py +64 -7
- blaxel/client/api/workspaces/check_workspace_availability.py +165 -0
- blaxel/client/models/__init__.py +32 -2
- blaxel/client/models/check_workspace_availability_body.py +60 -0
- blaxel/client/models/delete_sandbox_preview_token_response_200.py +60 -0
- blaxel/client/models/integration.py +197 -0
- blaxel/client/models/integration_additional_infos.py +45 -0
- blaxel/client/models/integration_endpoint.py +143 -0
- blaxel/client/models/integration_endpoint_token.py +79 -0
- blaxel/client/models/integration_endpoints.py +61 -0
- blaxel/client/models/integration_headers.py +45 -0
- blaxel/client/models/integration_organization.py +88 -0
- blaxel/client/models/integration_query_params.py +45 -0
- blaxel/client/models/metrics.py +9 -0
- blaxel/client/models/preview.py +96 -0
- blaxel/client/models/preview_metadata.py +133 -0
- blaxel/client/models/preview_spec.py +79 -0
- blaxel/client/models/preview_token.py +96 -0
- blaxel/client/models/preview_token_metadata.py +97 -0
- blaxel/client/models/preview_token_spec.py +88 -0
- blaxel/common/autoload.py +0 -2
- blaxel/common/internal.py +75 -0
- blaxel/common/settings.py +6 -1
- blaxel/mcp/server.py +2 -1
- 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 +188 -0
- blaxel/sandbox/client/api/process/get_process_identifier_logs_stream.py +190 -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 +41 -0
- blaxel/sandbox/client/models/delete_network_process_pid_monitor_response_200.py +45 -0
- blaxel/sandbox/client/models/directory.py +112 -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/get_process_identifier_logs_stream_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/subdirectory.py +60 -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 +62 -21
- {blaxel-0.1.9rc36.dist-info → blaxel-0.1.10.dist-info}/METADATA +1 -1
- {blaxel-0.1.9rc36.dist-info → blaxel-0.1.10.dist-info}/RECORD +82 -14
- blaxel/client/models/sandboxes.py +0 -129
- {blaxel-0.1.9rc36.dist-info → blaxel-0.1.10.dist-info}/WHEEL +0 -0
- {blaxel-0.1.9rc36.dist-info → blaxel-0.1.10.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,192 @@
|
|
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.preview import Preview
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
sandbox_name: str,
|
14
|
+
preview_name: str,
|
15
|
+
*,
|
16
|
+
body: Preview,
|
17
|
+
) -> dict[str, Any]:
|
18
|
+
headers: dict[str, Any] = {}
|
19
|
+
|
20
|
+
_kwargs: dict[str, Any] = {
|
21
|
+
"method": "put",
|
22
|
+
"url": f"/sandboxes/{sandbox_name}/previews/{preview_name}",
|
23
|
+
}
|
24
|
+
|
25
|
+
if type(body) == dict:
|
26
|
+
_body = body
|
27
|
+
else:
|
28
|
+
_body = body.to_dict()
|
29
|
+
|
30
|
+
_kwargs["json"] = _body
|
31
|
+
headers["Content-Type"] = "application/json"
|
32
|
+
|
33
|
+
_kwargs["headers"] = headers
|
34
|
+
return _kwargs
|
35
|
+
|
36
|
+
|
37
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Preview]:
|
38
|
+
if response.status_code == 200:
|
39
|
+
response_200 = Preview.from_dict(response.json())
|
40
|
+
|
41
|
+
return response_200
|
42
|
+
if client.raise_on_unexpected_status:
|
43
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
44
|
+
else:
|
45
|
+
return None
|
46
|
+
|
47
|
+
|
48
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Preview]:
|
49
|
+
return Response(
|
50
|
+
status_code=HTTPStatus(response.status_code),
|
51
|
+
content=response.content,
|
52
|
+
headers=response.headers,
|
53
|
+
parsed=_parse_response(client=client, response=response),
|
54
|
+
)
|
55
|
+
|
56
|
+
|
57
|
+
def sync_detailed(
|
58
|
+
sandbox_name: str,
|
59
|
+
preview_name: str,
|
60
|
+
*,
|
61
|
+
client: Union[Client],
|
62
|
+
body: Preview,
|
63
|
+
) -> Response[Preview]:
|
64
|
+
"""Update Sandbox Preview
|
65
|
+
|
66
|
+
Updates a Sandbox Preview by name.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
sandbox_name (str):
|
70
|
+
preview_name (str):
|
71
|
+
body (Preview): Preview of a Resource
|
72
|
+
|
73
|
+
Raises:
|
74
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
75
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
76
|
+
|
77
|
+
Returns:
|
78
|
+
Response[Preview]
|
79
|
+
"""
|
80
|
+
|
81
|
+
kwargs = _get_kwargs(
|
82
|
+
sandbox_name=sandbox_name,
|
83
|
+
preview_name=preview_name,
|
84
|
+
body=body,
|
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
|
+
sandbox_name: str,
|
96
|
+
preview_name: str,
|
97
|
+
*,
|
98
|
+
client: Union[Client],
|
99
|
+
body: Preview,
|
100
|
+
) -> Optional[Preview]:
|
101
|
+
"""Update Sandbox Preview
|
102
|
+
|
103
|
+
Updates a Sandbox Preview by name.
|
104
|
+
|
105
|
+
Args:
|
106
|
+
sandbox_name (str):
|
107
|
+
preview_name (str):
|
108
|
+
body (Preview): Preview of a Resource
|
109
|
+
|
110
|
+
Raises:
|
111
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
112
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
113
|
+
|
114
|
+
Returns:
|
115
|
+
Preview
|
116
|
+
"""
|
117
|
+
|
118
|
+
return sync_detailed(
|
119
|
+
sandbox_name=sandbox_name,
|
120
|
+
preview_name=preview_name,
|
121
|
+
client=client,
|
122
|
+
body=body,
|
123
|
+
).parsed
|
124
|
+
|
125
|
+
|
126
|
+
async def asyncio_detailed(
|
127
|
+
sandbox_name: str,
|
128
|
+
preview_name: str,
|
129
|
+
*,
|
130
|
+
client: Union[Client],
|
131
|
+
body: Preview,
|
132
|
+
) -> Response[Preview]:
|
133
|
+
"""Update Sandbox Preview
|
134
|
+
|
135
|
+
Updates a Sandbox Preview by name.
|
136
|
+
|
137
|
+
Args:
|
138
|
+
sandbox_name (str):
|
139
|
+
preview_name (str):
|
140
|
+
body (Preview): Preview of a Resource
|
141
|
+
|
142
|
+
Raises:
|
143
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
144
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
145
|
+
|
146
|
+
Returns:
|
147
|
+
Response[Preview]
|
148
|
+
"""
|
149
|
+
|
150
|
+
kwargs = _get_kwargs(
|
151
|
+
sandbox_name=sandbox_name,
|
152
|
+
preview_name=preview_name,
|
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
|
+
sandbox_name: str,
|
163
|
+
preview_name: str,
|
164
|
+
*,
|
165
|
+
client: Union[Client],
|
166
|
+
body: Preview,
|
167
|
+
) -> Optional[Preview]:
|
168
|
+
"""Update Sandbox Preview
|
169
|
+
|
170
|
+
Updates a Sandbox Preview by name.
|
171
|
+
|
172
|
+
Args:
|
173
|
+
sandbox_name (str):
|
174
|
+
preview_name (str):
|
175
|
+
body (Preview): Preview of a Resource
|
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
|
+
Preview
|
183
|
+
"""
|
184
|
+
|
185
|
+
return (
|
186
|
+
await asyncio_detailed(
|
187
|
+
sandbox_name=sandbox_name,
|
188
|
+
preview_name=preview_name,
|
189
|
+
client=client,
|
190
|
+
body=body,
|
191
|
+
)
|
192
|
+
).parsed
|
@@ -5,6 +5,7 @@ import httpx
|
|
5
5
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import Client
|
8
|
+
from ...models.integration import Integration
|
8
9
|
from ...types import Response
|
9
10
|
|
10
11
|
|
@@ -19,16 +20,18 @@ def _get_kwargs(
|
|
19
20
|
return _kwargs
|
20
21
|
|
21
22
|
|
22
|
-
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[
|
23
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Integration]:
|
23
24
|
if response.status_code == 200:
|
24
|
-
|
25
|
+
response_200 = Integration.from_dict(response.json())
|
26
|
+
|
27
|
+
return response_200
|
25
28
|
if client.raise_on_unexpected_status:
|
26
29
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
27
30
|
else:
|
28
31
|
return None
|
29
32
|
|
30
33
|
|
31
|
-
def _build_response(*, client: Client, response: httpx.Response) -> Response[
|
34
|
+
def _build_response(*, client: Client, response: httpx.Response) -> Response[Integration]:
|
32
35
|
return Response(
|
33
36
|
status_code=HTTPStatus(response.status_code),
|
34
37
|
content=response.content,
|
@@ -41,7 +44,7 @@ def sync_detailed(
|
|
41
44
|
integration_name: str,
|
42
45
|
*,
|
43
46
|
client: Union[Client],
|
44
|
-
) -> Response[
|
47
|
+
) -> Response[Integration]:
|
45
48
|
"""List integrations connections
|
46
49
|
|
47
50
|
Returns integration information by name.
|
@@ -54,7 +57,7 @@ def sync_detailed(
|
|
54
57
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
55
58
|
|
56
59
|
Returns:
|
57
|
-
Response[
|
60
|
+
Response[Integration]
|
58
61
|
"""
|
59
62
|
|
60
63
|
kwargs = _get_kwargs(
|
@@ -68,11 +71,37 @@ def sync_detailed(
|
|
68
71
|
return _build_response(client=client, response=response)
|
69
72
|
|
70
73
|
|
74
|
+
def sync(
|
75
|
+
integration_name: str,
|
76
|
+
*,
|
77
|
+
client: Union[Client],
|
78
|
+
) -> Optional[Integration]:
|
79
|
+
"""List integrations connections
|
80
|
+
|
81
|
+
Returns integration information by name.
|
82
|
+
|
83
|
+
Args:
|
84
|
+
integration_name (str):
|
85
|
+
|
86
|
+
Raises:
|
87
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
88
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
89
|
+
|
90
|
+
Returns:
|
91
|
+
Integration
|
92
|
+
"""
|
93
|
+
|
94
|
+
return sync_detailed(
|
95
|
+
integration_name=integration_name,
|
96
|
+
client=client,
|
97
|
+
).parsed
|
98
|
+
|
99
|
+
|
71
100
|
async def asyncio_detailed(
|
72
101
|
integration_name: str,
|
73
102
|
*,
|
74
103
|
client: Union[Client],
|
75
|
-
) -> Response[
|
104
|
+
) -> Response[Integration]:
|
76
105
|
"""List integrations connections
|
77
106
|
|
78
107
|
Returns integration information by name.
|
@@ -85,7 +114,7 @@ async def asyncio_detailed(
|
|
85
114
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
86
115
|
|
87
116
|
Returns:
|
88
|
-
Response[
|
117
|
+
Response[Integration]
|
89
118
|
"""
|
90
119
|
|
91
120
|
kwargs = _get_kwargs(
|
@@ -95,3 +124,31 @@ async def asyncio_detailed(
|
|
95
124
|
response = await client.get_async_httpx_client().request(**kwargs)
|
96
125
|
|
97
126
|
return _build_response(client=client, response=response)
|
127
|
+
|
128
|
+
|
129
|
+
async def asyncio(
|
130
|
+
integration_name: str,
|
131
|
+
*,
|
132
|
+
client: Union[Client],
|
133
|
+
) -> Optional[Integration]:
|
134
|
+
"""List integrations connections
|
135
|
+
|
136
|
+
Returns integration information by name.
|
137
|
+
|
138
|
+
Args:
|
139
|
+
integration_name (str):
|
140
|
+
|
141
|
+
Raises:
|
142
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
143
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
144
|
+
|
145
|
+
Returns:
|
146
|
+
Integration
|
147
|
+
"""
|
148
|
+
|
149
|
+
return (
|
150
|
+
await asyncio_detailed(
|
151
|
+
integration_name=integration_name,
|
152
|
+
client=client,
|
153
|
+
)
|
154
|
+
).parsed
|
@@ -0,0 +1,165 @@
|
|
1
|
+
from http import HTTPStatus
|
2
|
+
from typing import Any, Optional, Union, cast
|
3
|
+
|
4
|
+
import httpx
|
5
|
+
|
6
|
+
from ... import errors
|
7
|
+
from ...client import Client
|
8
|
+
from ...models.check_workspace_availability_body import CheckWorkspaceAvailabilityBody
|
9
|
+
from ...types import Response
|
10
|
+
|
11
|
+
|
12
|
+
def _get_kwargs(
|
13
|
+
*,
|
14
|
+
body: CheckWorkspaceAvailabilityBody,
|
15
|
+
) -> dict[str, Any]:
|
16
|
+
headers: dict[str, Any] = {}
|
17
|
+
|
18
|
+
_kwargs: dict[str, Any] = {
|
19
|
+
"method": "post",
|
20
|
+
"url": "/workspaces/availability",
|
21
|
+
}
|
22
|
+
|
23
|
+
if type(body) == dict:
|
24
|
+
_body = body
|
25
|
+
else:
|
26
|
+
_body = body.to_dict()
|
27
|
+
|
28
|
+
_kwargs["json"] = _body
|
29
|
+
headers["Content-Type"] = "application/json"
|
30
|
+
|
31
|
+
_kwargs["headers"] = headers
|
32
|
+
return _kwargs
|
33
|
+
|
34
|
+
|
35
|
+
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[bool]:
|
36
|
+
if response.status_code == 200:
|
37
|
+
response_200 = cast(bool, response.json())
|
38
|
+
return response_200
|
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(*, client: Client, response: httpx.Response) -> Response[bool]:
|
46
|
+
return Response(
|
47
|
+
status_code=HTTPStatus(response.status_code),
|
48
|
+
content=response.content,
|
49
|
+
headers=response.headers,
|
50
|
+
parsed=_parse_response(client=client, response=response),
|
51
|
+
)
|
52
|
+
|
53
|
+
|
54
|
+
def sync_detailed(
|
55
|
+
*,
|
56
|
+
client: Union[Client],
|
57
|
+
body: CheckWorkspaceAvailabilityBody,
|
58
|
+
) -> Response[bool]:
|
59
|
+
"""Check workspace availability
|
60
|
+
|
61
|
+
Check if a workspace is available.
|
62
|
+
|
63
|
+
Args:
|
64
|
+
body (CheckWorkspaceAvailabilityBody):
|
65
|
+
|
66
|
+
Raises:
|
67
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
68
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
69
|
+
|
70
|
+
Returns:
|
71
|
+
Response[bool]
|
72
|
+
"""
|
73
|
+
|
74
|
+
kwargs = _get_kwargs(
|
75
|
+
body=body,
|
76
|
+
)
|
77
|
+
|
78
|
+
response = client.get_httpx_client().request(
|
79
|
+
**kwargs,
|
80
|
+
)
|
81
|
+
|
82
|
+
return _build_response(client=client, response=response)
|
83
|
+
|
84
|
+
|
85
|
+
def sync(
|
86
|
+
*,
|
87
|
+
client: Union[Client],
|
88
|
+
body: CheckWorkspaceAvailabilityBody,
|
89
|
+
) -> Optional[bool]:
|
90
|
+
"""Check workspace availability
|
91
|
+
|
92
|
+
Check if a workspace is available.
|
93
|
+
|
94
|
+
Args:
|
95
|
+
body (CheckWorkspaceAvailabilityBody):
|
96
|
+
|
97
|
+
Raises:
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
100
|
+
|
101
|
+
Returns:
|
102
|
+
bool
|
103
|
+
"""
|
104
|
+
|
105
|
+
return sync_detailed(
|
106
|
+
client=client,
|
107
|
+
body=body,
|
108
|
+
).parsed
|
109
|
+
|
110
|
+
|
111
|
+
async def asyncio_detailed(
|
112
|
+
*,
|
113
|
+
client: Union[Client],
|
114
|
+
body: CheckWorkspaceAvailabilityBody,
|
115
|
+
) -> Response[bool]:
|
116
|
+
"""Check workspace availability
|
117
|
+
|
118
|
+
Check if a workspace is available.
|
119
|
+
|
120
|
+
Args:
|
121
|
+
body (CheckWorkspaceAvailabilityBody):
|
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[bool]
|
129
|
+
"""
|
130
|
+
|
131
|
+
kwargs = _get_kwargs(
|
132
|
+
body=body,
|
133
|
+
)
|
134
|
+
|
135
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
136
|
+
|
137
|
+
return _build_response(client=client, response=response)
|
138
|
+
|
139
|
+
|
140
|
+
async def asyncio(
|
141
|
+
*,
|
142
|
+
client: Union[Client],
|
143
|
+
body: CheckWorkspaceAvailabilityBody,
|
144
|
+
) -> Optional[bool]:
|
145
|
+
"""Check workspace availability
|
146
|
+
|
147
|
+
Check if a workspace is available.
|
148
|
+
|
149
|
+
Args:
|
150
|
+
body (CheckWorkspaceAvailabilityBody):
|
151
|
+
|
152
|
+
Raises:
|
153
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
154
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
155
|
+
|
156
|
+
Returns:
|
157
|
+
bool
|
158
|
+
"""
|
159
|
+
|
160
|
+
return (
|
161
|
+
await asyncio_detailed(
|
162
|
+
client=client,
|
163
|
+
body=body,
|
164
|
+
)
|
165
|
+
).parsed
|
blaxel/client/models/__init__.py
CHANGED
@@ -4,6 +4,7 @@ from .acl import ACL
|
|
4
4
|
from .agent import Agent
|
5
5
|
from .agent_spec import AgentSpec
|
6
6
|
from .api_key import ApiKey
|
7
|
+
from .check_workspace_availability_body import CheckWorkspaceAvailabilityBody
|
7
8
|
from .configuration import Configuration
|
8
9
|
from .continent import Continent
|
9
10
|
from .core_event import CoreEvent
|
@@ -13,6 +14,7 @@ from .country import Country
|
|
13
14
|
from .create_api_key_for_service_account_body import CreateApiKeyForServiceAccountBody
|
14
15
|
from .create_workspace_service_account_body import CreateWorkspaceServiceAccountBody
|
15
16
|
from .create_workspace_service_account_response_200 import CreateWorkspaceServiceAccountResponse200
|
17
|
+
from .delete_sandbox_preview_token_response_200 import DeleteSandboxPreviewTokenResponse200
|
16
18
|
from .delete_workspace_service_account_response_200 import DeleteWorkspaceServiceAccountResponse200
|
17
19
|
from .entrypoint import Entrypoint
|
18
20
|
from .entrypoint_env import EntrypointEnv
|
@@ -33,11 +35,19 @@ from .get_workspace_service_accounts_response_200_item import (
|
|
33
35
|
)
|
34
36
|
from .histogram_bucket import HistogramBucket
|
35
37
|
from .histogram_stats import HistogramStats
|
38
|
+
from .integration import Integration
|
39
|
+
from .integration_additional_infos import IntegrationAdditionalInfos
|
36
40
|
from .integration_connection import IntegrationConnection
|
37
41
|
from .integration_connection_spec import IntegrationConnectionSpec
|
38
42
|
from .integration_connection_spec_config import IntegrationConnectionSpecConfig
|
39
43
|
from .integration_connection_spec_secret import IntegrationConnectionSpecSecret
|
44
|
+
from .integration_endpoint import IntegrationEndpoint
|
45
|
+
from .integration_endpoint_token import IntegrationEndpointToken
|
46
|
+
from .integration_endpoints import IntegrationEndpoints
|
47
|
+
from .integration_headers import IntegrationHeaders
|
40
48
|
from .integration_model import IntegrationModel
|
49
|
+
from .integration_organization import IntegrationOrganization
|
50
|
+
from .integration_query_params import IntegrationQueryParams
|
41
51
|
from .integration_repository import IntegrationRepository
|
42
52
|
from .invite_workspace_user_body import InviteWorkspaceUserBody
|
43
53
|
from .knowledgebase import Knowledgebase
|
@@ -74,6 +84,12 @@ from .policy_location import PolicyLocation
|
|
74
84
|
from .policy_max_tokens import PolicyMaxTokens
|
75
85
|
from .policy_spec import PolicySpec
|
76
86
|
from .port import Port
|
87
|
+
from .preview import Preview
|
88
|
+
from .preview_metadata import PreviewMetadata
|
89
|
+
from .preview_spec import PreviewSpec
|
90
|
+
from .preview_token import PreviewToken
|
91
|
+
from .preview_token_metadata import PreviewTokenMetadata
|
92
|
+
from .preview_token_spec import PreviewTokenSpec
|
77
93
|
from .private_cluster import PrivateCluster
|
78
94
|
from .private_location import PrivateLocation
|
79
95
|
from .repository import Repository
|
@@ -106,7 +122,6 @@ from .runtime_startup_probe import RuntimeStartupProbe
|
|
106
122
|
from .sandbox import Sandbox
|
107
123
|
from .sandbox_definition import SandboxDefinition
|
108
124
|
from .sandbox_spec import SandboxSpec
|
109
|
-
from .sandboxes import Sandboxes
|
110
125
|
from .serverless_config import ServerlessConfig
|
111
126
|
from .serverless_config_configuration import ServerlessConfigConfiguration
|
112
127
|
from .spec_configuration import SpecConfiguration
|
@@ -140,6 +155,7 @@ __all__ = (
|
|
140
155
|
"Agent",
|
141
156
|
"AgentSpec",
|
142
157
|
"ApiKey",
|
158
|
+
"CheckWorkspaceAvailabilityBody",
|
143
159
|
"Configuration",
|
144
160
|
"Continent",
|
145
161
|
"CoreEvent",
|
@@ -149,6 +165,7 @@ __all__ = (
|
|
149
165
|
"CreateApiKeyForServiceAccountBody",
|
150
166
|
"CreateWorkspaceServiceAccountBody",
|
151
167
|
"CreateWorkspaceServiceAccountResponse200",
|
168
|
+
"DeleteSandboxPreviewTokenResponse200",
|
152
169
|
"DeleteWorkspaceServiceAccountResponse200",
|
153
170
|
"Entrypoint",
|
154
171
|
"EntrypointEnv",
|
@@ -167,11 +184,19 @@ __all__ = (
|
|
167
184
|
"GetWorkspaceServiceAccountsResponse200Item",
|
168
185
|
"HistogramBucket",
|
169
186
|
"HistogramStats",
|
187
|
+
"Integration",
|
188
|
+
"IntegrationAdditionalInfos",
|
170
189
|
"IntegrationConnection",
|
171
190
|
"IntegrationConnectionSpec",
|
172
191
|
"IntegrationConnectionSpecConfig",
|
173
192
|
"IntegrationConnectionSpecSecret",
|
193
|
+
"IntegrationEndpoint",
|
194
|
+
"IntegrationEndpoints",
|
195
|
+
"IntegrationEndpointToken",
|
196
|
+
"IntegrationHeaders",
|
174
197
|
"IntegrationModel",
|
198
|
+
"IntegrationOrganization",
|
199
|
+
"IntegrationQueryParams",
|
175
200
|
"IntegrationRepository",
|
176
201
|
"InviteWorkspaceUserBody",
|
177
202
|
"Knowledgebase",
|
@@ -208,6 +233,12 @@ __all__ = (
|
|
208
233
|
"PolicyMaxTokens",
|
209
234
|
"PolicySpec",
|
210
235
|
"Port",
|
236
|
+
"Preview",
|
237
|
+
"PreviewMetadata",
|
238
|
+
"PreviewSpec",
|
239
|
+
"PreviewToken",
|
240
|
+
"PreviewTokenMetadata",
|
241
|
+
"PreviewTokenSpec",
|
211
242
|
"PrivateCluster",
|
212
243
|
"PrivateLocation",
|
213
244
|
"Repository",
|
@@ -233,7 +264,6 @@ __all__ = (
|
|
233
264
|
"RuntimeStartupProbe",
|
234
265
|
"Sandbox",
|
235
266
|
"SandboxDefinition",
|
236
|
-
"Sandboxes",
|
237
267
|
"SandboxSpec",
|
238
268
|
"ServerlessConfig",
|
239
269
|
"ServerlessConfigConfiguration",
|
@@ -0,0 +1,60 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="CheckWorkspaceAvailabilityBody")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class CheckWorkspaceAvailabilityBody:
|
11
|
+
"""
|
12
|
+
Attributes:
|
13
|
+
name (str):
|
14
|
+
"""
|
15
|
+
|
16
|
+
name: str
|
17
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
18
|
+
|
19
|
+
def to_dict(self) -> dict[str, Any]:
|
20
|
+
name = self.name
|
21
|
+
|
22
|
+
field_dict: dict[str, Any] = {}
|
23
|
+
field_dict.update(self.additional_properties)
|
24
|
+
field_dict.update(
|
25
|
+
{
|
26
|
+
"name": name,
|
27
|
+
}
|
28
|
+
)
|
29
|
+
|
30
|
+
return field_dict
|
31
|
+
|
32
|
+
@classmethod
|
33
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
34
|
+
if not src_dict:
|
35
|
+
return None
|
36
|
+
d = src_dict.copy()
|
37
|
+
name = d.pop("name")
|
38
|
+
|
39
|
+
check_workspace_availability_body = cls(
|
40
|
+
name=name,
|
41
|
+
)
|
42
|
+
|
43
|
+
check_workspace_availability_body.additional_properties = d
|
44
|
+
return check_workspace_availability_body
|
45
|
+
|
46
|
+
@property
|
47
|
+
def additional_keys(self) -> list[str]:
|
48
|
+
return list(self.additional_properties.keys())
|
49
|
+
|
50
|
+
def __getitem__(self, key: str) -> Any:
|
51
|
+
return self.additional_properties[key]
|
52
|
+
|
53
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
54
|
+
self.additional_properties[key] = value
|
55
|
+
|
56
|
+
def __delitem__(self, key: str) -> None:
|
57
|
+
del self.additional_properties[key]
|
58
|
+
|
59
|
+
def __contains__(self, key: str) -> bool:
|
60
|
+
return key in self.additional_properties
|
@@ -0,0 +1,60 @@
|
|
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="DeleteSandboxPreviewTokenResponse200")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class DeleteSandboxPreviewTokenResponse200:
|
13
|
+
"""
|
14
|
+
Attributes:
|
15
|
+
message (Union[Unset, str]): Success message
|
16
|
+
"""
|
17
|
+
|
18
|
+
message: Union[Unset, str] = UNSET
|
19
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
20
|
+
|
21
|
+
def to_dict(self) -> dict[str, Any]:
|
22
|
+
message = self.message
|
23
|
+
|
24
|
+
field_dict: dict[str, Any] = {}
|
25
|
+
field_dict.update(self.additional_properties)
|
26
|
+
field_dict.update({})
|
27
|
+
if message is not UNSET:
|
28
|
+
field_dict["message"] = message
|
29
|
+
|
30
|
+
return field_dict
|
31
|
+
|
32
|
+
@classmethod
|
33
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
34
|
+
if not src_dict:
|
35
|
+
return None
|
36
|
+
d = src_dict.copy()
|
37
|
+
message = d.pop("message", UNSET)
|
38
|
+
|
39
|
+
delete_sandbox_preview_token_response_200 = cls(
|
40
|
+
message=message,
|
41
|
+
)
|
42
|
+
|
43
|
+
delete_sandbox_preview_token_response_200.additional_properties = d
|
44
|
+
return delete_sandbox_preview_token_response_200
|
45
|
+
|
46
|
+
@property
|
47
|
+
def additional_keys(self) -> list[str]:
|
48
|
+
return list(self.additional_properties.keys())
|
49
|
+
|
50
|
+
def __getitem__(self, key: str) -> Any:
|
51
|
+
return self.additional_properties[key]
|
52
|
+
|
53
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
54
|
+
self.additional_properties[key] = value
|
55
|
+
|
56
|
+
def __delitem__(self, key: str) -> None:
|
57
|
+
del self.additional_properties[key]
|
58
|
+
|
59
|
+
def __contains__(self, key: str) -> bool:
|
60
|
+
return key in self.additional_properties
|