blaxel 0.2.26rc119__py3-none-any.whl → 0.2.28__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 (118) hide show
  1. blaxel/__init__.py +2 -2
  2. blaxel/core/__init__.py +9 -1
  3. blaxel/core/client/api/{privateclusters/create_private_cluster.py → images/cleanup_images.py} +31 -25
  4. blaxel/core/client/models/__init__.py +2 -4
  5. blaxel/core/client/models/agent.py +1 -0
  6. blaxel/core/client/models/agent_spec.py +1 -24
  7. blaxel/core/client/models/billable_time_metric.py +1 -0
  8. blaxel/core/{sandbox/client/models/find_match.py → client/models/cleanup_images_response_200.py} +19 -19
  9. blaxel/core/client/models/configuration.py +1 -0
  10. blaxel/core/client/models/core_event.py +9 -0
  11. blaxel/core/client/models/core_spec.py +1 -24
  12. blaxel/core/client/models/core_spec_configurations.py +1 -0
  13. blaxel/core/client/models/create_job_execution_request.py +1 -0
  14. blaxel/core/client/models/create_job_execution_response.py +1 -0
  15. blaxel/core/client/models/custom_domain.py +1 -0
  16. blaxel/core/client/models/custom_domain_metadata.py +1 -0
  17. blaxel/core/client/models/custom_domain_spec.py +1 -0
  18. blaxel/core/client/models/delete_volume_template_version_response_200.py +1 -0
  19. blaxel/core/client/models/entrypoint.py +1 -0
  20. blaxel/core/client/models/form.py +1 -0
  21. blaxel/core/client/models/function.py +1 -0
  22. blaxel/core/client/models/function_spec.py +1 -24
  23. blaxel/core/client/models/image.py +1 -0
  24. blaxel/core/client/models/image_spec.py +1 -0
  25. blaxel/core/client/models/integration.py +1 -0
  26. blaxel/core/client/models/integration_connection.py +1 -0
  27. blaxel/core/client/models/integration_connection_spec.py +1 -0
  28. blaxel/core/client/models/integration_endpoint.py +1 -0
  29. blaxel/core/client/models/integration_endpoints.py +2 -0
  30. blaxel/core/client/models/job.py +1 -0
  31. blaxel/core/client/models/job_execution.py +1 -0
  32. blaxel/core/client/models/job_execution_spec.py +1 -0
  33. blaxel/core/client/models/job_execution_task.py +1 -0
  34. blaxel/core/client/models/job_metrics.py +1 -0
  35. blaxel/core/client/models/job_spec.py +1 -24
  36. blaxel/core/client/models/jobs_network_chart.py +1 -0
  37. blaxel/core/client/models/jobs_success_failed_chart.py +1 -0
  38. blaxel/core/client/models/latency_metric.py +1 -0
  39. blaxel/core/client/models/location_response.py +1 -0
  40. blaxel/core/client/models/mcp_definition.py +1 -0
  41. blaxel/core/client/models/metadata.py +1 -0
  42. blaxel/core/client/models/metrics.py +34 -0
  43. blaxel/core/client/models/model.py +1 -0
  44. blaxel/core/client/models/model_spec.py +1 -24
  45. blaxel/core/client/models/pending_invitation_accept.py +1 -0
  46. blaxel/core/client/models/pending_invitation_render.py +1 -0
  47. blaxel/core/client/models/policy.py +1 -0
  48. blaxel/core/client/models/policy_spec.py +1 -0
  49. blaxel/core/client/models/preview.py +1 -0
  50. blaxel/core/client/models/preview_spec.py +1 -0
  51. blaxel/core/client/models/preview_token.py +1 -0
  52. blaxel/core/client/models/public_ips.py +1 -0
  53. blaxel/core/client/models/request_duration_over_time_metrics.py +1 -0
  54. blaxel/core/client/models/request_total_by_origin_metric.py +1 -0
  55. blaxel/core/client/models/request_total_metric.py +1 -0
  56. blaxel/core/client/models/resource_metrics.py +1 -0
  57. blaxel/core/client/models/revision_configuration.py +9 -0
  58. blaxel/core/client/models/runtime.py +1 -0
  59. blaxel/core/client/models/sandbox.py +1 -0
  60. blaxel/core/client/models/sandbox_definition.py +1 -0
  61. blaxel/core/client/models/sandbox_lifecycle.py +1 -0
  62. blaxel/core/client/models/sandbox_spec.py +1 -24
  63. blaxel/core/client/models/serverless_config.py +1 -0
  64. blaxel/core/client/models/start_sandbox.py +1 -0
  65. blaxel/core/client/models/stop_sandbox.py +1 -0
  66. blaxel/core/client/models/store_agent.py +1 -0
  67. blaxel/core/client/models/store_configuration.py +1 -0
  68. blaxel/core/client/models/template.py +1 -0
  69. blaxel/core/client/models/time_to_first_token_over_time_metrics.py +1 -0
  70. blaxel/core/client/models/token_rate_metrics.py +1 -0
  71. blaxel/core/client/models/trigger.py +10 -0
  72. blaxel/core/client/models/trigger_configuration.py +28 -0
  73. blaxel/core/client/models/volume.py +1 -0
  74. blaxel/core/client/models/volume_template.py +1 -0
  75. blaxel/core/client/models/websocket_channel.py +9 -0
  76. blaxel/core/client/models/workspace.py +1 -0
  77. blaxel/core/client/response_interceptor.py +0 -1
  78. blaxel/core/common/__init__.py +10 -0
  79. blaxel/core/common/autoload.py +5 -4
  80. blaxel/core/common/settings.py +29 -0
  81. blaxel/core/common/webhook.py +187 -0
  82. blaxel/core/jobs/__init__.py +355 -8
  83. blaxel/core/sandbox/client/models/__init__.py +0 -16
  84. blaxel/core/sandbox/default/action.py +10 -27
  85. blaxel/core/sandbox/default/filesystem.py +52 -187
  86. blaxel/core/sandbox/default/interpreter.py +55 -62
  87. blaxel/core/sandbox/default/process.py +46 -66
  88. blaxel/core/sandbox/sync/filesystem.py +5 -2
  89. blaxel/googleadk/model.py +0 -1
  90. blaxel/livekit/model.py +0 -1
  91. {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/METADATA +2 -2
  92. {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/RECORD +94 -117
  93. blaxel/core/client/api/privateclusters/__init__.py +0 -0
  94. blaxel/core/client/api/privateclusters/delete_private_cluster.py +0 -152
  95. blaxel/core/client/api/privateclusters/get_private_cluster.py +0 -155
  96. blaxel/core/client/api/privateclusters/get_private_cluster_health.py +0 -97
  97. blaxel/core/client/api/privateclusters/list_private_clusters.py +0 -136
  98. blaxel/core/client/api/privateclusters/update_private_cluster.py +0 -152
  99. blaxel/core/client/api/privateclusters/update_private_cluster_health.py +0 -97
  100. blaxel/core/client/models/model_private_cluster.py +0 -79
  101. blaxel/core/client/models/private_cluster.py +0 -183
  102. blaxel/core/sandbox/client/api/filesystem/delete_filesystem_tree_path.py +0 -188
  103. blaxel/core/sandbox/client/api/filesystem/get_filesystem_content_search_path.py +0 -265
  104. blaxel/core/sandbox/client/api/filesystem/get_filesystem_find_path.py +0 -248
  105. blaxel/core/sandbox/client/api/filesystem/get_filesystem_search_path.py +0 -237
  106. blaxel/core/sandbox/client/api/filesystem/get_filesystem_tree_path.py +0 -197
  107. blaxel/core/sandbox/client/api/filesystem/put_filesystem_tree_path.py +0 -223
  108. blaxel/core/sandbox/client/api/websocket/__init__.py +0 -0
  109. blaxel/core/sandbox/client/api/websocket/get_ws.py +0 -81
  110. blaxel/core/sandbox/client/models/content_search_match.py +0 -98
  111. blaxel/core/sandbox/client/models/content_search_response.py +0 -97
  112. blaxel/core/sandbox/client/models/find_response.py +0 -88
  113. blaxel/core/sandbox/client/models/fuzzy_search_match.py +0 -78
  114. blaxel/core/sandbox/client/models/fuzzy_search_response.py +0 -88
  115. blaxel/core/sandbox/client/models/tree_request.py +0 -76
  116. blaxel/core/sandbox/client/models/tree_request_files.py +0 -49
  117. {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/WHEEL +0 -0
  118. {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/licenses/LICENSE +0 -0
@@ -1,155 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Union, cast
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...models.private_cluster import PrivateCluster
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- private_cluster_name: str,
14
- ) -> dict[str, Any]:
15
- _kwargs: dict[str, Any] = {
16
- "method": "get",
17
- "url": f"/privateclusters/{private_cluster_name}",
18
- }
19
-
20
- return _kwargs
21
-
22
-
23
- def _parse_response(*, client: Client, response: httpx.Response) -> Union[Any, PrivateCluster] | None:
24
- if response.status_code == 200:
25
- response_200 = PrivateCluster.from_dict(response.json())
26
-
27
- return response_200
28
- if response.status_code == 401:
29
- response_401 = cast(Any, None)
30
- return response_401
31
- if response.status_code == 403:
32
- response_403 = cast(Any, None)
33
- return response_403
34
- if response.status_code == 404:
35
- response_404 = cast(Any, None)
36
- return response_404
37
- if client.raise_on_unexpected_status:
38
- raise errors.UnexpectedStatus(response.status_code, response.content)
39
- else:
40
- return None
41
-
42
-
43
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, PrivateCluster]]:
44
- return Response(
45
- status_code=HTTPStatus(response.status_code),
46
- content=response.content,
47
- headers=response.headers,
48
- parsed=_parse_response(client=client, response=response),
49
- )
50
-
51
-
52
- def sync_detailed(
53
- private_cluster_name: str,
54
- *,
55
- client: Union[Client],
56
- ) -> Response[Union[Any, PrivateCluster]]:
57
- """Get private cluster by name
58
-
59
- Args:
60
- private_cluster_name (str):
61
-
62
- Raises:
63
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
- httpx.TimeoutException: If the request takes longer than Client.timeout.
65
-
66
- Returns:
67
- Response[Union[Any, PrivateCluster]]
68
- """
69
-
70
- kwargs = _get_kwargs(
71
- private_cluster_name=private_cluster_name,
72
- )
73
-
74
- response = client.get_httpx_client().request(
75
- **kwargs,
76
- )
77
-
78
- return _build_response(client=client, response=response)
79
-
80
-
81
- def sync(
82
- private_cluster_name: str,
83
- *,
84
- client: Union[Client],
85
- ) -> Union[Any, PrivateCluster] | None:
86
- """Get private cluster by name
87
-
88
- Args:
89
- private_cluster_name (str):
90
-
91
- Raises:
92
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93
- httpx.TimeoutException: If the request takes longer than Client.timeout.
94
-
95
- Returns:
96
- Union[Any, PrivateCluster]
97
- """
98
-
99
- return sync_detailed(
100
- private_cluster_name=private_cluster_name,
101
- client=client,
102
- ).parsed
103
-
104
-
105
- async def asyncio_detailed(
106
- private_cluster_name: str,
107
- *,
108
- client: Union[Client],
109
- ) -> Response[Union[Any, PrivateCluster]]:
110
- """Get private cluster by name
111
-
112
- Args:
113
- private_cluster_name (str):
114
-
115
- Raises:
116
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
117
- httpx.TimeoutException: If the request takes longer than Client.timeout.
118
-
119
- Returns:
120
- Response[Union[Any, PrivateCluster]]
121
- """
122
-
123
- kwargs = _get_kwargs(
124
- private_cluster_name=private_cluster_name,
125
- )
126
-
127
- response = await client.get_async_httpx_client().request(**kwargs)
128
-
129
- return _build_response(client=client, response=response)
130
-
131
-
132
- async def asyncio(
133
- private_cluster_name: str,
134
- *,
135
- client: Union[Client],
136
- ) -> Union[Any, PrivateCluster] | None:
137
- """Get private cluster by name
138
-
139
- Args:
140
- private_cluster_name (str):
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
- Union[Any, PrivateCluster]
148
- """
149
-
150
- return (
151
- await asyncio_detailed(
152
- private_cluster_name=private_cluster_name,
153
- client=client,
154
- )
155
- ).parsed
@@ -1,97 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...types import Response
9
-
10
-
11
- def _get_kwargs(
12
- private_cluster_name: str,
13
- ) -> dict[str, Any]:
14
- _kwargs: dict[str, Any] = {
15
- "method": "get",
16
- "url": f"/privateclusters/{private_cluster_name}/health",
17
- }
18
-
19
- return _kwargs
20
-
21
-
22
- def _parse_response(*, client: Client, response: httpx.Response) -> Any | None:
23
- if response.status_code == 200:
24
- return None
25
- if response.status_code == 401:
26
- return None
27
- if response.status_code == 403:
28
- return None
29
- if client.raise_on_unexpected_status:
30
- raise errors.UnexpectedStatus(response.status_code, response.content)
31
- else:
32
- return None
33
-
34
-
35
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
36
- return Response(
37
- status_code=HTTPStatus(response.status_code),
38
- content=response.content,
39
- headers=response.headers,
40
- parsed=_parse_response(client=client, response=response),
41
- )
42
-
43
-
44
- def sync_detailed(
45
- private_cluster_name: str,
46
- *,
47
- client: Union[Client],
48
- ) -> Response[Any]:
49
- """Get private cluster health
50
-
51
- Args:
52
- private_cluster_name (str):
53
-
54
- Raises:
55
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56
- httpx.TimeoutException: If the request takes longer than Client.timeout.
57
-
58
- Returns:
59
- Response[Any]
60
- """
61
-
62
- kwargs = _get_kwargs(
63
- private_cluster_name=private_cluster_name,
64
- )
65
-
66
- response = client.get_httpx_client().request(
67
- **kwargs,
68
- )
69
-
70
- return _build_response(client=client, response=response)
71
-
72
-
73
- async def asyncio_detailed(
74
- private_cluster_name: str,
75
- *,
76
- client: Union[Client],
77
- ) -> Response[Any]:
78
- """Get private cluster health
79
-
80
- Args:
81
- private_cluster_name (str):
82
-
83
- Raises:
84
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
- httpx.TimeoutException: If the request takes longer than Client.timeout.
86
-
87
- Returns:
88
- Response[Any]
89
- """
90
-
91
- kwargs = _get_kwargs(
92
- private_cluster_name=private_cluster_name,
93
- )
94
-
95
- response = await client.get_async_httpx_client().request(**kwargs)
96
-
97
- return _build_response(client=client, response=response)
@@ -1,136 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Union, cast
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...models.private_cluster import PrivateCluster
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs() -> dict[str, Any]:
13
- _kwargs: dict[str, Any] = {
14
- "method": "get",
15
- "url": "/privateclusters",
16
- }
17
-
18
- return _kwargs
19
-
20
-
21
- def _parse_response(*, client: Client, response: httpx.Response) -> Union[Any, list["PrivateCluster"]] | None:
22
- if response.status_code == 200:
23
- response_200 = []
24
- _response_200 = response.json()
25
- for response_200_item_data in _response_200:
26
- response_200_item = PrivateCluster.from_dict(response_200_item_data)
27
-
28
- response_200.append(response_200_item)
29
-
30
- return response_200
31
- if response.status_code == 401:
32
- response_401 = cast(Any, None)
33
- return response_401
34
- if response.status_code == 403:
35
- response_403 = cast(Any, None)
36
- return response_403
37
- if response.status_code == 404:
38
- response_404 = cast(Any, None)
39
- return response_404
40
- if client.raise_on_unexpected_status:
41
- raise errors.UnexpectedStatus(response.status_code, response.content)
42
- else:
43
- return None
44
-
45
-
46
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, list["PrivateCluster"]]]:
47
- return Response(
48
- status_code=HTTPStatus(response.status_code),
49
- content=response.content,
50
- headers=response.headers,
51
- parsed=_parse_response(client=client, response=response),
52
- )
53
-
54
-
55
- def sync_detailed(
56
- *,
57
- client: Union[Client],
58
- ) -> Response[Union[Any, list["PrivateCluster"]]]:
59
- """List all private clusters
60
-
61
- Raises:
62
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
63
- httpx.TimeoutException: If the request takes longer than Client.timeout.
64
-
65
- Returns:
66
- Response[Union[Any, list['PrivateCluster']]]
67
- """
68
-
69
- kwargs = _get_kwargs()
70
-
71
- response = client.get_httpx_client().request(
72
- **kwargs,
73
- )
74
-
75
- return _build_response(client=client, response=response)
76
-
77
-
78
- def sync(
79
- *,
80
- client: Union[Client],
81
- ) -> Union[Any, list["PrivateCluster"]] | None:
82
- """List all private clusters
83
-
84
- Raises:
85
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
86
- httpx.TimeoutException: If the request takes longer than Client.timeout.
87
-
88
- Returns:
89
- Union[Any, list['PrivateCluster']]
90
- """
91
-
92
- return sync_detailed(
93
- client=client,
94
- ).parsed
95
-
96
-
97
- async def asyncio_detailed(
98
- *,
99
- client: Union[Client],
100
- ) -> Response[Union[Any, list["PrivateCluster"]]]:
101
- """List all private clusters
102
-
103
- Raises:
104
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
105
- httpx.TimeoutException: If the request takes longer than Client.timeout.
106
-
107
- Returns:
108
- Response[Union[Any, list['PrivateCluster']]]
109
- """
110
-
111
- kwargs = _get_kwargs()
112
-
113
- response = await client.get_async_httpx_client().request(**kwargs)
114
-
115
- return _build_response(client=client, response=response)
116
-
117
-
118
- async def asyncio(
119
- *,
120
- client: Union[Client],
121
- ) -> Union[Any, list["PrivateCluster"]] | None:
122
- """List all private clusters
123
-
124
- Raises:
125
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
126
- httpx.TimeoutException: If the request takes longer than Client.timeout.
127
-
128
- Returns:
129
- Union[Any, list['PrivateCluster']]
130
- """
131
-
132
- return (
133
- await asyncio_detailed(
134
- client=client,
135
- )
136
- ).parsed
@@ -1,152 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Union, cast
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...models.private_cluster import PrivateCluster
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- private_cluster_name: str,
14
- ) -> dict[str, Any]:
15
- _kwargs: dict[str, Any] = {
16
- "method": "put",
17
- "url": f"/privateclusters/{private_cluster_name}",
18
- }
19
-
20
- return _kwargs
21
-
22
-
23
- def _parse_response(*, client: Client, response: httpx.Response) -> Union[Any, PrivateCluster] | None:
24
- if response.status_code == 200:
25
- response_200 = PrivateCluster.from_dict(response.json())
26
-
27
- return response_200
28
- if response.status_code == 401:
29
- response_401 = cast(Any, None)
30
- return response_401
31
- if response.status_code == 403:
32
- response_403 = cast(Any, None)
33
- return response_403
34
- if client.raise_on_unexpected_status:
35
- raise errors.UnexpectedStatus(response.status_code, response.content)
36
- else:
37
- return None
38
-
39
-
40
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, PrivateCluster]]:
41
- return Response(
42
- status_code=HTTPStatus(response.status_code),
43
- content=response.content,
44
- headers=response.headers,
45
- parsed=_parse_response(client=client, response=response),
46
- )
47
-
48
-
49
- def sync_detailed(
50
- private_cluster_name: str,
51
- *,
52
- client: Union[Client],
53
- ) -> Response[Union[Any, PrivateCluster]]:
54
- """Update private cluster
55
-
56
- Args:
57
- private_cluster_name (str):
58
-
59
- Raises:
60
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
61
- httpx.TimeoutException: If the request takes longer than Client.timeout.
62
-
63
- Returns:
64
- Response[Union[Any, PrivateCluster]]
65
- """
66
-
67
- kwargs = _get_kwargs(
68
- private_cluster_name=private_cluster_name,
69
- )
70
-
71
- response = client.get_httpx_client().request(
72
- **kwargs,
73
- )
74
-
75
- return _build_response(client=client, response=response)
76
-
77
-
78
- def sync(
79
- private_cluster_name: str,
80
- *,
81
- client: Union[Client],
82
- ) -> Union[Any, PrivateCluster] | None:
83
- """Update private cluster
84
-
85
- Args:
86
- private_cluster_name (str):
87
-
88
- Raises:
89
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
90
- httpx.TimeoutException: If the request takes longer than Client.timeout.
91
-
92
- Returns:
93
- Union[Any, PrivateCluster]
94
- """
95
-
96
- return sync_detailed(
97
- private_cluster_name=private_cluster_name,
98
- client=client,
99
- ).parsed
100
-
101
-
102
- async def asyncio_detailed(
103
- private_cluster_name: str,
104
- *,
105
- client: Union[Client],
106
- ) -> Response[Union[Any, PrivateCluster]]:
107
- """Update private cluster
108
-
109
- Args:
110
- private_cluster_name (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
- Response[Union[Any, PrivateCluster]]
118
- """
119
-
120
- kwargs = _get_kwargs(
121
- private_cluster_name=private_cluster_name,
122
- )
123
-
124
- response = await client.get_async_httpx_client().request(**kwargs)
125
-
126
- return _build_response(client=client, response=response)
127
-
128
-
129
- async def asyncio(
130
- private_cluster_name: str,
131
- *,
132
- client: Union[Client],
133
- ) -> Union[Any, PrivateCluster] | None:
134
- """Update private cluster
135
-
136
- Args:
137
- private_cluster_name (str):
138
-
139
- Raises:
140
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
141
- httpx.TimeoutException: If the request takes longer than Client.timeout.
142
-
143
- Returns:
144
- Union[Any, PrivateCluster]
145
- """
146
-
147
- return (
148
- await asyncio_detailed(
149
- private_cluster_name=private_cluster_name,
150
- client=client,
151
- )
152
- ).parsed
@@ -1,97 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import Client
8
- from ...types import Response
9
-
10
-
11
- def _get_kwargs(
12
- private_cluster_name: str,
13
- ) -> dict[str, Any]:
14
- _kwargs: dict[str, Any] = {
15
- "method": "post",
16
- "url": f"/privateclusters/{private_cluster_name}/health",
17
- }
18
-
19
- return _kwargs
20
-
21
-
22
- def _parse_response(*, client: Client, response: httpx.Response) -> Any | None:
23
- if response.status_code == 200:
24
- return None
25
- if response.status_code == 401:
26
- return None
27
- if response.status_code == 403:
28
- return None
29
- if client.raise_on_unexpected_status:
30
- raise errors.UnexpectedStatus(response.status_code, response.content)
31
- else:
32
- return None
33
-
34
-
35
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]:
36
- return Response(
37
- status_code=HTTPStatus(response.status_code),
38
- content=response.content,
39
- headers=response.headers,
40
- parsed=_parse_response(client=client, response=response),
41
- )
42
-
43
-
44
- def sync_detailed(
45
- private_cluster_name: str,
46
- *,
47
- client: Union[Client],
48
- ) -> Response[Any]:
49
- """Update private cluster health
50
-
51
- Args:
52
- private_cluster_name (str):
53
-
54
- Raises:
55
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56
- httpx.TimeoutException: If the request takes longer than Client.timeout.
57
-
58
- Returns:
59
- Response[Any]
60
- """
61
-
62
- kwargs = _get_kwargs(
63
- private_cluster_name=private_cluster_name,
64
- )
65
-
66
- response = client.get_httpx_client().request(
67
- **kwargs,
68
- )
69
-
70
- return _build_response(client=client, response=response)
71
-
72
-
73
- async def asyncio_detailed(
74
- private_cluster_name: str,
75
- *,
76
- client: Union[Client],
77
- ) -> Response[Any]:
78
- """Update private cluster health
79
-
80
- Args:
81
- private_cluster_name (str):
82
-
83
- Raises:
84
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
- httpx.TimeoutException: If the request takes longer than Client.timeout.
86
-
87
- Returns:
88
- Response[Any]
89
- """
90
-
91
- kwargs = _get_kwargs(
92
- private_cluster_name=private_cluster_name,
93
- )
94
-
95
- response = await client.get_async_httpx_client().request(**kwargs)
96
-
97
- return _build_response(client=client, response=response)
@@ -1,79 +0,0 @@
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="ModelPrivateCluster")
9
-
10
-
11
- @_attrs_define
12
- class ModelPrivateCluster:
13
- """Private cluster where the model deployment is deployed
14
-
15
- Attributes:
16
- base_url (Union[Unset, str]): The base url of the model in the private cluster
17
- enabled (Union[Unset, bool]): If true, the private cluster is available
18
- name (Union[Unset, str]): The name of the private cluster
19
- """
20
-
21
- base_url: Union[Unset, str] = UNSET
22
- enabled: Union[Unset, bool] = UNSET
23
- name: Union[Unset, str] = UNSET
24
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
-
26
- def to_dict(self) -> dict[str, Any]:
27
- base_url = self.base_url
28
-
29
- enabled = self.enabled
30
-
31
- name = self.name
32
-
33
- field_dict: dict[str, Any] = {}
34
- field_dict.update(self.additional_properties)
35
- field_dict.update({})
36
- if base_url is not UNSET:
37
- field_dict["baseUrl"] = base_url
38
- if enabled is not UNSET:
39
- field_dict["enabled"] = enabled
40
- if name is not UNSET:
41
- field_dict["name"] = name
42
-
43
- return field_dict
44
-
45
- @classmethod
46
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
47
- if not src_dict:
48
- return None
49
- d = src_dict.copy()
50
- base_url = d.pop("baseUrl", UNSET)
51
-
52
- enabled = d.pop("enabled", UNSET)
53
-
54
- name = d.pop("name", UNSET)
55
-
56
- model_private_cluster = cls(
57
- base_url=base_url,
58
- enabled=enabled,
59
- name=name,
60
- )
61
-
62
- model_private_cluster.additional_properties = d
63
- return model_private_cluster
64
-
65
- @property
66
- def additional_keys(self) -> list[str]:
67
- return list(self.additional_properties.keys())
68
-
69
- def __getitem__(self, key: str) -> Any:
70
- return self.additional_properties[key]
71
-
72
- def __setitem__(self, key: str, value: Any) -> None:
73
- self.additional_properties[key] = value
74
-
75
- def __delitem__(self, key: str) -> None:
76
- del self.additional_properties[key]
77
-
78
- def __contains__(self, key: str) -> bool:
79
- return key in self.additional_properties