blaxel 0.1.10rc39__py3-none-any.whl → 0.1.10rc41__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.
Files changed (41) hide show
  1. blaxel/client/api/compute/create_sandbox_preview.py +179 -0
  2. blaxel/client/api/compute/create_sandbox_preview_token.py +192 -0
  3. blaxel/client/api/compute/delete_sandbox_preview.py +167 -0
  4. blaxel/client/api/compute/delete_sandbox_preview_token.py +180 -0
  5. blaxel/client/api/compute/get_sandbox_preview.py +167 -0
  6. blaxel/client/api/compute/list_sandbox_preview_tokens.py +172 -0
  7. blaxel/client/api/compute/list_sandbox_previews.py +159 -0
  8. blaxel/client/api/compute/update_sandbox_preview.py +192 -0
  9. blaxel/client/api/integrations/get_integration.py +64 -7
  10. blaxel/client/api/workspaces/check_workspace_availability.py +165 -0
  11. blaxel/client/models/__init__.py +32 -2
  12. blaxel/client/models/check_workspace_availability_body.py +60 -0
  13. blaxel/client/models/delete_sandbox_preview_token_response_200.py +60 -0
  14. blaxel/client/models/integration.py +197 -0
  15. blaxel/client/models/integration_additional_infos.py +45 -0
  16. blaxel/client/models/integration_endpoint.py +143 -0
  17. blaxel/client/models/integration_endpoint_token.py +79 -0
  18. blaxel/client/models/integration_endpoints.py +61 -0
  19. blaxel/client/models/integration_headers.py +45 -0
  20. blaxel/client/models/integration_organization.py +88 -0
  21. blaxel/client/models/integration_query_params.py +45 -0
  22. blaxel/client/models/metrics.py +9 -0
  23. blaxel/client/models/preview.py +96 -0
  24. blaxel/client/models/preview_metadata.py +133 -0
  25. blaxel/client/models/preview_spec.py +79 -0
  26. blaxel/client/models/preview_token.py +96 -0
  27. blaxel/client/models/preview_token_metadata.py +97 -0
  28. blaxel/client/models/preview_token_spec.py +88 -0
  29. blaxel/sandbox/client/api/process/get_process_identifier_logs.py +22 -1
  30. blaxel/sandbox/client/api/process/get_process_identifier_logs_stream.py +190 -0
  31. blaxel/sandbox/client/models/__init__.py +6 -0
  32. blaxel/sandbox/client/models/directory.py +5 -3
  33. blaxel/sandbox/client/models/file.py +1 -1
  34. blaxel/sandbox/client/models/file_with_content.py +1 -1
  35. blaxel/sandbox/client/models/get_process_identifier_logs_stream_response_200.py +45 -0
  36. blaxel/sandbox/client/models/subdirectory.py +60 -0
  37. {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc41.dist-info}/METADATA +1 -1
  38. {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc41.dist-info}/RECORD +40 -13
  39. blaxel/client/models/sandboxes.py +0 -129
  40. {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc41.dist-info}/WHEEL +0 -0
  41. {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc41.dist-info}/licenses/LICENSE +0 -0
@@ -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[Any]:
23
+ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Integration]:
23
24
  if response.status_code == 200:
24
- return None
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[Any]:
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[Any]:
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[Any]
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[Any]:
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[Any]
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
@@ -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