gcore 0.16.0__py3-none-any.whl → 0.23.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.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_client.py +16 -0
- gcore/_models.py +37 -15
- gcore/_streaming.py +12 -12
- gcore/_utils/_sync.py +3 -31
- gcore/_utils/_utils.py +1 -1
- gcore/_version.py +1 -1
- gcore/resources/cdn/audit_log.py +4 -4
- gcore/resources/cdn/cdn.py +120 -21
- gcore/resources/cdn/ip_ranges.py +97 -5
- gcore/resources/cdn/{logs/logs.py → logs.py} +9 -9
- gcore/resources/cdn/resources/resources.py +20 -20
- gcore/resources/cdn/statistics.py +56 -58
- gcore/resources/cloud/__init__.py +40 -12
- gcore/resources/cloud/audit_logs.py +20 -0
- gcore/resources/cloud/baremetal/servers.py +48 -14
- gcore/resources/cloud/billing_reservations.py +2 -2
- gcore/resources/cloud/cloud.py +100 -18
- gcore/resources/cloud/databases/__init__.py +33 -0
- gcore/resources/cloud/databases/databases.py +102 -0
- gcore/resources/cloud/databases/postgres/__init__.py +61 -0
- gcore/resources/cloud/databases/postgres/clusters/__init__.py +33 -0
- gcore/resources/cloud/databases/postgres/clusters/clusters.py +716 -0
- gcore/resources/cloud/databases/postgres/clusters/user_credentials.py +281 -0
- gcore/resources/cloud/databases/postgres/configurations.py +169 -0
- gcore/resources/cloud/databases/postgres/custom_configurations.py +197 -0
- gcore/resources/cloud/databases/postgres/postgres.py +166 -0
- gcore/resources/cloud/file_shares/file_shares.py +154 -49
- gcore/resources/cloud/floating_ips.py +42 -10
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +70 -10
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +40 -6
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +16 -0
- gcore/resources/cloud/gpu_virtual_clusters/__init__.py +89 -0
- gcore/resources/cloud/gpu_virtual_clusters/flavors.py +211 -0
- gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py +1551 -0
- gcore/resources/cloud/gpu_virtual_clusters/images.py +582 -0
- gcore/resources/cloud/gpu_virtual_clusters/interfaces.py +187 -0
- gcore/resources/cloud/gpu_virtual_clusters/servers.py +506 -0
- gcore/resources/cloud/gpu_virtual_clusters/volumes.py +187 -0
- gcore/resources/cloud/inference/deployments/deployments.py +52 -4
- gcore/resources/cloud/instances/images.py +72 -18
- gcore/resources/cloud/instances/instances.py +110 -18
- gcore/resources/cloud/instances/interfaces.py +12 -0
- gcore/resources/cloud/k8s/__init__.py +12 -12
- gcore/resources/cloud/k8s/clusters/clusters.py +25 -25
- gcore/resources/cloud/k8s/clusters/pools/pools.py +14 -14
- gcore/resources/cloud/k8s/k8s.py +24 -24
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1420 -218
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +134 -22
- gcore/resources/cloud/load_balancers/listeners.py +77 -6
- gcore/resources/cloud/load_balancers/load_balancers.py +92 -14
- gcore/resources/cloud/load_balancers/pools/pools.py +52 -4
- gcore/resources/cloud/networks/networks.py +30 -10
- gcore/resources/cloud/networks/subnets.py +26 -10
- gcore/resources/cloud/placement_groups.py +8 -0
- gcore/resources/cloud/projects.py +99 -119
- gcore/resources/cloud/quotas/requests.py +0 -8
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +18 -0
- gcore/resources/cloud/secrets.py +16 -0
- gcore/resources/cloud/security_groups/security_groups.py +38 -12
- gcore/resources/cloud/ssh_keys.py +10 -0
- gcore/resources/cloud/tasks.py +22 -7
- gcore/resources/cloud/volumes.py +65 -23
- gcore/resources/dns/zones/rrsets.py +10 -10
- gcore/resources/dns/zones/zones.py +2 -2
- gcore/resources/security/bgp_announces.py +0 -4
- gcore/resources/security/profiles.py +31 -7
- gcore/resources/storage/credentials.py +0 -28
- gcore/resources/storage/storage.py +2 -2
- gcore/types/cdn/__init__.py +5 -0
- gcore/types/cdn/alibaba_regions.py +22 -0
- gcore/types/cdn/audit_log_list_params.py +2 -2
- gcore/types/cdn/aws_regions.py +22 -0
- gcore/types/cdn/cdn_list_purge_statuses_response.py +10 -0
- gcore/types/cdn/cdn_resource.py +17 -12
- gcore/types/cdn/ip_range_list_ips_params.py +19 -0
- gcore/types/cdn/ip_range_list_params.py +19 -0
- gcore/types/cdn/resource_create_params.py +17 -12
- gcore/types/cdn/resource_purge_params.py +4 -4
- gcore/types/cdn/resource_replace_params.py +17 -12
- gcore/types/cdn/resource_update_params.py +17 -12
- gcore/types/cdn/resource_usage_stats.py +16 -15
- gcore/types/cdn/resources/cdn_resource_rule.py +15 -10
- gcore/types/cdn/resources/rule_create_params.py +15 -10
- gcore/types/cdn/resources/rule_replace_params.py +15 -10
- gcore/types/cdn/resources/rule_update_params.py +15 -10
- gcore/types/cdn/rule_template.py +15 -10
- gcore/types/cdn/rule_template_create_params.py +15 -10
- gcore/types/cdn/rule_template_replace_params.py +15 -10
- gcore/types/cdn/rule_template_update_params.py +15 -10
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +4 -1
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +5 -12
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +10 -21
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +6 -1
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +5 -2
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +3 -0
- gcore/types/cloud/__init__.py +9 -3
- gcore/types/cloud/audit_log_entry.py +9 -3
- gcore/types/cloud/audit_log_list_params.py +12 -0
- gcore/types/cloud/baremetal/server_create_params.py +7 -7
- gcore/types/cloud/baremetal_flavor.py +0 -6
- gcore/types/cloud/billing_reservation_list_params.py +1 -1
- gcore/types/cloud/blackhole_port.py +4 -1
- gcore/types/cloud/databases/postgres/__init__.py +12 -0
- gcore/types/cloud/databases/postgres/cluster_create_params.py +108 -0
- gcore/types/cloud/databases/postgres/cluster_list_params.py +19 -0
- gcore/types/cloud/databases/postgres/cluster_update_params.py +102 -0
- gcore/types/cloud/databases/postgres/clusters/__init__.py +5 -0
- gcore/types/cloud/databases/postgres/clusters/postgres_user_credentials.py +13 -0
- gcore/types/cloud/databases/postgres/custom_configuration_validate_params.py +19 -0
- gcore/types/cloud/databases/postgres/pg_conf_validation.py +15 -0
- gcore/types/cloud/databases/postgres/postgres_cluster.py +118 -0
- gcore/types/cloud/databases/postgres/postgres_cluster_short.py +22 -0
- gcore/types/cloud/databases/postgres/postgres_configuration.py +31 -0
- gcore/types/cloud/file_share_create_params.py +8 -8
- gcore/types/cloud/file_share_update_params.py +7 -2
- gcore/types/cloud/floating_ip.py +5 -1
- gcore/types/cloud/floating_ip_create_params.py +4 -4
- gcore/types/cloud/floating_ip_detailed.py +5 -1
- gcore/types/cloud/floating_ip_list_params.py +8 -0
- gcore/types/cloud/floating_ip_update_params.py +7 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +18 -3
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +7 -2
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +16 -4
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +5 -2
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +4 -4
- gcore/types/cloud/gpu_image.py +9 -0
- gcore/types/cloud/gpu_virtual_cluster.py +189 -0
- gcore/types/cloud/gpu_virtual_cluster_action_params.py +127 -0
- gcore/types/cloud/gpu_virtual_cluster_create_params.py +213 -0
- gcore/types/cloud/gpu_virtual_cluster_delete_params.py +41 -0
- gcore/types/cloud/gpu_virtual_cluster_list_params.py +21 -0
- gcore/types/cloud/gpu_virtual_cluster_update_params.py +18 -0
- gcore/types/cloud/gpu_virtual_clusters/__init__.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py +21 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py +77 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py +64 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py +155 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py +190 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py +56 -0
- gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py +44 -0
- gcore/types/cloud/gpu_virtual_clusters/server_list_params.py +75 -0
- gcore/types/cloud/image.py +9 -0
- gcore/types/cloud/inference/deployment_create_params.py +1 -1
- gcore/types/cloud/inference/deployment_update_params.py +1 -1
- gcore/types/cloud/inference/inference_deployment.py +1 -1
- gcore/types/cloud/instance_create_params.py +27 -27
- gcore/types/cloud/instance_update_params.py +7 -2
- gcore/types/cloud/instances/image_create_from_volume_params.py +4 -4
- gcore/types/cloud/instances/image_update_params.py +4 -4
- gcore/types/cloud/instances/image_upload_params.py +4 -4
- gcore/types/cloud/k8s/__init__.py +4 -4
- gcore/types/cloud/k8s/cluster_update_params.py +5 -5
- gcore/types/cloud/k8s/clusters/__init__.py +2 -2
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +2 -2
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +4 -4
- gcore/types/cloud/k8s/k8s_cluster.py +4 -4
- gcore/types/cloud/k8s/k8s_cluster_certificate.py +2 -2
- gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +14 -2
- gcore/types/cloud/k8s/k8s_cluster_list.py +4 -4
- gcore/types/cloud/k8s_cluster_version.py +2 -2
- gcore/types/cloud/k8s_cluster_version_list.py +4 -4
- gcore/types/cloud/load_balancer_create_params.py +14 -8
- gcore/types/cloud/load_balancer_flavor_detail.py +2 -2
- gcore/types/cloud/load_balancer_l7_policy.py +29 -16
- gcore/types/cloud/load_balancer_l7_policy_list.py +3 -3
- gcore/types/cloud/load_balancer_l7_rule.py +14 -23
- gcore/types/cloud/load_balancer_l7_rule_list.py +3 -3
- gcore/types/cloud/load_balancer_listener_detail.py +2 -2
- gcore/types/cloud/load_balancer_update_params.py +7 -2
- gcore/types/cloud/load_balancers/__init__.py +1 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +5 -10
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +7 -11
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +102 -18
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +94 -16
- gcore/types/cloud/load_balancers/listener_create_params.py +4 -1
- gcore/types/cloud/load_balancers/listener_delete_params.py +18 -0
- gcore/types/cloud/load_balancers/listener_update_params.py +4 -1
- gcore/types/cloud/load_balancers/pool_create_params.py +1 -1
- gcore/types/cloud/network_create_params.py +4 -4
- gcore/types/cloud/network_update_params.py +7 -2
- gcore/types/cloud/networks/subnet_create_params.py +4 -4
- gcore/types/cloud/networks/subnet_update_params.py +7 -2
- gcore/types/cloud/project_create_params.py +0 -6
- gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
- gcore/types/cloud/quotas/request_create_params.py +0 -3
- gcore/types/cloud/region.py +3 -3
- gcore/types/cloud/security_group.py +8 -1
- gcore/types/cloud/security_group_create_params.py +7 -5
- gcore/types/cloud/security_group_list_params.py +6 -4
- gcore/types/cloud/security_group_update_params.py +7 -2
- gcore/types/cloud/ssh_key_list_params.py +7 -0
- gcore/types/cloud/tag.py +2 -2
- gcore/types/cloud/task_id_list.py +3 -3
- gcore/types/cloud/volume_create_params.py +12 -12
- gcore/types/cloud/volume_update_params.py +7 -2
- gcore/types/dns/zone_list_params.py +1 -1
- gcore/types/iam/api_token_create.py +70 -1
- gcore/types/security/bgp_announce_list_params.py +0 -2
- gcore/types/security/client_profile.py +1 -0
- gcore/types/security/profile_create_params.py +4 -2
- gcore/types/security/profile_recreate_params.py +4 -2
- gcore/types/security/profile_replace_params.py +4 -2
- gcore/types/storage/credential_recreate_params.py +0 -17
- gcore/types/storage/storage.py +1 -1
- gcore/types/storage/storage_create_params.py +1 -1
- gcore/types/streaming/stream.py +3 -2
- gcore/types/streaming/video.py +1 -1
- gcore/types/waap/domains/custom_rule_create_params.py +1 -1
- gcore/types/waap/domains/custom_rule_update_params.py +1 -1
- gcore/types/waap/domains/waap_custom_rule.py +1 -1
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/METADATA +14 -14
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/RECORD +219 -168
- gcore/resources/cdn/logs/__init__.py +0 -19
- /gcore/types/{cdn/logs → cloud/databases}/__init__.py +0 -0
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/WHEEL +0 -0
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...._types import Body, Query, Headers, NotGiven, not_given
|
|
8
|
+
from ...._compat import cached_property
|
|
9
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
10
|
+
from ...._response import (
|
|
11
|
+
to_raw_response_wrapper,
|
|
12
|
+
to_streamed_response_wrapper,
|
|
13
|
+
async_to_raw_response_wrapper,
|
|
14
|
+
async_to_streamed_response_wrapper,
|
|
15
|
+
)
|
|
16
|
+
from ...._base_client import make_request_options
|
|
17
|
+
from ....types.cloud.gpu_virtual_clusters.gpu_virtual_interface_list import GPUVirtualInterfaceList
|
|
18
|
+
|
|
19
|
+
__all__ = ["InterfacesResource", "AsyncInterfacesResource"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class InterfacesResource(SyncAPIResource):
|
|
23
|
+
@cached_property
|
|
24
|
+
def with_raw_response(self) -> InterfacesResourceWithRawResponse:
|
|
25
|
+
"""
|
|
26
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
27
|
+
the raw response object instead of the parsed content.
|
|
28
|
+
|
|
29
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
30
|
+
"""
|
|
31
|
+
return InterfacesResourceWithRawResponse(self)
|
|
32
|
+
|
|
33
|
+
@cached_property
|
|
34
|
+
def with_streaming_response(self) -> InterfacesResourceWithStreamingResponse:
|
|
35
|
+
"""
|
|
36
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
37
|
+
|
|
38
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
39
|
+
"""
|
|
40
|
+
return InterfacesResourceWithStreamingResponse(self)
|
|
41
|
+
|
|
42
|
+
def list(
|
|
43
|
+
self,
|
|
44
|
+
cluster_id: str,
|
|
45
|
+
*,
|
|
46
|
+
project_id: int | None = None,
|
|
47
|
+
region_id: int | None = None,
|
|
48
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
49
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
50
|
+
extra_headers: Headers | None = None,
|
|
51
|
+
extra_query: Query | None = None,
|
|
52
|
+
extra_body: Body | None = None,
|
|
53
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
54
|
+
) -> GPUVirtualInterfaceList:
|
|
55
|
+
"""
|
|
56
|
+
List all network interfaces for servers in a virtual GPU cluster.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
project_id: Project ID
|
|
60
|
+
|
|
61
|
+
region_id: Region ID
|
|
62
|
+
|
|
63
|
+
cluster_id: Cluster unique identifier
|
|
64
|
+
|
|
65
|
+
extra_headers: Send extra headers
|
|
66
|
+
|
|
67
|
+
extra_query: Add additional query parameters to the request
|
|
68
|
+
|
|
69
|
+
extra_body: Add additional JSON properties to the request
|
|
70
|
+
|
|
71
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
72
|
+
"""
|
|
73
|
+
if project_id is None:
|
|
74
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
75
|
+
if region_id is None:
|
|
76
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
77
|
+
if not cluster_id:
|
|
78
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
79
|
+
return self._get(
|
|
80
|
+
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/interfaces",
|
|
81
|
+
options=make_request_options(
|
|
82
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
83
|
+
),
|
|
84
|
+
cast_to=GPUVirtualInterfaceList,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class AsyncInterfacesResource(AsyncAPIResource):
|
|
89
|
+
@cached_property
|
|
90
|
+
def with_raw_response(self) -> AsyncInterfacesResourceWithRawResponse:
|
|
91
|
+
"""
|
|
92
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
93
|
+
the raw response object instead of the parsed content.
|
|
94
|
+
|
|
95
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
96
|
+
"""
|
|
97
|
+
return AsyncInterfacesResourceWithRawResponse(self)
|
|
98
|
+
|
|
99
|
+
@cached_property
|
|
100
|
+
def with_streaming_response(self) -> AsyncInterfacesResourceWithStreamingResponse:
|
|
101
|
+
"""
|
|
102
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
103
|
+
|
|
104
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
105
|
+
"""
|
|
106
|
+
return AsyncInterfacesResourceWithStreamingResponse(self)
|
|
107
|
+
|
|
108
|
+
async def list(
|
|
109
|
+
self,
|
|
110
|
+
cluster_id: str,
|
|
111
|
+
*,
|
|
112
|
+
project_id: int | None = None,
|
|
113
|
+
region_id: int | None = None,
|
|
114
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
115
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
116
|
+
extra_headers: Headers | None = None,
|
|
117
|
+
extra_query: Query | None = None,
|
|
118
|
+
extra_body: Body | None = None,
|
|
119
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
120
|
+
) -> GPUVirtualInterfaceList:
|
|
121
|
+
"""
|
|
122
|
+
List all network interfaces for servers in a virtual GPU cluster.
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
project_id: Project ID
|
|
126
|
+
|
|
127
|
+
region_id: Region ID
|
|
128
|
+
|
|
129
|
+
cluster_id: Cluster unique identifier
|
|
130
|
+
|
|
131
|
+
extra_headers: Send extra headers
|
|
132
|
+
|
|
133
|
+
extra_query: Add additional query parameters to the request
|
|
134
|
+
|
|
135
|
+
extra_body: Add additional JSON properties to the request
|
|
136
|
+
|
|
137
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
138
|
+
"""
|
|
139
|
+
if project_id is None:
|
|
140
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
141
|
+
if region_id is None:
|
|
142
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
143
|
+
if not cluster_id:
|
|
144
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
145
|
+
return await self._get(
|
|
146
|
+
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/interfaces",
|
|
147
|
+
options=make_request_options(
|
|
148
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
149
|
+
),
|
|
150
|
+
cast_to=GPUVirtualInterfaceList,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class InterfacesResourceWithRawResponse:
|
|
155
|
+
def __init__(self, interfaces: InterfacesResource) -> None:
|
|
156
|
+
self._interfaces = interfaces
|
|
157
|
+
|
|
158
|
+
self.list = to_raw_response_wrapper(
|
|
159
|
+
interfaces.list,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class AsyncInterfacesResourceWithRawResponse:
|
|
164
|
+
def __init__(self, interfaces: AsyncInterfacesResource) -> None:
|
|
165
|
+
self._interfaces = interfaces
|
|
166
|
+
|
|
167
|
+
self.list = async_to_raw_response_wrapper(
|
|
168
|
+
interfaces.list,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class InterfacesResourceWithStreamingResponse:
|
|
173
|
+
def __init__(self, interfaces: InterfacesResource) -> None:
|
|
174
|
+
self._interfaces = interfaces
|
|
175
|
+
|
|
176
|
+
self.list = to_streamed_response_wrapper(
|
|
177
|
+
interfaces.list,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class AsyncInterfacesResourceWithStreamingResponse:
|
|
182
|
+
def __init__(self, interfaces: AsyncInterfacesResource) -> None:
|
|
183
|
+
self._interfaces = interfaces
|
|
184
|
+
|
|
185
|
+
self.list = async_to_streamed_response_wrapper(
|
|
186
|
+
interfaces.list,
|
|
187
|
+
)
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Union
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
12
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
13
|
+
from ...._compat import cached_property
|
|
14
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from ...._response import (
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
21
|
+
from ...._base_client import make_request_options
|
|
22
|
+
from ....types.cloud.task_id_list import TaskIDList
|
|
23
|
+
from ....types.cloud.gpu_virtual_clusters import server_list_params, server_delete_params
|
|
24
|
+
from ....types.cloud.gpu_virtual_clusters.gpu_virtual_cluster_server_list import GPUVirtualClusterServerList
|
|
25
|
+
|
|
26
|
+
__all__ = ["ServersResource", "AsyncServersResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ServersResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> ServersResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return ServersResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> ServersResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return ServersResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def list(
|
|
50
|
+
self,
|
|
51
|
+
cluster_id: str,
|
|
52
|
+
*,
|
|
53
|
+
project_id: int | None = None,
|
|
54
|
+
region_id: int | None = None,
|
|
55
|
+
changed_before: Union[str, datetime] | Omit = omit,
|
|
56
|
+
changed_since: Union[str, datetime] | Omit = omit,
|
|
57
|
+
ip_address: str | Omit = omit,
|
|
58
|
+
limit: int | Omit = omit,
|
|
59
|
+
name: str | Omit = omit,
|
|
60
|
+
offset: int | Omit = omit,
|
|
61
|
+
order_by: Literal["created_at.asc", "created_at.desc", "status.asc", "status.desc"] | Omit = omit,
|
|
62
|
+
status: Literal[
|
|
63
|
+
"ACTIVE",
|
|
64
|
+
"BUILD",
|
|
65
|
+
"ERROR",
|
|
66
|
+
"HARD_REBOOT",
|
|
67
|
+
"MIGRATING",
|
|
68
|
+
"PAUSED",
|
|
69
|
+
"REBOOT",
|
|
70
|
+
"REBUILD",
|
|
71
|
+
"RESIZE",
|
|
72
|
+
"REVERT_RESIZE",
|
|
73
|
+
"SHELVED",
|
|
74
|
+
"SHELVED_OFFLOADED",
|
|
75
|
+
"SHUTOFF",
|
|
76
|
+
"SOFT_DELETED",
|
|
77
|
+
"SUSPENDED",
|
|
78
|
+
"VERIFY_RESIZE",
|
|
79
|
+
]
|
|
80
|
+
| Omit = omit,
|
|
81
|
+
uuids: SequenceNotStr[str] | Omit = omit,
|
|
82
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
83
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
84
|
+
extra_headers: Headers | None = None,
|
|
85
|
+
extra_query: Query | None = None,
|
|
86
|
+
extra_body: Body | None = None,
|
|
87
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
88
|
+
) -> GPUVirtualClusterServerList:
|
|
89
|
+
"""
|
|
90
|
+
List all servers in a virtual GPU cluster.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
project_id: Project ID
|
|
94
|
+
|
|
95
|
+
region_id: Region ID
|
|
96
|
+
|
|
97
|
+
cluster_id: Cluster unique identifier
|
|
98
|
+
|
|
99
|
+
changed_before: Filters the results to include only servers whose last change timestamp is less
|
|
100
|
+
than the specified datetime. Format: ISO 8601.
|
|
101
|
+
|
|
102
|
+
changed_since: Filters the results to include only servers whose last change timestamp is
|
|
103
|
+
greater than or equal to the specified datetime. Format: ISO 8601.
|
|
104
|
+
|
|
105
|
+
ip_address: Filter servers by ip address.
|
|
106
|
+
|
|
107
|
+
limit: Limit of items on a single page
|
|
108
|
+
|
|
109
|
+
name: Filter servers by name. You can provide a full or partial name, servers with
|
|
110
|
+
matching names will be returned. For example, entering 'test' will return all
|
|
111
|
+
servers that contain 'test' in their name.
|
|
112
|
+
|
|
113
|
+
offset: Offset in results list
|
|
114
|
+
|
|
115
|
+
order_by: Order field
|
|
116
|
+
|
|
117
|
+
status: Filters servers by status.
|
|
118
|
+
|
|
119
|
+
uuids: Filter servers by uuid.
|
|
120
|
+
|
|
121
|
+
extra_headers: Send extra headers
|
|
122
|
+
|
|
123
|
+
extra_query: Add additional query parameters to the request
|
|
124
|
+
|
|
125
|
+
extra_body: Add additional JSON properties to the request
|
|
126
|
+
|
|
127
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
128
|
+
"""
|
|
129
|
+
if project_id is None:
|
|
130
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
131
|
+
if region_id is None:
|
|
132
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
133
|
+
if not cluster_id:
|
|
134
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
135
|
+
return self._get(
|
|
136
|
+
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/servers",
|
|
137
|
+
options=make_request_options(
|
|
138
|
+
extra_headers=extra_headers,
|
|
139
|
+
extra_query=extra_query,
|
|
140
|
+
extra_body=extra_body,
|
|
141
|
+
timeout=timeout,
|
|
142
|
+
query=maybe_transform(
|
|
143
|
+
{
|
|
144
|
+
"changed_before": changed_before,
|
|
145
|
+
"changed_since": changed_since,
|
|
146
|
+
"ip_address": ip_address,
|
|
147
|
+
"limit": limit,
|
|
148
|
+
"name": name,
|
|
149
|
+
"offset": offset,
|
|
150
|
+
"order_by": order_by,
|
|
151
|
+
"status": status,
|
|
152
|
+
"uuids": uuids,
|
|
153
|
+
},
|
|
154
|
+
server_list_params.ServerListParams,
|
|
155
|
+
),
|
|
156
|
+
),
|
|
157
|
+
cast_to=GPUVirtualClusterServerList,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
def delete(
|
|
161
|
+
self,
|
|
162
|
+
server_id: str,
|
|
163
|
+
*,
|
|
164
|
+
project_id: int | None = None,
|
|
165
|
+
region_id: int | None = None,
|
|
166
|
+
cluster_id: str,
|
|
167
|
+
all_floating_ips: bool | Omit = omit,
|
|
168
|
+
all_reserved_fixed_ips: bool | Omit = omit,
|
|
169
|
+
all_volumes: bool | Omit = omit,
|
|
170
|
+
floating_ip_ids: SequenceNotStr[str] | Omit = omit,
|
|
171
|
+
reserved_fixed_ip_ids: SequenceNotStr[str] | Omit = omit,
|
|
172
|
+
volume_ids: SequenceNotStr[str] | Omit = omit,
|
|
173
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
174
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
175
|
+
extra_headers: Headers | None = None,
|
|
176
|
+
extra_query: Query | None = None,
|
|
177
|
+
extra_body: Body | None = None,
|
|
178
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
179
|
+
) -> TaskIDList:
|
|
180
|
+
"""
|
|
181
|
+
Delete a server from a virtual GPU cluster and its associated resources.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
project_id: Project ID
|
|
185
|
+
|
|
186
|
+
region_id: Region ID
|
|
187
|
+
|
|
188
|
+
cluster_id: Cluster unique identifier
|
|
189
|
+
|
|
190
|
+
server_id: Server unique identifier
|
|
191
|
+
|
|
192
|
+
all_floating_ips: Flag indicating whether the floating ips associated with server / cluster are
|
|
193
|
+
deleted
|
|
194
|
+
|
|
195
|
+
all_reserved_fixed_ips: Flag indicating whether the reserved fixed ips associated with server / cluster
|
|
196
|
+
are deleted
|
|
197
|
+
|
|
198
|
+
all_volumes: Flag indicating whether all attached volumes are deleted
|
|
199
|
+
|
|
200
|
+
floating_ip_ids: Optional list of floating ips to be deleted
|
|
201
|
+
|
|
202
|
+
reserved_fixed_ip_ids: Optional list of reserved fixed ips to be deleted
|
|
203
|
+
|
|
204
|
+
volume_ids: Optional list of volumes to be deleted
|
|
205
|
+
|
|
206
|
+
extra_headers: Send extra headers
|
|
207
|
+
|
|
208
|
+
extra_query: Add additional query parameters to the request
|
|
209
|
+
|
|
210
|
+
extra_body: Add additional JSON properties to the request
|
|
211
|
+
|
|
212
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
213
|
+
"""
|
|
214
|
+
if project_id is None:
|
|
215
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
216
|
+
if region_id is None:
|
|
217
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
218
|
+
if not cluster_id:
|
|
219
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
220
|
+
if not server_id:
|
|
221
|
+
raise ValueError(f"Expected a non-empty value for `server_id` but received {server_id!r}")
|
|
222
|
+
return self._delete(
|
|
223
|
+
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/servers/{server_id}",
|
|
224
|
+
options=make_request_options(
|
|
225
|
+
extra_headers=extra_headers,
|
|
226
|
+
extra_query=extra_query,
|
|
227
|
+
extra_body=extra_body,
|
|
228
|
+
timeout=timeout,
|
|
229
|
+
query=maybe_transform(
|
|
230
|
+
{
|
|
231
|
+
"all_floating_ips": all_floating_ips,
|
|
232
|
+
"all_reserved_fixed_ips": all_reserved_fixed_ips,
|
|
233
|
+
"all_volumes": all_volumes,
|
|
234
|
+
"floating_ip_ids": floating_ip_ids,
|
|
235
|
+
"reserved_fixed_ip_ids": reserved_fixed_ip_ids,
|
|
236
|
+
"volume_ids": volume_ids,
|
|
237
|
+
},
|
|
238
|
+
server_delete_params.ServerDeleteParams,
|
|
239
|
+
),
|
|
240
|
+
),
|
|
241
|
+
cast_to=TaskIDList,
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
class AsyncServersResource(AsyncAPIResource):
|
|
246
|
+
@cached_property
|
|
247
|
+
def with_raw_response(self) -> AsyncServersResourceWithRawResponse:
|
|
248
|
+
"""
|
|
249
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
250
|
+
the raw response object instead of the parsed content.
|
|
251
|
+
|
|
252
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
253
|
+
"""
|
|
254
|
+
return AsyncServersResourceWithRawResponse(self)
|
|
255
|
+
|
|
256
|
+
@cached_property
|
|
257
|
+
def with_streaming_response(self) -> AsyncServersResourceWithStreamingResponse:
|
|
258
|
+
"""
|
|
259
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
260
|
+
|
|
261
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
262
|
+
"""
|
|
263
|
+
return AsyncServersResourceWithStreamingResponse(self)
|
|
264
|
+
|
|
265
|
+
async def list(
|
|
266
|
+
self,
|
|
267
|
+
cluster_id: str,
|
|
268
|
+
*,
|
|
269
|
+
project_id: int | None = None,
|
|
270
|
+
region_id: int | None = None,
|
|
271
|
+
changed_before: Union[str, datetime] | Omit = omit,
|
|
272
|
+
changed_since: Union[str, datetime] | Omit = omit,
|
|
273
|
+
ip_address: str | Omit = omit,
|
|
274
|
+
limit: int | Omit = omit,
|
|
275
|
+
name: str | Omit = omit,
|
|
276
|
+
offset: int | Omit = omit,
|
|
277
|
+
order_by: Literal["created_at.asc", "created_at.desc", "status.asc", "status.desc"] | Omit = omit,
|
|
278
|
+
status: Literal[
|
|
279
|
+
"ACTIVE",
|
|
280
|
+
"BUILD",
|
|
281
|
+
"ERROR",
|
|
282
|
+
"HARD_REBOOT",
|
|
283
|
+
"MIGRATING",
|
|
284
|
+
"PAUSED",
|
|
285
|
+
"REBOOT",
|
|
286
|
+
"REBUILD",
|
|
287
|
+
"RESIZE",
|
|
288
|
+
"REVERT_RESIZE",
|
|
289
|
+
"SHELVED",
|
|
290
|
+
"SHELVED_OFFLOADED",
|
|
291
|
+
"SHUTOFF",
|
|
292
|
+
"SOFT_DELETED",
|
|
293
|
+
"SUSPENDED",
|
|
294
|
+
"VERIFY_RESIZE",
|
|
295
|
+
]
|
|
296
|
+
| Omit = omit,
|
|
297
|
+
uuids: SequenceNotStr[str] | Omit = omit,
|
|
298
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
299
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
300
|
+
extra_headers: Headers | None = None,
|
|
301
|
+
extra_query: Query | None = None,
|
|
302
|
+
extra_body: Body | None = None,
|
|
303
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
304
|
+
) -> GPUVirtualClusterServerList:
|
|
305
|
+
"""
|
|
306
|
+
List all servers in a virtual GPU cluster.
|
|
307
|
+
|
|
308
|
+
Args:
|
|
309
|
+
project_id: Project ID
|
|
310
|
+
|
|
311
|
+
region_id: Region ID
|
|
312
|
+
|
|
313
|
+
cluster_id: Cluster unique identifier
|
|
314
|
+
|
|
315
|
+
changed_before: Filters the results to include only servers whose last change timestamp is less
|
|
316
|
+
than the specified datetime. Format: ISO 8601.
|
|
317
|
+
|
|
318
|
+
changed_since: Filters the results to include only servers whose last change timestamp is
|
|
319
|
+
greater than or equal to the specified datetime. Format: ISO 8601.
|
|
320
|
+
|
|
321
|
+
ip_address: Filter servers by ip address.
|
|
322
|
+
|
|
323
|
+
limit: Limit of items on a single page
|
|
324
|
+
|
|
325
|
+
name: Filter servers by name. You can provide a full or partial name, servers with
|
|
326
|
+
matching names will be returned. For example, entering 'test' will return all
|
|
327
|
+
servers that contain 'test' in their name.
|
|
328
|
+
|
|
329
|
+
offset: Offset in results list
|
|
330
|
+
|
|
331
|
+
order_by: Order field
|
|
332
|
+
|
|
333
|
+
status: Filters servers by status.
|
|
334
|
+
|
|
335
|
+
uuids: Filter servers by uuid.
|
|
336
|
+
|
|
337
|
+
extra_headers: Send extra headers
|
|
338
|
+
|
|
339
|
+
extra_query: Add additional query parameters to the request
|
|
340
|
+
|
|
341
|
+
extra_body: Add additional JSON properties to the request
|
|
342
|
+
|
|
343
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
344
|
+
"""
|
|
345
|
+
if project_id is None:
|
|
346
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
347
|
+
if region_id is None:
|
|
348
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
349
|
+
if not cluster_id:
|
|
350
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
351
|
+
return await self._get(
|
|
352
|
+
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/servers",
|
|
353
|
+
options=make_request_options(
|
|
354
|
+
extra_headers=extra_headers,
|
|
355
|
+
extra_query=extra_query,
|
|
356
|
+
extra_body=extra_body,
|
|
357
|
+
timeout=timeout,
|
|
358
|
+
query=await async_maybe_transform(
|
|
359
|
+
{
|
|
360
|
+
"changed_before": changed_before,
|
|
361
|
+
"changed_since": changed_since,
|
|
362
|
+
"ip_address": ip_address,
|
|
363
|
+
"limit": limit,
|
|
364
|
+
"name": name,
|
|
365
|
+
"offset": offset,
|
|
366
|
+
"order_by": order_by,
|
|
367
|
+
"status": status,
|
|
368
|
+
"uuids": uuids,
|
|
369
|
+
},
|
|
370
|
+
server_list_params.ServerListParams,
|
|
371
|
+
),
|
|
372
|
+
),
|
|
373
|
+
cast_to=GPUVirtualClusterServerList,
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
async def delete(
|
|
377
|
+
self,
|
|
378
|
+
server_id: str,
|
|
379
|
+
*,
|
|
380
|
+
project_id: int | None = None,
|
|
381
|
+
region_id: int | None = None,
|
|
382
|
+
cluster_id: str,
|
|
383
|
+
all_floating_ips: bool | Omit = omit,
|
|
384
|
+
all_reserved_fixed_ips: bool | Omit = omit,
|
|
385
|
+
all_volumes: bool | Omit = omit,
|
|
386
|
+
floating_ip_ids: SequenceNotStr[str] | Omit = omit,
|
|
387
|
+
reserved_fixed_ip_ids: SequenceNotStr[str] | Omit = omit,
|
|
388
|
+
volume_ids: SequenceNotStr[str] | Omit = omit,
|
|
389
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
390
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
391
|
+
extra_headers: Headers | None = None,
|
|
392
|
+
extra_query: Query | None = None,
|
|
393
|
+
extra_body: Body | None = None,
|
|
394
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
395
|
+
) -> TaskIDList:
|
|
396
|
+
"""
|
|
397
|
+
Delete a server from a virtual GPU cluster and its associated resources.
|
|
398
|
+
|
|
399
|
+
Args:
|
|
400
|
+
project_id: Project ID
|
|
401
|
+
|
|
402
|
+
region_id: Region ID
|
|
403
|
+
|
|
404
|
+
cluster_id: Cluster unique identifier
|
|
405
|
+
|
|
406
|
+
server_id: Server unique identifier
|
|
407
|
+
|
|
408
|
+
all_floating_ips: Flag indicating whether the floating ips associated with server / cluster are
|
|
409
|
+
deleted
|
|
410
|
+
|
|
411
|
+
all_reserved_fixed_ips: Flag indicating whether the reserved fixed ips associated with server / cluster
|
|
412
|
+
are deleted
|
|
413
|
+
|
|
414
|
+
all_volumes: Flag indicating whether all attached volumes are deleted
|
|
415
|
+
|
|
416
|
+
floating_ip_ids: Optional list of floating ips to be deleted
|
|
417
|
+
|
|
418
|
+
reserved_fixed_ip_ids: Optional list of reserved fixed ips to be deleted
|
|
419
|
+
|
|
420
|
+
volume_ids: Optional list of volumes to be deleted
|
|
421
|
+
|
|
422
|
+
extra_headers: Send extra headers
|
|
423
|
+
|
|
424
|
+
extra_query: Add additional query parameters to the request
|
|
425
|
+
|
|
426
|
+
extra_body: Add additional JSON properties to the request
|
|
427
|
+
|
|
428
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
429
|
+
"""
|
|
430
|
+
if project_id is None:
|
|
431
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
432
|
+
if region_id is None:
|
|
433
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
434
|
+
if not cluster_id:
|
|
435
|
+
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
|
|
436
|
+
if not server_id:
|
|
437
|
+
raise ValueError(f"Expected a non-empty value for `server_id` but received {server_id!r}")
|
|
438
|
+
return await self._delete(
|
|
439
|
+
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/servers/{server_id}",
|
|
440
|
+
options=make_request_options(
|
|
441
|
+
extra_headers=extra_headers,
|
|
442
|
+
extra_query=extra_query,
|
|
443
|
+
extra_body=extra_body,
|
|
444
|
+
timeout=timeout,
|
|
445
|
+
query=await async_maybe_transform(
|
|
446
|
+
{
|
|
447
|
+
"all_floating_ips": all_floating_ips,
|
|
448
|
+
"all_reserved_fixed_ips": all_reserved_fixed_ips,
|
|
449
|
+
"all_volumes": all_volumes,
|
|
450
|
+
"floating_ip_ids": floating_ip_ids,
|
|
451
|
+
"reserved_fixed_ip_ids": reserved_fixed_ip_ids,
|
|
452
|
+
"volume_ids": volume_ids,
|
|
453
|
+
},
|
|
454
|
+
server_delete_params.ServerDeleteParams,
|
|
455
|
+
),
|
|
456
|
+
),
|
|
457
|
+
cast_to=TaskIDList,
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
class ServersResourceWithRawResponse:
|
|
462
|
+
def __init__(self, servers: ServersResource) -> None:
|
|
463
|
+
self._servers = servers
|
|
464
|
+
|
|
465
|
+
self.list = to_raw_response_wrapper(
|
|
466
|
+
servers.list,
|
|
467
|
+
)
|
|
468
|
+
self.delete = to_raw_response_wrapper(
|
|
469
|
+
servers.delete,
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
class AsyncServersResourceWithRawResponse:
|
|
474
|
+
def __init__(self, servers: AsyncServersResource) -> None:
|
|
475
|
+
self._servers = servers
|
|
476
|
+
|
|
477
|
+
self.list = async_to_raw_response_wrapper(
|
|
478
|
+
servers.list,
|
|
479
|
+
)
|
|
480
|
+
self.delete = async_to_raw_response_wrapper(
|
|
481
|
+
servers.delete,
|
|
482
|
+
)
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
class ServersResourceWithStreamingResponse:
|
|
486
|
+
def __init__(self, servers: ServersResource) -> None:
|
|
487
|
+
self._servers = servers
|
|
488
|
+
|
|
489
|
+
self.list = to_streamed_response_wrapper(
|
|
490
|
+
servers.list,
|
|
491
|
+
)
|
|
492
|
+
self.delete = to_streamed_response_wrapper(
|
|
493
|
+
servers.delete,
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
class AsyncServersResourceWithStreamingResponse:
|
|
498
|
+
def __init__(self, servers: AsyncServersResource) -> None:
|
|
499
|
+
self._servers = servers
|
|
500
|
+
|
|
501
|
+
self.list = async_to_streamed_response_wrapper(
|
|
502
|
+
servers.list,
|
|
503
|
+
)
|
|
504
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
505
|
+
servers.delete,
|
|
506
|
+
)
|