blaxel 0.64.0__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/__init__.py +8 -0
- blaxel/agents/__init__.py +5 -0
- blaxel/agents/chain.py +153 -0
- blaxel/agents/chat.py +286 -0
- blaxel/agents/decorator.py +208 -0
- blaxel/agents/thread.py +24 -0
- blaxel/agents/voice/openai.py +255 -0
- blaxel/agents/voice/utils.py +25 -0
- blaxel/api/__init__.py +1 -0
- blaxel/api/agents/__init__.py +0 -0
- blaxel/api/agents/create_agent.py +155 -0
- blaxel/api/agents/delete_agent.py +146 -0
- blaxel/api/agents/get_agent.py +146 -0
- blaxel/api/agents/get_agent_logs.py +151 -0
- blaxel/api/agents/get_agent_metrics.py +150 -0
- blaxel/api/agents/get_agent_trace_ids.py +201 -0
- blaxel/api/agents/list_agent_revisions.py +155 -0
- blaxel/api/agents/list_agents.py +127 -0
- blaxel/api/agents/update_agent.py +168 -0
- blaxel/api/configurations/__init__.py +0 -0
- blaxel/api/configurations/get_configuration.py +122 -0
- blaxel/api/default/__init__.py +0 -0
- blaxel/api/default/get_trace.py +150 -0
- blaxel/api/default/get_trace_ids.py +218 -0
- blaxel/api/default/get_trace_logs.py +186 -0
- blaxel/api/default/list_mcp_hub_definitions.py +127 -0
- blaxel/api/functions/__init__.py +0 -0
- blaxel/api/functions/create_function.py +155 -0
- blaxel/api/functions/delete_function.py +146 -0
- blaxel/api/functions/get_function.py +146 -0
- blaxel/api/functions/get_function_logs.py +151 -0
- blaxel/api/functions/get_function_metrics.py +150 -0
- blaxel/api/functions/get_function_trace_ids.py +201 -0
- blaxel/api/functions/list_function_revisions.py +158 -0
- blaxel/api/functions/list_functions.py +131 -0
- blaxel/api/functions/update_function.py +168 -0
- blaxel/api/integrations/__init__.py +0 -0
- blaxel/api/integrations/create_integration_connection.py +167 -0
- blaxel/api/integrations/delete_integration_connection.py +158 -0
- blaxel/api/integrations/get_integration.py +97 -0
- blaxel/api/integrations/get_integration_connection.py +158 -0
- blaxel/api/integrations/get_integration_connection_model.py +104 -0
- blaxel/api/integrations/get_integration_connection_model_endpoint_configurations.py +97 -0
- blaxel/api/integrations/list_integration_connection_models.py +97 -0
- blaxel/api/integrations/list_integration_connections.py +139 -0
- blaxel/api/integrations/update_integration_connection.py +180 -0
- blaxel/api/invitations/__init__.py +0 -0
- blaxel/api/invitations/list_all_pending_invitations.py +142 -0
- blaxel/api/knowledgebases/__init__.py +0 -0
- blaxel/api/knowledgebases/create_knowledgebase.py +163 -0
- blaxel/api/knowledgebases/delete_knowledgebase.py +154 -0
- blaxel/api/knowledgebases/get_knowledgebase.py +154 -0
- blaxel/api/knowledgebases/list_knowledgebase_revisions.py +158 -0
- blaxel/api/knowledgebases/list_knowledgebases.py +139 -0
- blaxel/api/knowledgebases/update_knowledgebase.py +176 -0
- blaxel/api/locations/__init__.py +0 -0
- blaxel/api/locations/list_locations.py +139 -0
- blaxel/api/metrics/__init__.py +0 -0
- blaxel/api/metrics/get_metrics.py +130 -0
- blaxel/api/models/__init__.py +0 -0
- blaxel/api/models/create_model.py +163 -0
- blaxel/api/models/delete_model.py +154 -0
- blaxel/api/models/get_model.py +154 -0
- blaxel/api/models/get_model_logs.py +155 -0
- blaxel/api/models/get_model_metrics.py +158 -0
- blaxel/api/models/get_model_trace_ids.py +201 -0
- blaxel/api/models/list_model_revisions.py +158 -0
- blaxel/api/models/list_models.py +135 -0
- blaxel/api/models/update_model.py +176 -0
- blaxel/api/policies/__init__.py +0 -0
- blaxel/api/policies/create_policy.py +167 -0
- blaxel/api/policies/delete_policy.py +154 -0
- blaxel/api/policies/get_policy.py +154 -0
- blaxel/api/policies/list_policies.py +139 -0
- blaxel/api/policies/update_policy.py +180 -0
- blaxel/api/privateclusters/__init__.py +0 -0
- blaxel/api/privateclusters/create_private_cluster.py +132 -0
- blaxel/api/privateclusters/delete_private_cluster.py +156 -0
- blaxel/api/privateclusters/get_private_cluster.py +159 -0
- blaxel/api/privateclusters/get_private_cluster_health.py +97 -0
- blaxel/api/privateclusters/list_private_clusters.py +140 -0
- blaxel/api/privateclusters/update_private_cluster.py +156 -0
- blaxel/api/privateclusters/update_private_cluster_health.py +97 -0
- blaxel/api/service_accounts/__init__.py +0 -0
- blaxel/api/service_accounts/create_api_key_for_service_account.py +177 -0
- blaxel/api/service_accounts/create_workspace_service_account.py +170 -0
- blaxel/api/service_accounts/delete_api_key_for_service_account.py +104 -0
- blaxel/api/service_accounts/delete_workspace_service_account.py +160 -0
- blaxel/api/service_accounts/get_workspace_service_accounts.py +141 -0
- blaxel/api/service_accounts/list_api_keys_for_service_account.py +163 -0
- blaxel/api/service_accounts/update_workspace_service_account.py +183 -0
- blaxel/api/store/__init__.py +0 -0
- blaxel/api/store/get_store_agent.py +146 -0
- blaxel/api/store/get_store_function.py +146 -0
- blaxel/api/store/list_store_agents.py +131 -0
- blaxel/api/store/list_store_functions.py +131 -0
- blaxel/api/workspaces/__init__.py +0 -0
- blaxel/api/workspaces/accept_workspace_invitation.py +161 -0
- blaxel/api/workspaces/create_worspace.py +163 -0
- blaxel/api/workspaces/decline_workspace_invitation.py +158 -0
- blaxel/api/workspaces/delete_workspace.py +154 -0
- blaxel/api/workspaces/get_workspace.py +154 -0
- blaxel/api/workspaces/invite_workspace_user.py +174 -0
- blaxel/api/workspaces/leave_workspace.py +161 -0
- blaxel/api/workspaces/list_workspace_users.py +139 -0
- blaxel/api/workspaces/list_workspaces.py +139 -0
- blaxel/api/workspaces/remove_workspace_user.py +101 -0
- blaxel/api/workspaces/update_workspace.py +176 -0
- blaxel/api/workspaces/update_workspace_user_role.py +187 -0
- blaxel/authentication/__init__.py +45 -0
- blaxel/authentication/apikey.py +50 -0
- blaxel/authentication/authentication.py +176 -0
- blaxel/authentication/clientcredentials.py +103 -0
- blaxel/authentication/credentials.py +295 -0
- blaxel/authentication/device_mode.py +197 -0
- blaxel/client.py +281 -0
- blaxel/common/__init__.py +17 -0
- blaxel/common/error.py +27 -0
- blaxel/common/instrumentation.py +317 -0
- blaxel/common/logger.py +60 -0
- blaxel/common/secrets.py +39 -0
- blaxel/common/settings.py +150 -0
- blaxel/common/slugify.py +18 -0
- blaxel/common/utils.py +34 -0
- blaxel/deploy/__init__.py +8 -0
- blaxel/deploy/deploy.py +316 -0
- blaxel/deploy/format.py +46 -0
- blaxel/deploy/parser.py +192 -0
- blaxel/errors.py +16 -0
- blaxel/functions/__init__.py +7 -0
- blaxel/functions/common.py +228 -0
- blaxel/functions/decorator.py +64 -0
- blaxel/functions/local/local.py +48 -0
- blaxel/functions/mcp/client.py +96 -0
- blaxel/functions/mcp/mcp.py +168 -0
- blaxel/functions/mcp/utils.py +56 -0
- blaxel/functions/remote/remote.py +183 -0
- blaxel/models/__init__.py +233 -0
- blaxel/models/acl.py +133 -0
- blaxel/models/agent.py +126 -0
- blaxel/models/agent_chain.py +88 -0
- blaxel/models/agent_spec.py +346 -0
- blaxel/models/api_key.py +142 -0
- blaxel/models/configuration.py +85 -0
- blaxel/models/continent.py +70 -0
- blaxel/models/core_event.py +97 -0
- blaxel/models/core_spec.py +249 -0
- blaxel/models/core_spec_configurations.py +77 -0
- blaxel/models/country.py +70 -0
- blaxel/models/create_api_key_for_service_account_body.py +69 -0
- blaxel/models/create_workspace_service_account_body.py +71 -0
- blaxel/models/create_workspace_service_account_response_200.py +105 -0
- blaxel/models/delete_workspace_service_account_response_200.py +96 -0
- blaxel/models/entrypoint.py +96 -0
- blaxel/models/entrypoint_env.py +45 -0
- blaxel/models/flavor.py +70 -0
- blaxel/models/form.py +120 -0
- blaxel/models/form_config.py +45 -0
- blaxel/models/form_oauthomitempty.py +45 -0
- blaxel/models/form_secrets.py +45 -0
- blaxel/models/function.py +126 -0
- blaxel/models/function_kit.py +97 -0
- blaxel/models/function_spec.py +310 -0
- blaxel/models/get_trace_ids_response_200.py +45 -0
- blaxel/models/get_trace_logs_response_200.py +45 -0
- blaxel/models/get_trace_response_200.py +45 -0
- blaxel/models/get_workspace_service_accounts_response_200_item.py +96 -0
- blaxel/models/histogram_bucket.py +79 -0
- blaxel/models/histogram_stats.py +88 -0
- blaxel/models/integration_connection.py +96 -0
- blaxel/models/integration_connection_spec.py +114 -0
- blaxel/models/integration_connection_spec_config.py +45 -0
- blaxel/models/integration_connection_spec_secret.py +45 -0
- blaxel/models/integration_model.py +162 -0
- blaxel/models/integration_repository.py +88 -0
- blaxel/models/invite_workspace_user_body.py +60 -0
- blaxel/models/knowledgebase.py +126 -0
- blaxel/models/knowledgebase_spec.py +163 -0
- blaxel/models/knowledgebase_spec_options.py +45 -0
- blaxel/models/last_n_requests_metric.py +79 -0
- blaxel/models/latency_metric.py +144 -0
- blaxel/models/location_response.py +113 -0
- blaxel/models/mcp_definition.py +188 -0
- blaxel/models/mcp_definition_entrypoint.py +45 -0
- blaxel/models/mcp_definition_form.py +45 -0
- blaxel/models/metadata.py +139 -0
- blaxel/models/metadata_labels.py +45 -0
- blaxel/models/metric.py +79 -0
- blaxel/models/metrics.py +169 -0
- blaxel/models/metrics_models.py +45 -0
- blaxel/models/metrics_request_total_per_code.py +45 -0
- blaxel/models/metrics_rps_per_code.py +45 -0
- blaxel/models/model.py +126 -0
- blaxel/models/model_private_cluster.py +79 -0
- blaxel/models/model_spec.py +249 -0
- blaxel/models/o_auth.py +72 -0
- blaxel/models/owner_fields.py +70 -0
- blaxel/models/pending_invitation.py +124 -0
- blaxel/models/pending_invitation_accept.py +85 -0
- blaxel/models/pending_invitation_render.py +147 -0
- blaxel/models/pending_invitation_render_invited_by.py +88 -0
- blaxel/models/pending_invitation_render_workspace.py +70 -0
- blaxel/models/pending_invitation_workspace_details.py +72 -0
- blaxel/models/pod_template_spec.py +45 -0
- blaxel/models/policy.py +96 -0
- blaxel/models/policy_location.py +70 -0
- blaxel/models/policy_max_tokens.py +106 -0
- blaxel/models/policy_spec.py +151 -0
- blaxel/models/private_cluster.py +183 -0
- blaxel/models/private_location.py +61 -0
- blaxel/models/repository.py +70 -0
- blaxel/models/request_duration_over_time_metric.py +97 -0
- blaxel/models/request_duration_over_time_metrics.py +80 -0
- blaxel/models/request_total_by_origin_metric.py +115 -0
- blaxel/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
- blaxel/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
- blaxel/models/request_total_metric.py +123 -0
- blaxel/models/request_total_metric_request_total_per_code.py +45 -0
- blaxel/models/request_total_metric_rps_per_code.py +45 -0
- blaxel/models/resource_log.py +79 -0
- blaxel/models/resource_metrics.py +270 -0
- blaxel/models/resource_metrics_request_total_per_code.py +45 -0
- blaxel/models/resource_metrics_rps_per_code.py +45 -0
- blaxel/models/revision_configuration.py +97 -0
- blaxel/models/revision_metadata.py +124 -0
- blaxel/models/runtime.py +196 -0
- blaxel/models/runtime_startup_probe.py +45 -0
- blaxel/models/serverless_config.py +80 -0
- blaxel/models/spec_configuration.py +70 -0
- blaxel/models/store_agent.py +178 -0
- blaxel/models/store_agent_labels.py +45 -0
- blaxel/models/store_configuration.py +151 -0
- blaxel/models/store_configuration_option.py +79 -0
- blaxel/models/store_function.py +211 -0
- blaxel/models/store_function_kit.py +97 -0
- blaxel/models/store_function_labels.py +45 -0
- blaxel/models/store_function_parameter.py +88 -0
- blaxel/models/time_fields.py +70 -0
- blaxel/models/token_rate_metric.py +88 -0
- blaxel/models/token_rate_metrics.py +120 -0
- blaxel/models/token_total_metric.py +106 -0
- blaxel/models/trace_ids_response.py +45 -0
- blaxel/models/update_workspace_service_account_body.py +69 -0
- blaxel/models/update_workspace_service_account_response_200.py +96 -0
- blaxel/models/update_workspace_user_role_body.py +60 -0
- blaxel/models/websocket_channel.py +88 -0
- blaxel/models/workspace.py +148 -0
- blaxel/models/workspace_labels.py +45 -0
- blaxel/models/workspace_user.py +115 -0
- blaxel/py.typed +1 -0
- blaxel/run.py +108 -0
- blaxel/serve/app.py +131 -0
- blaxel/serve/middlewares/__init__.py +10 -0
- blaxel/serve/middlewares/accesslog.py +32 -0
- blaxel/serve/middlewares/processtime.py +28 -0
- blaxel/types.py +46 -0
- blaxel-0.64.0.dist-info/METADATA +96 -0
- blaxel-0.64.0.dist-info/RECORD +261 -0
- blaxel-0.64.0.dist-info/WHEEL +4 -0
- blaxel-0.64.0.dist-info/entry_points.txt +2 -0
- blaxel-0.64.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,156 @@
|
|
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 AuthenticatedClient, 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(
|
24
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
25
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
26
|
+
if response.status_code == 200:
|
27
|
+
response_200 = PrivateCluster.from_dict(response.json())
|
28
|
+
|
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 client.raise_on_unexpected_status:
|
37
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
38
|
+
else:
|
39
|
+
return None
|
40
|
+
|
41
|
+
|
42
|
+
def _build_response(
|
43
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
44
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
45
|
+
return Response(
|
46
|
+
status_code=HTTPStatus(response.status_code),
|
47
|
+
content=response.content,
|
48
|
+
headers=response.headers,
|
49
|
+
parsed=_parse_response(client=client, response=response),
|
50
|
+
)
|
51
|
+
|
52
|
+
|
53
|
+
def sync_detailed(
|
54
|
+
private_cluster_name: str,
|
55
|
+
*,
|
56
|
+
client: AuthenticatedClient,
|
57
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
58
|
+
"""Update private cluster
|
59
|
+
|
60
|
+
Args:
|
61
|
+
private_cluster_name (str):
|
62
|
+
|
63
|
+
Raises:
|
64
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
65
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
66
|
+
|
67
|
+
Returns:
|
68
|
+
Response[Union[Any, PrivateCluster]]
|
69
|
+
"""
|
70
|
+
|
71
|
+
kwargs = _get_kwargs(
|
72
|
+
private_cluster_name=private_cluster_name,
|
73
|
+
)
|
74
|
+
|
75
|
+
response = client.get_httpx_client().request(
|
76
|
+
**kwargs,
|
77
|
+
)
|
78
|
+
|
79
|
+
return _build_response(client=client, response=response)
|
80
|
+
|
81
|
+
|
82
|
+
def sync(
|
83
|
+
private_cluster_name: str,
|
84
|
+
*,
|
85
|
+
client: AuthenticatedClient,
|
86
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
87
|
+
"""Update private cluster
|
88
|
+
|
89
|
+
Args:
|
90
|
+
private_cluster_name (str):
|
91
|
+
|
92
|
+
Raises:
|
93
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
94
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
95
|
+
|
96
|
+
Returns:
|
97
|
+
Union[Any, PrivateCluster]
|
98
|
+
"""
|
99
|
+
|
100
|
+
return sync_detailed(
|
101
|
+
private_cluster_name=private_cluster_name,
|
102
|
+
client=client,
|
103
|
+
).parsed
|
104
|
+
|
105
|
+
|
106
|
+
async def asyncio_detailed(
|
107
|
+
private_cluster_name: str,
|
108
|
+
*,
|
109
|
+
client: AuthenticatedClient,
|
110
|
+
) -> Response[Union[Any, PrivateCluster]]:
|
111
|
+
"""Update private cluster
|
112
|
+
|
113
|
+
Args:
|
114
|
+
private_cluster_name (str):
|
115
|
+
|
116
|
+
Raises:
|
117
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
118
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
119
|
+
|
120
|
+
Returns:
|
121
|
+
Response[Union[Any, PrivateCluster]]
|
122
|
+
"""
|
123
|
+
|
124
|
+
kwargs = _get_kwargs(
|
125
|
+
private_cluster_name=private_cluster_name,
|
126
|
+
)
|
127
|
+
|
128
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
129
|
+
|
130
|
+
return _build_response(client=client, response=response)
|
131
|
+
|
132
|
+
|
133
|
+
async def asyncio(
|
134
|
+
private_cluster_name: str,
|
135
|
+
*,
|
136
|
+
client: AuthenticatedClient,
|
137
|
+
) -> Optional[Union[Any, PrivateCluster]]:
|
138
|
+
"""Update private cluster
|
139
|
+
|
140
|
+
Args:
|
141
|
+
private_cluster_name (str):
|
142
|
+
|
143
|
+
Raises:
|
144
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
145
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
146
|
+
|
147
|
+
Returns:
|
148
|
+
Union[Any, PrivateCluster]
|
149
|
+
"""
|
150
|
+
|
151
|
+
return (
|
152
|
+
await asyncio_detailed(
|
153
|
+
private_cluster_name=private_cluster_name,
|
154
|
+
client=client,
|
155
|
+
)
|
156
|
+
).parsed
|
@@ -0,0 +1,97 @@
|
|
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 AuthenticatedClient, 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: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
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: Union[AuthenticatedClient, 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[AuthenticatedClient, 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[AuthenticatedClient, 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)
|
File without changes
|
@@ -0,0 +1,177 @@
|
|
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 AuthenticatedClient, Client
|
8
|
+
from ...models.api_key import ApiKey
|
9
|
+
from ...models.create_api_key_for_service_account_body import CreateApiKeyForServiceAccountBody
|
10
|
+
from ...types import Response
|
11
|
+
|
12
|
+
|
13
|
+
def _get_kwargs(
|
14
|
+
client_id: str,
|
15
|
+
*,
|
16
|
+
body: CreateApiKeyForServiceAccountBody,
|
17
|
+
) -> dict[str, Any]:
|
18
|
+
headers: dict[str, Any] = {}
|
19
|
+
|
20
|
+
_kwargs: dict[str, Any] = {
|
21
|
+
"method": "post",
|
22
|
+
"url": f"/service_accounts/{client_id}/api_keys",
|
23
|
+
}
|
24
|
+
|
25
|
+
_body = body.to_dict()
|
26
|
+
|
27
|
+
_kwargs["json"] = _body
|
28
|
+
headers["Content-Type"] = "application/json"
|
29
|
+
|
30
|
+
_kwargs["headers"] = headers
|
31
|
+
return _kwargs
|
32
|
+
|
33
|
+
|
34
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ApiKey]:
|
35
|
+
if response.status_code == 200:
|
36
|
+
response_200 = ApiKey.from_dict(response.json())
|
37
|
+
|
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: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ApiKey]:
|
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
|
+
client_id: str,
|
56
|
+
*,
|
57
|
+
client: AuthenticatedClient,
|
58
|
+
body: CreateApiKeyForServiceAccountBody,
|
59
|
+
) -> Response[ApiKey]:
|
60
|
+
"""Create API key for service account
|
61
|
+
|
62
|
+
Creates an API key for a service account.
|
63
|
+
|
64
|
+
Args:
|
65
|
+
client_id (str):
|
66
|
+
body (CreateApiKeyForServiceAccountBody):
|
67
|
+
|
68
|
+
Raises:
|
69
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
70
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
71
|
+
|
72
|
+
Returns:
|
73
|
+
Response[ApiKey]
|
74
|
+
"""
|
75
|
+
|
76
|
+
kwargs = _get_kwargs(
|
77
|
+
client_id=client_id,
|
78
|
+
body=body,
|
79
|
+
)
|
80
|
+
|
81
|
+
response = client.get_httpx_client().request(
|
82
|
+
**kwargs,
|
83
|
+
)
|
84
|
+
|
85
|
+
return _build_response(client=client, response=response)
|
86
|
+
|
87
|
+
|
88
|
+
def sync(
|
89
|
+
client_id: str,
|
90
|
+
*,
|
91
|
+
client: AuthenticatedClient,
|
92
|
+
body: CreateApiKeyForServiceAccountBody,
|
93
|
+
) -> Optional[ApiKey]:
|
94
|
+
"""Create API key for service account
|
95
|
+
|
96
|
+
Creates an API key for a service account.
|
97
|
+
|
98
|
+
Args:
|
99
|
+
client_id (str):
|
100
|
+
body (CreateApiKeyForServiceAccountBody):
|
101
|
+
|
102
|
+
Raises:
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
105
|
+
|
106
|
+
Returns:
|
107
|
+
ApiKey
|
108
|
+
"""
|
109
|
+
|
110
|
+
return sync_detailed(
|
111
|
+
client_id=client_id,
|
112
|
+
client=client,
|
113
|
+
body=body,
|
114
|
+
).parsed
|
115
|
+
|
116
|
+
|
117
|
+
async def asyncio_detailed(
|
118
|
+
client_id: str,
|
119
|
+
*,
|
120
|
+
client: AuthenticatedClient,
|
121
|
+
body: CreateApiKeyForServiceAccountBody,
|
122
|
+
) -> Response[ApiKey]:
|
123
|
+
"""Create API key for service account
|
124
|
+
|
125
|
+
Creates an API key for a service account.
|
126
|
+
|
127
|
+
Args:
|
128
|
+
client_id (str):
|
129
|
+
body (CreateApiKeyForServiceAccountBody):
|
130
|
+
|
131
|
+
Raises:
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
134
|
+
|
135
|
+
Returns:
|
136
|
+
Response[ApiKey]
|
137
|
+
"""
|
138
|
+
|
139
|
+
kwargs = _get_kwargs(
|
140
|
+
client_id=client_id,
|
141
|
+
body=body,
|
142
|
+
)
|
143
|
+
|
144
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
145
|
+
|
146
|
+
return _build_response(client=client, response=response)
|
147
|
+
|
148
|
+
|
149
|
+
async def asyncio(
|
150
|
+
client_id: str,
|
151
|
+
*,
|
152
|
+
client: AuthenticatedClient,
|
153
|
+
body: CreateApiKeyForServiceAccountBody,
|
154
|
+
) -> Optional[ApiKey]:
|
155
|
+
"""Create API key for service account
|
156
|
+
|
157
|
+
Creates an API key for a service account.
|
158
|
+
|
159
|
+
Args:
|
160
|
+
client_id (str):
|
161
|
+
body (CreateApiKeyForServiceAccountBody):
|
162
|
+
|
163
|
+
Raises:
|
164
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
165
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
166
|
+
|
167
|
+
Returns:
|
168
|
+
ApiKey
|
169
|
+
"""
|
170
|
+
|
171
|
+
return (
|
172
|
+
await asyncio_detailed(
|
173
|
+
client_id=client_id,
|
174
|
+
client=client,
|
175
|
+
body=body,
|
176
|
+
)
|
177
|
+
).parsed
|
@@ -0,0 +1,170 @@
|
|
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 AuthenticatedClient, Client
|
8
|
+
from ...models.create_workspace_service_account_body import CreateWorkspaceServiceAccountBody
|
9
|
+
from ...models.create_workspace_service_account_response_200 import (
|
10
|
+
CreateWorkspaceServiceAccountResponse200,
|
11
|
+
)
|
12
|
+
from ...types import Response
|
13
|
+
|
14
|
+
|
15
|
+
def _get_kwargs(
|
16
|
+
*,
|
17
|
+
body: CreateWorkspaceServiceAccountBody,
|
18
|
+
) -> dict[str, Any]:
|
19
|
+
headers: dict[str, Any] = {}
|
20
|
+
|
21
|
+
_kwargs: dict[str, Any] = {
|
22
|
+
"method": "post",
|
23
|
+
"url": "/service_accounts",
|
24
|
+
}
|
25
|
+
|
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(
|
36
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
37
|
+
) -> Optional[CreateWorkspaceServiceAccountResponse200]:
|
38
|
+
if response.status_code == 200:
|
39
|
+
response_200 = CreateWorkspaceServiceAccountResponse200.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(
|
49
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
50
|
+
) -> Response[CreateWorkspaceServiceAccountResponse200]:
|
51
|
+
return Response(
|
52
|
+
status_code=HTTPStatus(response.status_code),
|
53
|
+
content=response.content,
|
54
|
+
headers=response.headers,
|
55
|
+
parsed=_parse_response(client=client, response=response),
|
56
|
+
)
|
57
|
+
|
58
|
+
|
59
|
+
def sync_detailed(
|
60
|
+
*,
|
61
|
+
client: AuthenticatedClient,
|
62
|
+
body: CreateWorkspaceServiceAccountBody,
|
63
|
+
) -> Response[CreateWorkspaceServiceAccountResponse200]:
|
64
|
+
"""Create workspace service account
|
65
|
+
|
66
|
+
Creates a service account in the workspace.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
body (CreateWorkspaceServiceAccountBody):
|
70
|
+
|
71
|
+
Raises:
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
74
|
+
|
75
|
+
Returns:
|
76
|
+
Response[CreateWorkspaceServiceAccountResponse200]
|
77
|
+
"""
|
78
|
+
|
79
|
+
kwargs = _get_kwargs(
|
80
|
+
body=body,
|
81
|
+
)
|
82
|
+
|
83
|
+
response = client.get_httpx_client().request(
|
84
|
+
**kwargs,
|
85
|
+
)
|
86
|
+
|
87
|
+
return _build_response(client=client, response=response)
|
88
|
+
|
89
|
+
|
90
|
+
def sync(
|
91
|
+
*,
|
92
|
+
client: AuthenticatedClient,
|
93
|
+
body: CreateWorkspaceServiceAccountBody,
|
94
|
+
) -> Optional[CreateWorkspaceServiceAccountResponse200]:
|
95
|
+
"""Create workspace service account
|
96
|
+
|
97
|
+
Creates a service account in the workspace.
|
98
|
+
|
99
|
+
Args:
|
100
|
+
body (CreateWorkspaceServiceAccountBody):
|
101
|
+
|
102
|
+
Raises:
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
105
|
+
|
106
|
+
Returns:
|
107
|
+
CreateWorkspaceServiceAccountResponse200
|
108
|
+
"""
|
109
|
+
|
110
|
+
return sync_detailed(
|
111
|
+
client=client,
|
112
|
+
body=body,
|
113
|
+
).parsed
|
114
|
+
|
115
|
+
|
116
|
+
async def asyncio_detailed(
|
117
|
+
*,
|
118
|
+
client: AuthenticatedClient,
|
119
|
+
body: CreateWorkspaceServiceAccountBody,
|
120
|
+
) -> Response[CreateWorkspaceServiceAccountResponse200]:
|
121
|
+
"""Create workspace service account
|
122
|
+
|
123
|
+
Creates a service account in the workspace.
|
124
|
+
|
125
|
+
Args:
|
126
|
+
body (CreateWorkspaceServiceAccountBody):
|
127
|
+
|
128
|
+
Raises:
|
129
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
130
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
131
|
+
|
132
|
+
Returns:
|
133
|
+
Response[CreateWorkspaceServiceAccountResponse200]
|
134
|
+
"""
|
135
|
+
|
136
|
+
kwargs = _get_kwargs(
|
137
|
+
body=body,
|
138
|
+
)
|
139
|
+
|
140
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
141
|
+
|
142
|
+
return _build_response(client=client, response=response)
|
143
|
+
|
144
|
+
|
145
|
+
async def asyncio(
|
146
|
+
*,
|
147
|
+
client: AuthenticatedClient,
|
148
|
+
body: CreateWorkspaceServiceAccountBody,
|
149
|
+
) -> Optional[CreateWorkspaceServiceAccountResponse200]:
|
150
|
+
"""Create workspace service account
|
151
|
+
|
152
|
+
Creates a service account in the workspace.
|
153
|
+
|
154
|
+
Args:
|
155
|
+
body (CreateWorkspaceServiceAccountBody):
|
156
|
+
|
157
|
+
Raises:
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
160
|
+
|
161
|
+
Returns:
|
162
|
+
CreateWorkspaceServiceAccountResponse200
|
163
|
+
"""
|
164
|
+
|
165
|
+
return (
|
166
|
+
await asyncio_detailed(
|
167
|
+
client=client,
|
168
|
+
body=body,
|
169
|
+
)
|
170
|
+
).parsed
|
@@ -0,0 +1,104 @@
|
|
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 AuthenticatedClient, Client
|
8
|
+
from ...types import Response
|
9
|
+
|
10
|
+
|
11
|
+
def _get_kwargs(
|
12
|
+
client_id: str,
|
13
|
+
api_key_id: str,
|
14
|
+
) -> dict[str, Any]:
|
15
|
+
_kwargs: dict[str, Any] = {
|
16
|
+
"method": "delete",
|
17
|
+
"url": f"/service_accounts/{client_id}/api_keys/{api_key_id}",
|
18
|
+
}
|
19
|
+
|
20
|
+
return _kwargs
|
21
|
+
|
22
|
+
|
23
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
24
|
+
if response.status_code == 200:
|
25
|
+
return None
|
26
|
+
if client.raise_on_unexpected_status:
|
27
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
28
|
+
else:
|
29
|
+
return None
|
30
|
+
|
31
|
+
|
32
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
33
|
+
return Response(
|
34
|
+
status_code=HTTPStatus(response.status_code),
|
35
|
+
content=response.content,
|
36
|
+
headers=response.headers,
|
37
|
+
parsed=_parse_response(client=client, response=response),
|
38
|
+
)
|
39
|
+
|
40
|
+
|
41
|
+
def sync_detailed(
|
42
|
+
client_id: str,
|
43
|
+
api_key_id: str,
|
44
|
+
*,
|
45
|
+
client: AuthenticatedClient,
|
46
|
+
) -> Response[Any]:
|
47
|
+
"""Delete API key for service account
|
48
|
+
|
49
|
+
Deletes an API key for a service account.
|
50
|
+
|
51
|
+
Args:
|
52
|
+
client_id (str):
|
53
|
+
api_key_id (str):
|
54
|
+
|
55
|
+
Raises:
|
56
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
57
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
58
|
+
|
59
|
+
Returns:
|
60
|
+
Response[Any]
|
61
|
+
"""
|
62
|
+
|
63
|
+
kwargs = _get_kwargs(
|
64
|
+
client_id=client_id,
|
65
|
+
api_key_id=api_key_id,
|
66
|
+
)
|
67
|
+
|
68
|
+
response = client.get_httpx_client().request(
|
69
|
+
**kwargs,
|
70
|
+
)
|
71
|
+
|
72
|
+
return _build_response(client=client, response=response)
|
73
|
+
|
74
|
+
|
75
|
+
async def asyncio_detailed(
|
76
|
+
client_id: str,
|
77
|
+
api_key_id: str,
|
78
|
+
*,
|
79
|
+
client: AuthenticatedClient,
|
80
|
+
) -> Response[Any]:
|
81
|
+
"""Delete API key for service account
|
82
|
+
|
83
|
+
Deletes an API key for a service account.
|
84
|
+
|
85
|
+
Args:
|
86
|
+
client_id (str):
|
87
|
+
api_key_id (str):
|
88
|
+
|
89
|
+
Raises:
|
90
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
91
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
92
|
+
|
93
|
+
Returns:
|
94
|
+
Response[Any]
|
95
|
+
"""
|
96
|
+
|
97
|
+
kwargs = _get_kwargs(
|
98
|
+
client_id=client_id,
|
99
|
+
api_key_id=api_key_id,
|
100
|
+
)
|
101
|
+
|
102
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
103
|
+
|
104
|
+
return _build_response(client=client, response=response)
|