beamlit 0.0.24rc19__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/chat.py +37 -11
- beamlit/agents/decorator.py +97 -65
- beamlit/api/agents/create_agent.py +9 -14
- beamlit/api/agents/delete_agent.py +22 -1
- beamlit/api/agents/delete_agent_history.py +2 -6
- beamlit/api/agents/get_agent.py +22 -1
- beamlit/api/agents/get_agent_environment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +2 -6
- beamlit/api/agents/get_agent_metrics.py +22 -1
- beamlit/api/agents/list_agent_history.py +11 -11
- beamlit/api/agents/list_agents.py +36 -4
- beamlit/api/agents/put_agent_history.py +2 -6
- beamlit/api/agents/update_agent.py +9 -14
- beamlit/api/functions/create_function.py +9 -14
- beamlit/api/functions/delete_function.py +22 -1
- beamlit/api/functions/get_function.py +22 -1
- beamlit/api/functions/get_function_environment_logs.py +11 -11
- beamlit/api/functions/get_function_metrics.py +22 -1
- beamlit/api/functions/list_functions.py +36 -4
- beamlit/api/functions/update_function.py +9 -14
- beamlit/api/history/get_agents_history.py +12 -12
- beamlit/api/history/list_agents_history.py +12 -12
- beamlit/api/integrations/get_integration_connection.py +16 -12
- beamlit/api/integrations/get_integration_connection_model.py +8 -1
- beamlit/api/integrations/get_integration_model.py +8 -1
- beamlit/api/locations/list_locations.py +12 -12
- beamlit/api/models/create_model.py +13 -14
- beamlit/api/models/delete_model.py +22 -1
- beamlit/api/models/get_model.py +22 -1
- beamlit/api/models/get_model_environment_logs.py +11 -11
- beamlit/api/models/get_model_metrics.py +38 -13
- beamlit/api/models/list_models.py +36 -4
- beamlit/api/models/update_model.py +13 -14
- beamlit/api/privateclusters/__init__.py +0 -0
- beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
- beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
- beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
- beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
- beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
- beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
- beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
- beamlit/authentication/device_mode.py +3 -9
- beamlit/common/generate.py +47 -34
- beamlit/common/settings.py +29 -27
- beamlit/deploy/deploy.py +101 -342
- beamlit/deploy/format.py +70 -0
- beamlit/deploy/parser.py +175 -0
- beamlit/functions/decorator.py +17 -14
- beamlit/models/__init__.py +64 -78
- beamlit/models/acl.py +4 -22
- beamlit/models/agent.py +34 -95
- beamlit/models/agent_history.py +7 -5
- beamlit/models/agent_history_event.py +11 -9
- beamlit/models/agent_metadata.py +5 -3
- beamlit/models/agent_spec.py +54 -45
- beamlit/models/api_key.py +14 -14
- beamlit/models/configuration.py +11 -0
- beamlit/models/core_spec.py +45 -32
- beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
- beamlit/models/environment.py +33 -105
- beamlit/models/environment_metadata.py +146 -0
- beamlit/models/environment_spec.py +8 -6
- beamlit/models/function.py +34 -95
- beamlit/models/function_metadata.py +5 -3
- beamlit/models/function_spec.py +53 -40
- beamlit/models/integration_connection.py +31 -137
- beamlit/models/integration_connection_spec.py +6 -4
- beamlit/models/metadata.py +5 -3
- beamlit/models/metadata_labels.py +4 -2
- beamlit/models/model.py +33 -94
- beamlit/models/model_metadata.py +5 -3
- beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
- beamlit/models/model_provider.py +27 -43
- beamlit/models/model_spec.py +45 -32
- beamlit/models/owner_fields.py +4 -2
- beamlit/models/pending_invitation.py +14 -14
- beamlit/models/pod_template_spec.py +4 -2
- beamlit/models/policy.py +33 -159
- beamlit/models/policy_spec.py +24 -28
- beamlit/models/private_cluster.py +183 -0
- beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
- beamlit/models/resource_deployment_metrics.py +0 -108
- beamlit/models/resource_environment_metrics.py +143 -71
- beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
- beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_log.py +4 -2
- beamlit/models/runtime.py +20 -2
- beamlit/models/serverless_config.py +28 -21
- beamlit/models/spec_configuration.py +7 -5
- beamlit/models/store_agent.py +14 -14
- beamlit/models/store_function.py +14 -14
- beamlit/models/time_fields.py +4 -2
- beamlit/models/websocket_channel.py +4 -2
- beamlit/models/workspace.py +23 -14
- beamlit/run.py +0 -1
- beamlit/serve/app.py +1 -0
- beamlit/serve/middlewares/accesslog.py +3 -1
- {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
- beamlit-0.0.24rc21.dist-info/RECORD +243 -0
- beamlit/api/agents/delete_agent_deployment.py +0 -163
- beamlit/api/agents/delete_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_logs.py +0 -164
- beamlit/api/agents/list_agent_deployment_history.py +0 -164
- beamlit/api/agents/put_agent_deployment.py +0 -185
- beamlit/api/agents/put_agent_deployment_history.py +0 -198
- beamlit/api/functions/delete_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment_logs.py +0 -164
- beamlit/api/functions/get_function_deployment_metrics.py +0 -159
- beamlit/api/functions/put_function_deployment.py +0 -185
- beamlit/api/models/delete_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment_logs.py +0 -168
- beamlit/api/models/get_model_deployment_metrics.py +0 -163
- beamlit/api/models/put_model_deployment.py +0 -193
- beamlit/models/agent_configuration.py +0 -70
- beamlit/models/agent_deployment.py +0 -340
- beamlit/models/agent_deployment_configuration.py +0 -45
- beamlit/models/agent_deployment_configuration_type_0.py +0 -43
- beamlit/models/agent_deployment_history.py +0 -185
- beamlit/models/agent_deployment_history_event.py +0 -133
- beamlit/models/agent_deployment_pod_template.py +0 -45
- beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
- beamlit/models/agent_with_deployments.py +0 -176
- beamlit/models/authentication_provider_model.py +0 -144
- beamlit/models/authentication_provider_organization.py +0 -88
- beamlit/models/deployment_configuration.py +0 -70
- beamlit/models/deployment_configurations.py +0 -58
- beamlit/models/deployment_serverless_config.py +0 -131
- beamlit/models/deployment_serverless_config_type_0.py +0 -220
- beamlit/models/function_configuration.py +0 -70
- beamlit/models/function_deployment.py +0 -340
- beamlit/models/function_deployment_configuration.py +0 -45
- beamlit/models/function_deployment_configuration_type_0.py +0 -43
- beamlit/models/function_deployment_pod_template.py +0 -45
- beamlit/models/function_deployment_pod_template_type_0.py +0 -43
- beamlit/models/function_with_deployments.py +0 -176
- beamlit/models/integration.py +0 -198
- beamlit/models/integration_config.py +0 -45
- beamlit/models/integration_secret.py +0 -61
- beamlit/models/labels_type_0.py +0 -45
- beamlit/models/location.py +0 -122
- beamlit/models/model_deployment.py +0 -296
- beamlit/models/model_deployment_log.py +0 -70
- beamlit/models/model_deployment_metrics.py +0 -172
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
- beamlit/models/model_deployment_pod_template.py +0 -45
- beamlit/models/model_deployment_pod_template_type_0.py +0 -43
- beamlit/models/model_metrics.py +0 -96
- beamlit/models/model_with_deployments.py +0 -176
- beamlit/models/resource_deployment_log.py +0 -70
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
- beamlit/models/runtime_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0.py +0 -111
- beamlit/models/runtime_type_0_readiness_probe.py +0 -43
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0_resources.py +0 -59
- beamlit/models/standard_fields_dynamo_db.py +0 -88
- beamlit/models/store_agent_configuration.py +0 -97
- beamlit/models/store_agent_labels_type_0.py +0 -43
- beamlit/models/store_function_configuration.py +0 -97
- beamlit/models/store_function_labels_type_0.py +0 -43
- beamlit-0.0.24rc19.dist-info/RECORD +0 -303
- {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -6,14 +6,13 @@ import httpx
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import AuthenticatedClient, Client
|
8
8
|
from ...models.model import Model
|
9
|
-
from ...models.model_with_deployments import ModelWithDeployments
|
10
9
|
from ...types import Response
|
11
10
|
|
12
11
|
|
13
12
|
def _get_kwargs(
|
14
13
|
model_name: str,
|
15
14
|
*,
|
16
|
-
body:
|
15
|
+
body: Model,
|
17
16
|
) -> dict[str, Any]:
|
18
17
|
headers: dict[str, Any] = {}
|
19
18
|
|
@@ -55,7 +54,7 @@ def sync_detailed(
|
|
55
54
|
model_name: str,
|
56
55
|
*,
|
57
56
|
client: AuthenticatedClient,
|
58
|
-
body:
|
57
|
+
body: Model,
|
59
58
|
) -> Response[Model]:
|
60
59
|
"""Create or update model
|
61
60
|
|
@@ -63,8 +62,8 @@ def sync_detailed(
|
|
63
62
|
|
64
63
|
Args:
|
65
64
|
model_name (str):
|
66
|
-
body (
|
67
|
-
|
65
|
+
body (Model): Logical object representing a model, that can be instantiated in multiple
|
66
|
+
environments as model deployments
|
68
67
|
|
69
68
|
Raises:
|
70
69
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -90,7 +89,7 @@ def sync(
|
|
90
89
|
model_name: str,
|
91
90
|
*,
|
92
91
|
client: AuthenticatedClient,
|
93
|
-
body:
|
92
|
+
body: Model,
|
94
93
|
) -> Optional[Model]:
|
95
94
|
"""Create or update model
|
96
95
|
|
@@ -98,8 +97,8 @@ def sync(
|
|
98
97
|
|
99
98
|
Args:
|
100
99
|
model_name (str):
|
101
|
-
body (
|
102
|
-
|
100
|
+
body (Model): Logical object representing a model, that can be instantiated in multiple
|
101
|
+
environments as model deployments
|
103
102
|
|
104
103
|
Raises:
|
105
104
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -120,7 +119,7 @@ async def asyncio_detailed(
|
|
120
119
|
model_name: str,
|
121
120
|
*,
|
122
121
|
client: AuthenticatedClient,
|
123
|
-
body:
|
122
|
+
body: Model,
|
124
123
|
) -> Response[Model]:
|
125
124
|
"""Create or update model
|
126
125
|
|
@@ -128,8 +127,8 @@ async def asyncio_detailed(
|
|
128
127
|
|
129
128
|
Args:
|
130
129
|
model_name (str):
|
131
|
-
body (
|
132
|
-
|
130
|
+
body (Model): Logical object representing a model, that can be instantiated in multiple
|
131
|
+
environments as model deployments
|
133
132
|
|
134
133
|
Raises:
|
135
134
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
@@ -153,7 +152,7 @@ async def asyncio(
|
|
153
152
|
model_name: str,
|
154
153
|
*,
|
155
154
|
client: AuthenticatedClient,
|
156
|
-
body:
|
155
|
+
body: Model,
|
157
156
|
) -> Optional[Model]:
|
158
157
|
"""Create or update model
|
159
158
|
|
@@ -161,8 +160,8 @@ async def asyncio(
|
|
161
160
|
|
162
161
|
Args:
|
163
162
|
model_name (str):
|
164
|
-
body (
|
165
|
-
|
163
|
+
body (Model): Logical object representing a model, that can be instantiated in multiple
|
164
|
+
environments as model deployments
|
166
165
|
|
167
166
|
Raises:
|
168
167
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
File without changes
|
beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py}
RENAMED
@@ -1,21 +1,18 @@
|
|
1
1
|
from http import HTTPStatus
|
2
|
-
from typing import Any, Optional, Union
|
2
|
+
from typing import Any, Optional, Union, cast
|
3
3
|
|
4
4
|
import httpx
|
5
5
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import AuthenticatedClient, Client
|
8
|
-
from ...models.
|
8
|
+
from ...models.private_cluster import PrivateCluster
|
9
9
|
from ...types import Response
|
10
10
|
|
11
11
|
|
12
|
-
def _get_kwargs(
|
13
|
-
agent_name: str,
|
14
|
-
environment_name: str,
|
15
|
-
) -> dict[str, Any]:
|
12
|
+
def _get_kwargs() -> dict[str, Any]:
|
16
13
|
_kwargs: dict[str, Any] = {
|
17
|
-
"method": "
|
18
|
-
"url":
|
14
|
+
"method": "post",
|
15
|
+
"url": "/privateclusters",
|
19
16
|
}
|
20
17
|
|
21
18
|
return _kwargs
|
@@ -23,11 +20,17 @@ def _get_kwargs(
|
|
23
20
|
|
24
21
|
def _parse_response(
|
25
22
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
26
|
-
) -> Optional[
|
23
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
27
24
|
if response.status_code == 200:
|
28
|
-
response_200 =
|
25
|
+
response_200 = PrivateCluster.from_dict(response.json())
|
29
26
|
|
30
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
|
31
34
|
if client.raise_on_unexpected_status:
|
32
35
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
33
36
|
else:
|
@@ -36,7 +39,7 @@ def _parse_response(
|
|
36
39
|
|
37
40
|
def _build_response(
|
38
41
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
39
|
-
) -> Response[
|
42
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
40
43
|
return Response(
|
41
44
|
status_code=HTTPStatus(response.status_code),
|
42
45
|
content=response.content,
|
@@ -46,28 +49,20 @@ def _build_response(
|
|
46
49
|
|
47
50
|
|
48
51
|
def sync_detailed(
|
49
|
-
agent_name: str,
|
50
|
-
environment_name: str,
|
51
52
|
*,
|
52
53
|
client: AuthenticatedClient,
|
53
|
-
) -> Response[
|
54
|
-
"""
|
55
|
-
Args:
|
56
|
-
agent_name (str):
|
57
|
-
environment_name (str):
|
54
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
55
|
+
"""Create private cluster
|
58
56
|
|
59
57
|
Raises:
|
60
58
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
61
59
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
62
60
|
|
63
61
|
Returns:
|
64
|
-
Response[
|
62
|
+
Response[Union[Any, PrivateCluster]]
|
65
63
|
"""
|
66
64
|
|
67
|
-
kwargs = _get_kwargs(
|
68
|
-
agent_name=agent_name,
|
69
|
-
environment_name=environment_name,
|
70
|
-
)
|
65
|
+
kwargs = _get_kwargs()
|
71
66
|
|
72
67
|
response = client.get_httpx_client().request(
|
73
68
|
**kwargs,
|
@@ -77,54 +72,39 @@ def sync_detailed(
|
|
77
72
|
|
78
73
|
|
79
74
|
def sync(
|
80
|
-
agent_name: str,
|
81
|
-
environment_name: str,
|
82
75
|
*,
|
83
76
|
client: AuthenticatedClient,
|
84
|
-
) -> Optional[
|
85
|
-
"""
|
86
|
-
Args:
|
87
|
-
agent_name (str):
|
88
|
-
environment_name (str):
|
77
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
78
|
+
"""Create private cluster
|
89
79
|
|
90
80
|
Raises:
|
91
81
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
92
82
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
93
83
|
|
94
84
|
Returns:
|
95
|
-
|
85
|
+
Union[Any, PrivateCluster]
|
96
86
|
"""
|
97
87
|
|
98
88
|
return sync_detailed(
|
99
|
-
agent_name=agent_name,
|
100
|
-
environment_name=environment_name,
|
101
89
|
client=client,
|
102
90
|
).parsed
|
103
91
|
|
104
92
|
|
105
93
|
async def asyncio_detailed(
|
106
|
-
agent_name: str,
|
107
|
-
environment_name: str,
|
108
94
|
*,
|
109
95
|
client: AuthenticatedClient,
|
110
|
-
) -> Response[
|
111
|
-
"""
|
112
|
-
Args:
|
113
|
-
agent_name (str):
|
114
|
-
environment_name (str):
|
96
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
97
|
+
"""Create private cluster
|
115
98
|
|
116
99
|
Raises:
|
117
100
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
118
101
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
119
102
|
|
120
103
|
Returns:
|
121
|
-
Response[
|
104
|
+
Response[Union[Any, PrivateCluster]]
|
122
105
|
"""
|
123
106
|
|
124
|
-
kwargs = _get_kwargs(
|
125
|
-
agent_name=agent_name,
|
126
|
-
environment_name=environment_name,
|
127
|
-
)
|
107
|
+
kwargs = _get_kwargs()
|
128
108
|
|
129
109
|
response = await client.get_async_httpx_client().request(**kwargs)
|
130
110
|
|
@@ -132,28 +112,21 @@ async def asyncio_detailed(
|
|
132
112
|
|
133
113
|
|
134
114
|
async def asyncio(
|
135
|
-
agent_name: str,
|
136
|
-
environment_name: str,
|
137
115
|
*,
|
138
116
|
client: AuthenticatedClient,
|
139
|
-
) -> Optional[
|
140
|
-
"""
|
141
|
-
Args:
|
142
|
-
agent_name (str):
|
143
|
-
environment_name (str):
|
117
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
118
|
+
"""Create private cluster
|
144
119
|
|
145
120
|
Raises:
|
146
121
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
147
122
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
148
123
|
|
149
124
|
Returns:
|
150
|
-
|
125
|
+
Union[Any, PrivateCluster]
|
151
126
|
"""
|
152
127
|
|
153
128
|
return (
|
154
129
|
await asyncio_detailed(
|
155
|
-
agent_name=agent_name,
|
156
|
-
environment_name=environment_name,
|
157
130
|
client=client,
|
158
131
|
)
|
159
132
|
).parsed
|
beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py}
RENAMED
@@ -1,20 +1,20 @@
|
|
1
1
|
from http import HTTPStatus
|
2
|
-
from typing import Any, Optional, Union
|
2
|
+
from typing import Any, Optional, Union, cast
|
3
3
|
|
4
4
|
import httpx
|
5
5
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import AuthenticatedClient, Client
|
8
|
-
from ...models.
|
8
|
+
from ...models.private_cluster import PrivateCluster
|
9
9
|
from ...types import Response
|
10
10
|
|
11
11
|
|
12
12
|
def _get_kwargs(
|
13
|
-
|
13
|
+
private_cluster_name: str,
|
14
14
|
) -> dict[str, Any]:
|
15
15
|
_kwargs: dict[str, Any] = {
|
16
|
-
"method": "
|
17
|
-
"url": f"/
|
16
|
+
"method": "delete",
|
17
|
+
"url": f"/privateclusters/{private_cluster_name}",
|
18
18
|
}
|
19
19
|
|
20
20
|
return _kwargs
|
@@ -22,16 +22,17 @@ def _get_kwargs(
|
|
22
22
|
|
23
23
|
def _parse_response(
|
24
24
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
25
|
-
) -> Optional[
|
25
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
26
26
|
if response.status_code == 200:
|
27
|
-
response_200 =
|
28
|
-
_response_200 = response.json()
|
29
|
-
for response_200_item_data in _response_200:
|
30
|
-
response_200_item = FunctionDeployment.from_dict(response_200_item_data)
|
31
|
-
|
32
|
-
response_200.append(response_200_item)
|
27
|
+
response_200 = PrivateCluster.from_dict(response.json())
|
33
28
|
|
34
29
|
return response_200
|
30
|
+
if response.status_code == 401:
|
31
|
+
response_401 = cast(Any, None)
|
32
|
+
return response_401
|
33
|
+
if response.status_code == 403:
|
34
|
+
response_403 = cast(Any, None)
|
35
|
+
return response_403
|
35
36
|
if client.raise_on_unexpected_status:
|
36
37
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
37
38
|
else:
|
@@ -40,7 +41,7 @@ def _parse_response(
|
|
40
41
|
|
41
42
|
def _build_response(
|
42
43
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
43
|
-
) -> Response[
|
44
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
44
45
|
return Response(
|
45
46
|
status_code=HTTPStatus(response.status_code),
|
46
47
|
content=response.content,
|
@@ -50,25 +51,25 @@ def _build_response(
|
|
50
51
|
|
51
52
|
|
52
53
|
def sync_detailed(
|
53
|
-
|
54
|
+
private_cluster_name: str,
|
54
55
|
*,
|
55
56
|
client: AuthenticatedClient,
|
56
|
-
) -> Response[
|
57
|
-
"""
|
57
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
58
|
+
"""Delete private cluster
|
58
59
|
|
59
60
|
Args:
|
60
|
-
|
61
|
+
private_cluster_name (str):
|
61
62
|
|
62
63
|
Raises:
|
63
64
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
64
65
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
65
66
|
|
66
67
|
Returns:
|
67
|
-
Response[
|
68
|
+
Response[Union[Any, PrivateCluster]]
|
68
69
|
"""
|
69
70
|
|
70
71
|
kwargs = _get_kwargs(
|
71
|
-
|
72
|
+
private_cluster_name=private_cluster_name,
|
72
73
|
)
|
73
74
|
|
74
75
|
response = client.get_httpx_client().request(
|
@@ -79,49 +80,49 @@ def sync_detailed(
|
|
79
80
|
|
80
81
|
|
81
82
|
def sync(
|
82
|
-
|
83
|
+
private_cluster_name: str,
|
83
84
|
*,
|
84
85
|
client: AuthenticatedClient,
|
85
|
-
) -> Optional[
|
86
|
-
"""
|
86
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
87
|
+
"""Delete private cluster
|
87
88
|
|
88
89
|
Args:
|
89
|
-
|
90
|
+
private_cluster_name (str):
|
90
91
|
|
91
92
|
Raises:
|
92
93
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
93
94
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
94
95
|
|
95
96
|
Returns:
|
96
|
-
|
97
|
+
Union[Any, PrivateCluster]
|
97
98
|
"""
|
98
99
|
|
99
100
|
return sync_detailed(
|
100
|
-
|
101
|
+
private_cluster_name=private_cluster_name,
|
101
102
|
client=client,
|
102
103
|
).parsed
|
103
104
|
|
104
105
|
|
105
106
|
async def asyncio_detailed(
|
106
|
-
|
107
|
+
private_cluster_name: str,
|
107
108
|
*,
|
108
109
|
client: AuthenticatedClient,
|
109
|
-
) -> Response[
|
110
|
-
"""
|
110
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
111
|
+
"""Delete private cluster
|
111
112
|
|
112
113
|
Args:
|
113
|
-
|
114
|
+
private_cluster_name (str):
|
114
115
|
|
115
116
|
Raises:
|
116
117
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
117
118
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
118
119
|
|
119
120
|
Returns:
|
120
|
-
Response[
|
121
|
+
Response[Union[Any, PrivateCluster]]
|
121
122
|
"""
|
122
123
|
|
123
124
|
kwargs = _get_kwargs(
|
124
|
-
|
125
|
+
private_cluster_name=private_cluster_name,
|
125
126
|
)
|
126
127
|
|
127
128
|
response = await client.get_async_httpx_client().request(**kwargs)
|
@@ -130,26 +131,26 @@ async def asyncio_detailed(
|
|
130
131
|
|
131
132
|
|
132
133
|
async def asyncio(
|
133
|
-
|
134
|
+
private_cluster_name: str,
|
134
135
|
*,
|
135
136
|
client: AuthenticatedClient,
|
136
|
-
) -> Optional[
|
137
|
-
"""
|
137
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
138
|
+
"""Delete private cluster
|
138
139
|
|
139
140
|
Args:
|
140
|
-
|
141
|
+
private_cluster_name (str):
|
141
142
|
|
142
143
|
Raises:
|
143
144
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
144
145
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
145
146
|
|
146
147
|
Returns:
|
147
|
-
|
148
|
+
Union[Any, PrivateCluster]
|
148
149
|
"""
|
149
150
|
|
150
151
|
return (
|
151
152
|
await asyncio_detailed(
|
152
|
-
|
153
|
+
private_cluster_name=private_cluster_name,
|
153
154
|
client=client,
|
154
155
|
)
|
155
156
|
).parsed
|
@@ -1,21 +1,20 @@
|
|
1
1
|
from http import HTTPStatus
|
2
|
-
from typing import Any, Optional, Union
|
2
|
+
from typing import Any, Optional, Union, cast
|
3
3
|
|
4
4
|
import httpx
|
5
5
|
|
6
6
|
from ... import errors
|
7
7
|
from ...client import AuthenticatedClient, Client
|
8
|
-
from ...models.
|
8
|
+
from ...models.private_cluster import PrivateCluster
|
9
9
|
from ...types import Response
|
10
10
|
|
11
11
|
|
12
12
|
def _get_kwargs(
|
13
|
-
|
14
|
-
environment_name: str,
|
13
|
+
private_cluster_name: str,
|
15
14
|
) -> dict[str, Any]:
|
16
15
|
_kwargs: dict[str, Any] = {
|
17
16
|
"method": "get",
|
18
|
-
"url": f"/
|
17
|
+
"url": f"/privateclusters/{private_cluster_name}",
|
19
18
|
}
|
20
19
|
|
21
20
|
return _kwargs
|
@@ -23,11 +22,20 @@ def _get_kwargs(
|
|
23
22
|
|
24
23
|
def _parse_response(
|
25
24
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
26
|
-
) -> Optional[
|
25
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
27
26
|
if response.status_code == 200:
|
28
|
-
response_200 =
|
27
|
+
response_200 = PrivateCluster.from_dict(response.json())
|
29
28
|
|
30
29
|
return response_200
|
30
|
+
if response.status_code == 401:
|
31
|
+
response_401 = cast(Any, None)
|
32
|
+
return response_401
|
33
|
+
if response.status_code == 403:
|
34
|
+
response_403 = cast(Any, None)
|
35
|
+
return response_403
|
36
|
+
if response.status_code == 404:
|
37
|
+
response_404 = cast(Any, None)
|
38
|
+
return response_404
|
31
39
|
if client.raise_on_unexpected_status:
|
32
40
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
33
41
|
else:
|
@@ -36,7 +44,7 @@ def _parse_response(
|
|
36
44
|
|
37
45
|
def _build_response(
|
38
46
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
39
|
-
) -> Response[
|
47
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
40
48
|
return Response(
|
41
49
|
status_code=HTTPStatus(response.status_code),
|
42
50
|
content=response.content,
|
@@ -46,28 +54,25 @@ def _build_response(
|
|
46
54
|
|
47
55
|
|
48
56
|
def sync_detailed(
|
49
|
-
|
50
|
-
environment_name: str,
|
57
|
+
private_cluster_name: str,
|
51
58
|
*,
|
52
59
|
client: AuthenticatedClient,
|
53
|
-
) -> Response[
|
54
|
-
"""Get
|
60
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
61
|
+
"""Get private cluster by name
|
55
62
|
|
56
63
|
Args:
|
57
|
-
|
58
|
-
environment_name (str):
|
64
|
+
private_cluster_name (str):
|
59
65
|
|
60
66
|
Raises:
|
61
67
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
62
68
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
63
69
|
|
64
70
|
Returns:
|
65
|
-
Response[
|
71
|
+
Response[Union[Any, PrivateCluster]]
|
66
72
|
"""
|
67
73
|
|
68
74
|
kwargs = _get_kwargs(
|
69
|
-
|
70
|
-
environment_name=environment_name,
|
75
|
+
private_cluster_name=private_cluster_name,
|
71
76
|
)
|
72
77
|
|
73
78
|
response = client.get_httpx_client().request(
|
@@ -78,55 +83,49 @@ def sync_detailed(
|
|
78
83
|
|
79
84
|
|
80
85
|
def sync(
|
81
|
-
|
82
|
-
environment_name: str,
|
86
|
+
private_cluster_name: str,
|
83
87
|
*,
|
84
88
|
client: AuthenticatedClient,
|
85
|
-
) -> Optional[
|
86
|
-
"""Get
|
89
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
90
|
+
"""Get private cluster by name
|
87
91
|
|
88
92
|
Args:
|
89
|
-
|
90
|
-
environment_name (str):
|
93
|
+
private_cluster_name (str):
|
91
94
|
|
92
95
|
Raises:
|
93
96
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
94
97
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
95
98
|
|
96
99
|
Returns:
|
97
|
-
|
100
|
+
Union[Any, PrivateCluster]
|
98
101
|
"""
|
99
102
|
|
100
103
|
return sync_detailed(
|
101
|
-
|
102
|
-
environment_name=environment_name,
|
104
|
+
private_cluster_name=private_cluster_name,
|
103
105
|
client=client,
|
104
106
|
).parsed
|
105
107
|
|
106
108
|
|
107
109
|
async def asyncio_detailed(
|
108
|
-
|
109
|
-
environment_name: str,
|
110
|
+
private_cluster_name: str,
|
110
111
|
*,
|
111
112
|
client: AuthenticatedClient,
|
112
|
-
) -> Response[
|
113
|
-
"""Get
|
113
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
114
|
+
"""Get private cluster by name
|
114
115
|
|
115
116
|
Args:
|
116
|
-
|
117
|
-
environment_name (str):
|
117
|
+
private_cluster_name (str):
|
118
118
|
|
119
119
|
Raises:
|
120
120
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
121
121
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
122
122
|
|
123
123
|
Returns:
|
124
|
-
Response[
|
124
|
+
Response[Union[Any, PrivateCluster]]
|
125
125
|
"""
|
126
126
|
|
127
127
|
kwargs = _get_kwargs(
|
128
|
-
|
129
|
-
environment_name=environment_name,
|
128
|
+
private_cluster_name=private_cluster_name,
|
130
129
|
)
|
131
130
|
|
132
131
|
response = await client.get_async_httpx_client().request(**kwargs)
|
@@ -135,29 +134,26 @@ async def asyncio_detailed(
|
|
135
134
|
|
136
135
|
|
137
136
|
async def asyncio(
|
138
|
-
|
139
|
-
environment_name: str,
|
137
|
+
private_cluster_name: str,
|
140
138
|
*,
|
141
139
|
client: AuthenticatedClient,
|
142
|
-
) -> Optional[
|
143
|
-
"""Get
|
140
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
141
|
+
"""Get private cluster by name
|
144
142
|
|
145
143
|
Args:
|
146
|
-
|
147
|
-
environment_name (str):
|
144
|
+
private_cluster_name (str):
|
148
145
|
|
149
146
|
Raises:
|
150
147
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
151
148
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
152
149
|
|
153
150
|
Returns:
|
154
|
-
|
151
|
+
Union[Any, PrivateCluster]
|
155
152
|
"""
|
156
153
|
|
157
154
|
return (
|
158
155
|
await asyncio_detailed(
|
159
|
-
|
160
|
-
environment_name=environment_name,
|
156
|
+
private_cluster_name=private_cluster_name,
|
161
157
|
client=client,
|
162
158
|
)
|
163
159
|
).parsed
|