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.

Files changed (220) hide show
  1. gcore/_client.py +16 -0
  2. gcore/_models.py +37 -15
  3. gcore/_streaming.py +12 -12
  4. gcore/_utils/_sync.py +3 -31
  5. gcore/_utils/_utils.py +1 -1
  6. gcore/_version.py +1 -1
  7. gcore/resources/cdn/audit_log.py +4 -4
  8. gcore/resources/cdn/cdn.py +120 -21
  9. gcore/resources/cdn/ip_ranges.py +97 -5
  10. gcore/resources/cdn/{logs/logs.py → logs.py} +9 -9
  11. gcore/resources/cdn/resources/resources.py +20 -20
  12. gcore/resources/cdn/statistics.py +56 -58
  13. gcore/resources/cloud/__init__.py +40 -12
  14. gcore/resources/cloud/audit_logs.py +20 -0
  15. gcore/resources/cloud/baremetal/servers.py +48 -14
  16. gcore/resources/cloud/billing_reservations.py +2 -2
  17. gcore/resources/cloud/cloud.py +100 -18
  18. gcore/resources/cloud/databases/__init__.py +33 -0
  19. gcore/resources/cloud/databases/databases.py +102 -0
  20. gcore/resources/cloud/databases/postgres/__init__.py +61 -0
  21. gcore/resources/cloud/databases/postgres/clusters/__init__.py +33 -0
  22. gcore/resources/cloud/databases/postgres/clusters/clusters.py +716 -0
  23. gcore/resources/cloud/databases/postgres/clusters/user_credentials.py +281 -0
  24. gcore/resources/cloud/databases/postgres/configurations.py +169 -0
  25. gcore/resources/cloud/databases/postgres/custom_configurations.py +197 -0
  26. gcore/resources/cloud/databases/postgres/postgres.py +166 -0
  27. gcore/resources/cloud/file_shares/file_shares.py +154 -49
  28. gcore/resources/cloud/floating_ips.py +42 -10
  29. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +70 -10
  30. gcore/resources/cloud/gpu_baremetal_clusters/images.py +40 -6
  31. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +16 -0
  32. gcore/resources/cloud/gpu_virtual_clusters/__init__.py +89 -0
  33. gcore/resources/cloud/gpu_virtual_clusters/flavors.py +211 -0
  34. gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py +1551 -0
  35. gcore/resources/cloud/gpu_virtual_clusters/images.py +582 -0
  36. gcore/resources/cloud/gpu_virtual_clusters/interfaces.py +187 -0
  37. gcore/resources/cloud/gpu_virtual_clusters/servers.py +506 -0
  38. gcore/resources/cloud/gpu_virtual_clusters/volumes.py +187 -0
  39. gcore/resources/cloud/inference/deployments/deployments.py +52 -4
  40. gcore/resources/cloud/instances/images.py +72 -18
  41. gcore/resources/cloud/instances/instances.py +110 -18
  42. gcore/resources/cloud/instances/interfaces.py +12 -0
  43. gcore/resources/cloud/k8s/__init__.py +12 -12
  44. gcore/resources/cloud/k8s/clusters/clusters.py +25 -25
  45. gcore/resources/cloud/k8s/clusters/pools/pools.py +14 -14
  46. gcore/resources/cloud/k8s/k8s.py +24 -24
  47. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1420 -218
  48. gcore/resources/cloud/load_balancers/l7_policies/rules.py +134 -22
  49. gcore/resources/cloud/load_balancers/listeners.py +77 -6
  50. gcore/resources/cloud/load_balancers/load_balancers.py +92 -14
  51. gcore/resources/cloud/load_balancers/pools/pools.py +52 -4
  52. gcore/resources/cloud/networks/networks.py +30 -10
  53. gcore/resources/cloud/networks/subnets.py +26 -10
  54. gcore/resources/cloud/placement_groups.py +8 -0
  55. gcore/resources/cloud/projects.py +99 -119
  56. gcore/resources/cloud/quotas/requests.py +0 -8
  57. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +18 -0
  58. gcore/resources/cloud/secrets.py +16 -0
  59. gcore/resources/cloud/security_groups/security_groups.py +38 -12
  60. gcore/resources/cloud/ssh_keys.py +10 -0
  61. gcore/resources/cloud/tasks.py +22 -7
  62. gcore/resources/cloud/volumes.py +65 -23
  63. gcore/resources/dns/zones/rrsets.py +10 -10
  64. gcore/resources/dns/zones/zones.py +2 -2
  65. gcore/resources/security/bgp_announces.py +0 -4
  66. gcore/resources/security/profiles.py +31 -7
  67. gcore/resources/storage/credentials.py +0 -28
  68. gcore/resources/storage/storage.py +2 -2
  69. gcore/types/cdn/__init__.py +5 -0
  70. gcore/types/cdn/alibaba_regions.py +22 -0
  71. gcore/types/cdn/audit_log_list_params.py +2 -2
  72. gcore/types/cdn/aws_regions.py +22 -0
  73. gcore/types/cdn/cdn_list_purge_statuses_response.py +10 -0
  74. gcore/types/cdn/cdn_resource.py +17 -12
  75. gcore/types/cdn/ip_range_list_ips_params.py +19 -0
  76. gcore/types/cdn/ip_range_list_params.py +19 -0
  77. gcore/types/cdn/resource_create_params.py +17 -12
  78. gcore/types/cdn/resource_purge_params.py +4 -4
  79. gcore/types/cdn/resource_replace_params.py +17 -12
  80. gcore/types/cdn/resource_update_params.py +17 -12
  81. gcore/types/cdn/resource_usage_stats.py +16 -15
  82. gcore/types/cdn/resources/cdn_resource_rule.py +15 -10
  83. gcore/types/cdn/resources/rule_create_params.py +15 -10
  84. gcore/types/cdn/resources/rule_replace_params.py +15 -10
  85. gcore/types/cdn/resources/rule_update_params.py +15 -10
  86. gcore/types/cdn/rule_template.py +15 -10
  87. gcore/types/cdn/rule_template_create_params.py +15 -10
  88. gcore/types/cdn/rule_template_replace_params.py +15 -10
  89. gcore/types/cdn/rule_template_update_params.py +15 -10
  90. gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +4 -1
  91. gcore/types/cdn/statistic_get_logs_usage_series_params.py +5 -12
  92. gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +10 -21
  93. gcore/types/cdn/statistic_get_resource_usage_series_params.py +6 -1
  94. gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +5 -2
  95. gcore/types/cdn/statistic_get_shield_usage_series_params.py +3 -0
  96. gcore/types/cloud/__init__.py +9 -3
  97. gcore/types/cloud/audit_log_entry.py +9 -3
  98. gcore/types/cloud/audit_log_list_params.py +12 -0
  99. gcore/types/cloud/baremetal/server_create_params.py +7 -7
  100. gcore/types/cloud/baremetal_flavor.py +0 -6
  101. gcore/types/cloud/billing_reservation_list_params.py +1 -1
  102. gcore/types/cloud/blackhole_port.py +4 -1
  103. gcore/types/cloud/databases/postgres/__init__.py +12 -0
  104. gcore/types/cloud/databases/postgres/cluster_create_params.py +108 -0
  105. gcore/types/cloud/databases/postgres/cluster_list_params.py +19 -0
  106. gcore/types/cloud/databases/postgres/cluster_update_params.py +102 -0
  107. gcore/types/cloud/databases/postgres/clusters/__init__.py +5 -0
  108. gcore/types/cloud/databases/postgres/clusters/postgres_user_credentials.py +13 -0
  109. gcore/types/cloud/databases/postgres/custom_configuration_validate_params.py +19 -0
  110. gcore/types/cloud/databases/postgres/pg_conf_validation.py +15 -0
  111. gcore/types/cloud/databases/postgres/postgres_cluster.py +118 -0
  112. gcore/types/cloud/databases/postgres/postgres_cluster_short.py +22 -0
  113. gcore/types/cloud/databases/postgres/postgres_configuration.py +31 -0
  114. gcore/types/cloud/file_share_create_params.py +8 -8
  115. gcore/types/cloud/file_share_update_params.py +7 -2
  116. gcore/types/cloud/floating_ip.py +5 -1
  117. gcore/types/cloud/floating_ip_create_params.py +4 -4
  118. gcore/types/cloud/floating_ip_detailed.py +5 -1
  119. gcore/types/cloud/floating_ip_list_params.py +8 -0
  120. gcore/types/cloud/floating_ip_update_params.py +7 -2
  121. gcore/types/cloud/gpu_baremetal_cluster.py +18 -3
  122. gcore/types/cloud/gpu_baremetal_cluster_action_params.py +7 -2
  123. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +16 -4
  124. gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +5 -2
  125. gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +4 -4
  126. gcore/types/cloud/gpu_image.py +9 -0
  127. gcore/types/cloud/gpu_virtual_cluster.py +189 -0
  128. gcore/types/cloud/gpu_virtual_cluster_action_params.py +127 -0
  129. gcore/types/cloud/gpu_virtual_cluster_create_params.py +213 -0
  130. gcore/types/cloud/gpu_virtual_cluster_delete_params.py +41 -0
  131. gcore/types/cloud/gpu_virtual_cluster_list_params.py +21 -0
  132. gcore/types/cloud/gpu_virtual_cluster_update_params.py +18 -0
  133. gcore/types/cloud/gpu_virtual_clusters/__init__.py +16 -0
  134. gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py +21 -0
  135. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py +77 -0
  136. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py +16 -0
  137. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py +64 -0
  138. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py +16 -0
  139. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py +155 -0
  140. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py +16 -0
  141. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py +190 -0
  142. gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py +16 -0
  143. gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py +56 -0
  144. gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py +44 -0
  145. gcore/types/cloud/gpu_virtual_clusters/server_list_params.py +75 -0
  146. gcore/types/cloud/image.py +9 -0
  147. gcore/types/cloud/inference/deployment_create_params.py +1 -1
  148. gcore/types/cloud/inference/deployment_update_params.py +1 -1
  149. gcore/types/cloud/inference/inference_deployment.py +1 -1
  150. gcore/types/cloud/instance_create_params.py +27 -27
  151. gcore/types/cloud/instance_update_params.py +7 -2
  152. gcore/types/cloud/instances/image_create_from_volume_params.py +4 -4
  153. gcore/types/cloud/instances/image_update_params.py +4 -4
  154. gcore/types/cloud/instances/image_upload_params.py +4 -4
  155. gcore/types/cloud/k8s/__init__.py +4 -4
  156. gcore/types/cloud/k8s/cluster_update_params.py +5 -5
  157. gcore/types/cloud/k8s/clusters/__init__.py +2 -2
  158. gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +2 -2
  159. gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +4 -4
  160. gcore/types/cloud/k8s/k8s_cluster.py +4 -4
  161. gcore/types/cloud/k8s/k8s_cluster_certificate.py +2 -2
  162. gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +14 -2
  163. gcore/types/cloud/k8s/k8s_cluster_list.py +4 -4
  164. gcore/types/cloud/k8s_cluster_version.py +2 -2
  165. gcore/types/cloud/k8s_cluster_version_list.py +4 -4
  166. gcore/types/cloud/load_balancer_create_params.py +14 -8
  167. gcore/types/cloud/load_balancer_flavor_detail.py +2 -2
  168. gcore/types/cloud/load_balancer_l7_policy.py +29 -16
  169. gcore/types/cloud/load_balancer_l7_policy_list.py +3 -3
  170. gcore/types/cloud/load_balancer_l7_rule.py +14 -23
  171. gcore/types/cloud/load_balancer_l7_rule_list.py +3 -3
  172. gcore/types/cloud/load_balancer_listener_detail.py +2 -2
  173. gcore/types/cloud/load_balancer_update_params.py +7 -2
  174. gcore/types/cloud/load_balancers/__init__.py +1 -0
  175. gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +5 -10
  176. gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +7 -11
  177. gcore/types/cloud/load_balancers/l7_policy_create_params.py +102 -18
  178. gcore/types/cloud/load_balancers/l7_policy_replace_params.py +94 -16
  179. gcore/types/cloud/load_balancers/listener_create_params.py +4 -1
  180. gcore/types/cloud/load_balancers/listener_delete_params.py +18 -0
  181. gcore/types/cloud/load_balancers/listener_update_params.py +4 -1
  182. gcore/types/cloud/load_balancers/pool_create_params.py +1 -1
  183. gcore/types/cloud/network_create_params.py +4 -4
  184. gcore/types/cloud/network_update_params.py +7 -2
  185. gcore/types/cloud/networks/subnet_create_params.py +4 -4
  186. gcore/types/cloud/networks/subnet_update_params.py +7 -2
  187. gcore/types/cloud/project_create_params.py +0 -6
  188. gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
  189. gcore/types/cloud/quotas/request_create_params.py +0 -3
  190. gcore/types/cloud/region.py +3 -3
  191. gcore/types/cloud/security_group.py +8 -1
  192. gcore/types/cloud/security_group_create_params.py +7 -5
  193. gcore/types/cloud/security_group_list_params.py +6 -4
  194. gcore/types/cloud/security_group_update_params.py +7 -2
  195. gcore/types/cloud/ssh_key_list_params.py +7 -0
  196. gcore/types/cloud/tag.py +2 -2
  197. gcore/types/cloud/task_id_list.py +3 -3
  198. gcore/types/cloud/volume_create_params.py +12 -12
  199. gcore/types/cloud/volume_update_params.py +7 -2
  200. gcore/types/dns/zone_list_params.py +1 -1
  201. gcore/types/iam/api_token_create.py +70 -1
  202. gcore/types/security/bgp_announce_list_params.py +0 -2
  203. gcore/types/security/client_profile.py +1 -0
  204. gcore/types/security/profile_create_params.py +4 -2
  205. gcore/types/security/profile_recreate_params.py +4 -2
  206. gcore/types/security/profile_replace_params.py +4 -2
  207. gcore/types/storage/credential_recreate_params.py +0 -17
  208. gcore/types/storage/storage.py +1 -1
  209. gcore/types/storage/storage_create_params.py +1 -1
  210. gcore/types/streaming/stream.py +3 -2
  211. gcore/types/streaming/video.py +1 -1
  212. gcore/types/waap/domains/custom_rule_create_params.py +1 -1
  213. gcore/types/waap/domains/custom_rule_update_params.py +1 -1
  214. gcore/types/waap/domains/waap_custom_rule.py +1 -1
  215. {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/METADATA +14 -14
  216. {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/RECORD +219 -168
  217. gcore/resources/cdn/logs/__init__.py +0 -19
  218. /gcore/types/{cdn/logs → cloud/databases}/__init__.py +0 -0
  219. {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/WHEEL +0 -0
  220. {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1551 @@
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 Dict, Optional
6
+ from typing_extensions import Literal, overload
7
+
8
+ import httpx
9
+
10
+ from .images import (
11
+ ImagesResource,
12
+ AsyncImagesResource,
13
+ ImagesResourceWithRawResponse,
14
+ AsyncImagesResourceWithRawResponse,
15
+ ImagesResourceWithStreamingResponse,
16
+ AsyncImagesResourceWithStreamingResponse,
17
+ )
18
+ from .flavors import (
19
+ FlavorsResource,
20
+ AsyncFlavorsResource,
21
+ FlavorsResourceWithRawResponse,
22
+ AsyncFlavorsResourceWithRawResponse,
23
+ FlavorsResourceWithStreamingResponse,
24
+ AsyncFlavorsResourceWithStreamingResponse,
25
+ )
26
+ from .servers import (
27
+ ServersResource,
28
+ AsyncServersResource,
29
+ ServersResourceWithRawResponse,
30
+ AsyncServersResourceWithRawResponse,
31
+ ServersResourceWithStreamingResponse,
32
+ AsyncServersResourceWithStreamingResponse,
33
+ )
34
+ from .volumes import (
35
+ VolumesResource,
36
+ AsyncVolumesResource,
37
+ VolumesResourceWithRawResponse,
38
+ AsyncVolumesResourceWithRawResponse,
39
+ VolumesResourceWithStreamingResponse,
40
+ AsyncVolumesResourceWithStreamingResponse,
41
+ )
42
+ from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
43
+ from ...._utils import required_args, maybe_transform, async_maybe_transform
44
+ from ...._compat import cached_property
45
+ from .interfaces import (
46
+ InterfacesResource,
47
+ AsyncInterfacesResource,
48
+ InterfacesResourceWithRawResponse,
49
+ AsyncInterfacesResourceWithRawResponse,
50
+ InterfacesResourceWithStreamingResponse,
51
+ AsyncInterfacesResourceWithStreamingResponse,
52
+ )
53
+ from ...._resource import SyncAPIResource, AsyncAPIResource
54
+ from ...._response import (
55
+ to_raw_response_wrapper,
56
+ to_streamed_response_wrapper,
57
+ async_to_raw_response_wrapper,
58
+ async_to_streamed_response_wrapper,
59
+ )
60
+ from ....pagination import SyncOffsetPage, AsyncOffsetPage
61
+ from ....types.cloud import (
62
+ gpu_virtual_cluster_list_params,
63
+ gpu_virtual_cluster_action_params,
64
+ gpu_virtual_cluster_create_params,
65
+ gpu_virtual_cluster_delete_params,
66
+ gpu_virtual_cluster_update_params,
67
+ )
68
+ from ...._base_client import AsyncPaginator, make_request_options
69
+ from ....types.cloud.task_id_list import TaskIDList
70
+ from ....types.cloud.gpu_virtual_cluster import GPUVirtualCluster
71
+ from ....types.cloud.tag_update_map_param import TagUpdateMapParam
72
+
73
+ __all__ = ["GPUVirtualClustersResource", "AsyncGPUVirtualClustersResource"]
74
+
75
+
76
+ class GPUVirtualClustersResource(SyncAPIResource):
77
+ @cached_property
78
+ def servers(self) -> ServersResource:
79
+ return ServersResource(self._client)
80
+
81
+ @cached_property
82
+ def volumes(self) -> VolumesResource:
83
+ return VolumesResource(self._client)
84
+
85
+ @cached_property
86
+ def interfaces(self) -> InterfacesResource:
87
+ return InterfacesResource(self._client)
88
+
89
+ @cached_property
90
+ def flavors(self) -> FlavorsResource:
91
+ return FlavorsResource(self._client)
92
+
93
+ @cached_property
94
+ def images(self) -> ImagesResource:
95
+ return ImagesResource(self._client)
96
+
97
+ @cached_property
98
+ def with_raw_response(self) -> GPUVirtualClustersResourceWithRawResponse:
99
+ """
100
+ This property can be used as a prefix for any HTTP method call to return
101
+ the raw response object instead of the parsed content.
102
+
103
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
104
+ """
105
+ return GPUVirtualClustersResourceWithRawResponse(self)
106
+
107
+ @cached_property
108
+ def with_streaming_response(self) -> GPUVirtualClustersResourceWithStreamingResponse:
109
+ """
110
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
111
+
112
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
113
+ """
114
+ return GPUVirtualClustersResourceWithStreamingResponse(self)
115
+
116
+ def create(
117
+ self,
118
+ *,
119
+ project_id: int | None = None,
120
+ region_id: int | None = None,
121
+ flavor: str,
122
+ name: str,
123
+ servers_count: int,
124
+ servers_settings: gpu_virtual_cluster_create_params.ServersSettings,
125
+ tags: Dict[str, str] | Omit = omit,
126
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127
+ # The extra values given here take precedence over values defined on the client or passed to this method.
128
+ extra_headers: Headers | None = None,
129
+ extra_query: Query | None = None,
130
+ extra_body: Body | None = None,
131
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
132
+ ) -> TaskIDList:
133
+ """
134
+ Create a new virtual GPU cluster with the specified configuration.
135
+
136
+ Args:
137
+ project_id: Project ID
138
+
139
+ region_id: Region ID
140
+
141
+ flavor: Cluster flavor ID
142
+
143
+ name: Cluster name
144
+
145
+ servers_count: Number of servers in the cluster
146
+
147
+ servers_settings: Configuration settings for the servers in the cluster
148
+
149
+ tags: Key-value tags to associate with the resource. A tag is a key-value pair that
150
+ can be associated with a resource, enabling efficient filtering and grouping for
151
+ better organization and management. Both tag keys and values have a maximum
152
+ length of 255 characters. Some tags are read-only and cannot be modified by the
153
+ user. Tags are also integrated with cost reports, allowing cost data to be
154
+ filtered based on tag keys or values.
155
+
156
+ extra_headers: Send extra headers
157
+
158
+ extra_query: Add additional query parameters to the request
159
+
160
+ extra_body: Add additional JSON properties to the request
161
+
162
+ timeout: Override the client-level default timeout for this request, in seconds
163
+ """
164
+ if project_id is None:
165
+ project_id = self._client._get_cloud_project_id_path_param()
166
+ if region_id is None:
167
+ region_id = self._client._get_cloud_region_id_path_param()
168
+ return self._post(
169
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters",
170
+ body=maybe_transform(
171
+ {
172
+ "flavor": flavor,
173
+ "name": name,
174
+ "servers_count": servers_count,
175
+ "servers_settings": servers_settings,
176
+ "tags": tags,
177
+ },
178
+ gpu_virtual_cluster_create_params.GPUVirtualClusterCreateParams,
179
+ ),
180
+ options=make_request_options(
181
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
182
+ ),
183
+ cast_to=TaskIDList,
184
+ )
185
+
186
+ def update(
187
+ self,
188
+ cluster_id: str,
189
+ *,
190
+ project_id: int | None = None,
191
+ region_id: int | None = None,
192
+ name: str,
193
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194
+ # The extra values given here take precedence over values defined on the client or passed to this method.
195
+ extra_headers: Headers | None = None,
196
+ extra_query: Query | None = None,
197
+ extra_body: Body | None = None,
198
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
199
+ ) -> GPUVirtualCluster:
200
+ """
201
+ Update the name of an existing virtual GPU cluster.
202
+
203
+ Args:
204
+ project_id: Project ID
205
+
206
+ region_id: Region ID
207
+
208
+ cluster_id: Cluster unique identifier
209
+
210
+ name: Cluster name
211
+
212
+ extra_headers: Send extra headers
213
+
214
+ extra_query: Add additional query parameters to the request
215
+
216
+ extra_body: Add additional JSON properties to the request
217
+
218
+ timeout: Override the client-level default timeout for this request, in seconds
219
+ """
220
+ if project_id is None:
221
+ project_id = self._client._get_cloud_project_id_path_param()
222
+ if region_id is None:
223
+ region_id = self._client._get_cloud_region_id_path_param()
224
+ if not cluster_id:
225
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
226
+ return self._patch(
227
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
228
+ body=maybe_transform({"name": name}, gpu_virtual_cluster_update_params.GPUVirtualClusterUpdateParams),
229
+ options=make_request_options(
230
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
231
+ ),
232
+ cast_to=GPUVirtualCluster,
233
+ )
234
+
235
+ def list(
236
+ self,
237
+ *,
238
+ project_id: int | None = None,
239
+ region_id: int | None = None,
240
+ limit: int | Omit = omit,
241
+ offset: int | Omit = omit,
242
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243
+ # The extra values given here take precedence over values defined on the client or passed to this method.
244
+ extra_headers: Headers | None = None,
245
+ extra_query: Query | None = None,
246
+ extra_body: Body | None = None,
247
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
248
+ ) -> SyncOffsetPage[GPUVirtualCluster]:
249
+ """
250
+ List all virtual GPU clusters in the specified project and region.
251
+
252
+ Args:
253
+ project_id: Project ID
254
+
255
+ region_id: Region ID
256
+
257
+ limit: Limit of items on a single page
258
+
259
+ offset: Offset in results list
260
+
261
+ extra_headers: Send extra headers
262
+
263
+ extra_query: Add additional query parameters to the request
264
+
265
+ extra_body: Add additional JSON properties to the request
266
+
267
+ timeout: Override the client-level default timeout for this request, in seconds
268
+ """
269
+ if project_id is None:
270
+ project_id = self._client._get_cloud_project_id_path_param()
271
+ if region_id is None:
272
+ region_id = self._client._get_cloud_region_id_path_param()
273
+ return self._get_api_list(
274
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters",
275
+ page=SyncOffsetPage[GPUVirtualCluster],
276
+ options=make_request_options(
277
+ extra_headers=extra_headers,
278
+ extra_query=extra_query,
279
+ extra_body=extra_body,
280
+ timeout=timeout,
281
+ query=maybe_transform(
282
+ {
283
+ "limit": limit,
284
+ "offset": offset,
285
+ },
286
+ gpu_virtual_cluster_list_params.GPUVirtualClusterListParams,
287
+ ),
288
+ ),
289
+ model=GPUVirtualCluster,
290
+ )
291
+
292
+ def delete(
293
+ self,
294
+ cluster_id: str,
295
+ *,
296
+ project_id: int | None = None,
297
+ region_id: int | None = None,
298
+ all_floating_ips: bool | Omit = omit,
299
+ all_reserved_fixed_ips: bool | Omit = omit,
300
+ all_volumes: bool | Omit = omit,
301
+ floating_ip_ids: SequenceNotStr[str] | Omit = omit,
302
+ reserved_fixed_ip_ids: SequenceNotStr[str] | Omit = omit,
303
+ volume_ids: SequenceNotStr[str] | Omit = omit,
304
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
305
+ # The extra values given here take precedence over values defined on the client or passed to this method.
306
+ extra_headers: Headers | None = None,
307
+ extra_query: Query | None = None,
308
+ extra_body: Body | None = None,
309
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
310
+ ) -> TaskIDList:
311
+ """
312
+ Delete a virtual GPU cluster and all its associated resources.
313
+
314
+ Args:
315
+ project_id: Project ID
316
+
317
+ region_id: Region ID
318
+
319
+ cluster_id: Cluster unique identifier
320
+
321
+ all_floating_ips: Flag indicating whether the floating ips associated with server / cluster are
322
+ deleted
323
+
324
+ all_reserved_fixed_ips: Flag indicating whether the reserved fixed ips associated with server / cluster
325
+ are deleted
326
+
327
+ all_volumes: Flag indicating whether all attached volumes are deleted
328
+
329
+ floating_ip_ids: Optional list of floating ips to be deleted
330
+
331
+ reserved_fixed_ip_ids: Optional list of reserved fixed ips to be deleted
332
+
333
+ volume_ids: Optional list of volumes to be deleted
334
+
335
+ extra_headers: Send extra headers
336
+
337
+ extra_query: Add additional query parameters to the request
338
+
339
+ extra_body: Add additional JSON properties to the request
340
+
341
+ timeout: Override the client-level default timeout for this request, in seconds
342
+ """
343
+ if project_id is None:
344
+ project_id = self._client._get_cloud_project_id_path_param()
345
+ if region_id is None:
346
+ region_id = self._client._get_cloud_region_id_path_param()
347
+ if not cluster_id:
348
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
349
+ return self._delete(
350
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
351
+ options=make_request_options(
352
+ extra_headers=extra_headers,
353
+ extra_query=extra_query,
354
+ extra_body=extra_body,
355
+ timeout=timeout,
356
+ query=maybe_transform(
357
+ {
358
+ "all_floating_ips": all_floating_ips,
359
+ "all_reserved_fixed_ips": all_reserved_fixed_ips,
360
+ "all_volumes": all_volumes,
361
+ "floating_ip_ids": floating_ip_ids,
362
+ "reserved_fixed_ip_ids": reserved_fixed_ip_ids,
363
+ "volume_ids": volume_ids,
364
+ },
365
+ gpu_virtual_cluster_delete_params.GPUVirtualClusterDeleteParams,
366
+ ),
367
+ ),
368
+ cast_to=TaskIDList,
369
+ )
370
+
371
+ @overload
372
+ def action(
373
+ self,
374
+ cluster_id: str,
375
+ *,
376
+ project_id: int | None = None,
377
+ region_id: int | None = None,
378
+ action: Literal["start"],
379
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
380
+ # The extra values given here take precedence over values defined on the client or passed to this method.
381
+ extra_headers: Headers | None = None,
382
+ extra_query: Query | None = None,
383
+ extra_body: Body | None = None,
384
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
385
+ ) -> TaskIDList:
386
+ """Perform a specific action on a virtual GPU cluster.
387
+
388
+ Available actions: start,
389
+ stop, soft reboot, hard reboot, resize, update tags.
390
+
391
+ Args:
392
+ project_id: Project ID
393
+
394
+ region_id: Region ID
395
+
396
+ cluster_id: Cluster unique identifier
397
+
398
+ action: Action name
399
+
400
+ extra_headers: Send extra headers
401
+
402
+ extra_query: Add additional query parameters to the request
403
+
404
+ extra_body: Add additional JSON properties to the request
405
+
406
+ timeout: Override the client-level default timeout for this request, in seconds
407
+ """
408
+ ...
409
+
410
+ @overload
411
+ def action(
412
+ self,
413
+ cluster_id: str,
414
+ *,
415
+ project_id: int | None = None,
416
+ region_id: int | None = None,
417
+ action: Literal["stop"],
418
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
419
+ # The extra values given here take precedence over values defined on the client or passed to this method.
420
+ extra_headers: Headers | None = None,
421
+ extra_query: Query | None = None,
422
+ extra_body: Body | None = None,
423
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
424
+ ) -> TaskIDList:
425
+ """Perform a specific action on a virtual GPU cluster.
426
+
427
+ Available actions: start,
428
+ stop, soft reboot, hard reboot, resize, update tags.
429
+
430
+ Args:
431
+ project_id: Project ID
432
+
433
+ region_id: Region ID
434
+
435
+ cluster_id: Cluster unique identifier
436
+
437
+ action: Action name
438
+
439
+ extra_headers: Send extra headers
440
+
441
+ extra_query: Add additional query parameters to the request
442
+
443
+ extra_body: Add additional JSON properties to the request
444
+
445
+ timeout: Override the client-level default timeout for this request, in seconds
446
+ """
447
+ ...
448
+
449
+ @overload
450
+ def action(
451
+ self,
452
+ cluster_id: str,
453
+ *,
454
+ project_id: int | None = None,
455
+ region_id: int | None = None,
456
+ action: Literal["soft_reboot"],
457
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
458
+ # The extra values given here take precedence over values defined on the client or passed to this method.
459
+ extra_headers: Headers | None = None,
460
+ extra_query: Query | None = None,
461
+ extra_body: Body | None = None,
462
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
463
+ ) -> TaskIDList:
464
+ """Perform a specific action on a virtual GPU cluster.
465
+
466
+ Available actions: start,
467
+ stop, soft reboot, hard reboot, resize, update tags.
468
+
469
+ Args:
470
+ project_id: Project ID
471
+
472
+ region_id: Region ID
473
+
474
+ cluster_id: Cluster unique identifier
475
+
476
+ action: Action name
477
+
478
+ extra_headers: Send extra headers
479
+
480
+ extra_query: Add additional query parameters to the request
481
+
482
+ extra_body: Add additional JSON properties to the request
483
+
484
+ timeout: Override the client-level default timeout for this request, in seconds
485
+ """
486
+ ...
487
+
488
+ @overload
489
+ def action(
490
+ self,
491
+ cluster_id: str,
492
+ *,
493
+ project_id: int | None = None,
494
+ region_id: int | None = None,
495
+ action: Literal["hard_reboot"],
496
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
497
+ # The extra values given here take precedence over values defined on the client or passed to this method.
498
+ extra_headers: Headers | None = None,
499
+ extra_query: Query | None = None,
500
+ extra_body: Body | None = None,
501
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
502
+ ) -> TaskIDList:
503
+ """Perform a specific action on a virtual GPU cluster.
504
+
505
+ Available actions: start,
506
+ stop, soft reboot, hard reboot, resize, update tags.
507
+
508
+ Args:
509
+ project_id: Project ID
510
+
511
+ region_id: Region ID
512
+
513
+ cluster_id: Cluster unique identifier
514
+
515
+ action: Action name
516
+
517
+ extra_headers: Send extra headers
518
+
519
+ extra_query: Add additional query parameters to the request
520
+
521
+ extra_body: Add additional JSON properties to the request
522
+
523
+ timeout: Override the client-level default timeout for this request, in seconds
524
+ """
525
+ ...
526
+
527
+ @overload
528
+ def action(
529
+ self,
530
+ cluster_id: str,
531
+ *,
532
+ project_id: int | None = None,
533
+ region_id: int | None = None,
534
+ action: Literal["update_tags"],
535
+ tags: Optional[TagUpdateMapParam],
536
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
537
+ # The extra values given here take precedence over values defined on the client or passed to this method.
538
+ extra_headers: Headers | None = None,
539
+ extra_query: Query | None = None,
540
+ extra_body: Body | None = None,
541
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
542
+ ) -> TaskIDList:
543
+ """Perform a specific action on a virtual GPU cluster.
544
+
545
+ Available actions: start,
546
+ stop, soft reboot, hard reboot, resize, update tags.
547
+
548
+ Args:
549
+ project_id: Project ID
550
+
551
+ region_id: Region ID
552
+
553
+ cluster_id: Cluster unique identifier
554
+
555
+ action: Action name
556
+
557
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
558
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
559
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
560
+ cannot be modified.
561
+
562
+ **Examples:**
563
+
564
+ - **Add/update tags:**
565
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
566
+ updates existing ones.
567
+
568
+ - **Delete tags:** `{'tags': {'old_tag': null}}` removes specific tags.
569
+
570
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
571
+ tags are preserved).
572
+
573
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
574
+ specified tags.
575
+
576
+ - **Mixed operations:**
577
+ `{'tags': {'environment': 'production', 'cost_center': 'engineering', 'deprecated_tag': null}}`
578
+ adds/updates 'environment' and '`cost_center`' while removing
579
+ '`deprecated_tag`', preserving other existing tags.
580
+
581
+ - **Replace all:** first delete existing tags with null values, then add new
582
+ ones in the same request.
583
+
584
+ extra_headers: Send extra headers
585
+
586
+ extra_query: Add additional query parameters to the request
587
+
588
+ extra_body: Add additional JSON properties to the request
589
+
590
+ timeout: Override the client-level default timeout for this request, in seconds
591
+ """
592
+ ...
593
+
594
+ @overload
595
+ def action(
596
+ self,
597
+ cluster_id: str,
598
+ *,
599
+ project_id: int | None = None,
600
+ region_id: int | None = None,
601
+ action: Literal["resize"],
602
+ servers_count: int,
603
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
604
+ # The extra values given here take precedence over values defined on the client or passed to this method.
605
+ extra_headers: Headers | None = None,
606
+ extra_query: Query | None = None,
607
+ extra_body: Body | None = None,
608
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
609
+ ) -> TaskIDList:
610
+ """Perform a specific action on a virtual GPU cluster.
611
+
612
+ Available actions: start,
613
+ stop, soft reboot, hard reboot, resize, update tags.
614
+
615
+ Args:
616
+ project_id: Project ID
617
+
618
+ region_id: Region ID
619
+
620
+ cluster_id: Cluster unique identifier
621
+
622
+ action: Action name
623
+
624
+ servers_count: Requested servers count
625
+
626
+ extra_headers: Send extra headers
627
+
628
+ extra_query: Add additional query parameters to the request
629
+
630
+ extra_body: Add additional JSON properties to the request
631
+
632
+ timeout: Override the client-level default timeout for this request, in seconds
633
+ """
634
+ ...
635
+
636
+ @required_args(["action"], ["action", "tags"], ["action", "servers_count"])
637
+ def action(
638
+ self,
639
+ cluster_id: str,
640
+ *,
641
+ project_id: int | None = None,
642
+ region_id: int | None = None,
643
+ action: Literal["start"]
644
+ | Literal["stop"]
645
+ | Literal["soft_reboot"]
646
+ | Literal["hard_reboot"]
647
+ | Literal["update_tags"]
648
+ | Literal["resize"],
649
+ tags: Optional[TagUpdateMapParam] | Omit = omit,
650
+ servers_count: int | Omit = omit,
651
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
652
+ # The extra values given here take precedence over values defined on the client or passed to this method.
653
+ extra_headers: Headers | None = None,
654
+ extra_query: Query | None = None,
655
+ extra_body: Body | None = None,
656
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
657
+ ) -> TaskIDList:
658
+ if project_id is None:
659
+ project_id = self._client._get_cloud_project_id_path_param()
660
+ if region_id is None:
661
+ region_id = self._client._get_cloud_region_id_path_param()
662
+ if not cluster_id:
663
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
664
+ return self._post(
665
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/action",
666
+ body=maybe_transform(
667
+ {
668
+ "action": action,
669
+ "tags": tags,
670
+ "servers_count": servers_count,
671
+ },
672
+ gpu_virtual_cluster_action_params.GPUVirtualClusterActionParams,
673
+ ),
674
+ options=make_request_options(
675
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
676
+ ),
677
+ cast_to=TaskIDList,
678
+ )
679
+
680
+ def get(
681
+ self,
682
+ cluster_id: str,
683
+ *,
684
+ project_id: int | None = None,
685
+ region_id: int | None = None,
686
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
687
+ # The extra values given here take precedence over values defined on the client or passed to this method.
688
+ extra_headers: Headers | None = None,
689
+ extra_query: Query | None = None,
690
+ extra_body: Body | None = None,
691
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
692
+ ) -> GPUVirtualCluster:
693
+ """
694
+ Get detailed information about a specific virtual GPU cluster.
695
+
696
+ Args:
697
+ project_id: Project ID
698
+
699
+ region_id: Region ID
700
+
701
+ cluster_id: Cluster unique identifier
702
+
703
+ extra_headers: Send extra headers
704
+
705
+ extra_query: Add additional query parameters to the request
706
+
707
+ extra_body: Add additional JSON properties to the request
708
+
709
+ timeout: Override the client-level default timeout for this request, in seconds
710
+ """
711
+ if project_id is None:
712
+ project_id = self._client._get_cloud_project_id_path_param()
713
+ if region_id is None:
714
+ region_id = self._client._get_cloud_region_id_path_param()
715
+ if not cluster_id:
716
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
717
+ return self._get(
718
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
719
+ options=make_request_options(
720
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
721
+ ),
722
+ cast_to=GPUVirtualCluster,
723
+ )
724
+
725
+
726
+ class AsyncGPUVirtualClustersResource(AsyncAPIResource):
727
+ @cached_property
728
+ def servers(self) -> AsyncServersResource:
729
+ return AsyncServersResource(self._client)
730
+
731
+ @cached_property
732
+ def volumes(self) -> AsyncVolumesResource:
733
+ return AsyncVolumesResource(self._client)
734
+
735
+ @cached_property
736
+ def interfaces(self) -> AsyncInterfacesResource:
737
+ return AsyncInterfacesResource(self._client)
738
+
739
+ @cached_property
740
+ def flavors(self) -> AsyncFlavorsResource:
741
+ return AsyncFlavorsResource(self._client)
742
+
743
+ @cached_property
744
+ def images(self) -> AsyncImagesResource:
745
+ return AsyncImagesResource(self._client)
746
+
747
+ @cached_property
748
+ def with_raw_response(self) -> AsyncGPUVirtualClustersResourceWithRawResponse:
749
+ """
750
+ This property can be used as a prefix for any HTTP method call to return
751
+ the raw response object instead of the parsed content.
752
+
753
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
754
+ """
755
+ return AsyncGPUVirtualClustersResourceWithRawResponse(self)
756
+
757
+ @cached_property
758
+ def with_streaming_response(self) -> AsyncGPUVirtualClustersResourceWithStreamingResponse:
759
+ """
760
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
761
+
762
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
763
+ """
764
+ return AsyncGPUVirtualClustersResourceWithStreamingResponse(self)
765
+
766
+ async def create(
767
+ self,
768
+ *,
769
+ project_id: int | None = None,
770
+ region_id: int | None = None,
771
+ flavor: str,
772
+ name: str,
773
+ servers_count: int,
774
+ servers_settings: gpu_virtual_cluster_create_params.ServersSettings,
775
+ tags: Dict[str, str] | Omit = omit,
776
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
777
+ # The extra values given here take precedence over values defined on the client or passed to this method.
778
+ extra_headers: Headers | None = None,
779
+ extra_query: Query | None = None,
780
+ extra_body: Body | None = None,
781
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
782
+ ) -> TaskIDList:
783
+ """
784
+ Create a new virtual GPU cluster with the specified configuration.
785
+
786
+ Args:
787
+ project_id: Project ID
788
+
789
+ region_id: Region ID
790
+
791
+ flavor: Cluster flavor ID
792
+
793
+ name: Cluster name
794
+
795
+ servers_count: Number of servers in the cluster
796
+
797
+ servers_settings: Configuration settings for the servers in the cluster
798
+
799
+ tags: Key-value tags to associate with the resource. A tag is a key-value pair that
800
+ can be associated with a resource, enabling efficient filtering and grouping for
801
+ better organization and management. Both tag keys and values have a maximum
802
+ length of 255 characters. Some tags are read-only and cannot be modified by the
803
+ user. Tags are also integrated with cost reports, allowing cost data to be
804
+ filtered based on tag keys or values.
805
+
806
+ extra_headers: Send extra headers
807
+
808
+ extra_query: Add additional query parameters to the request
809
+
810
+ extra_body: Add additional JSON properties to the request
811
+
812
+ timeout: Override the client-level default timeout for this request, in seconds
813
+ """
814
+ if project_id is None:
815
+ project_id = self._client._get_cloud_project_id_path_param()
816
+ if region_id is None:
817
+ region_id = self._client._get_cloud_region_id_path_param()
818
+ return await self._post(
819
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters",
820
+ body=await async_maybe_transform(
821
+ {
822
+ "flavor": flavor,
823
+ "name": name,
824
+ "servers_count": servers_count,
825
+ "servers_settings": servers_settings,
826
+ "tags": tags,
827
+ },
828
+ gpu_virtual_cluster_create_params.GPUVirtualClusterCreateParams,
829
+ ),
830
+ options=make_request_options(
831
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
832
+ ),
833
+ cast_to=TaskIDList,
834
+ )
835
+
836
+ async def update(
837
+ self,
838
+ cluster_id: str,
839
+ *,
840
+ project_id: int | None = None,
841
+ region_id: int | None = None,
842
+ name: str,
843
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
844
+ # The extra values given here take precedence over values defined on the client or passed to this method.
845
+ extra_headers: Headers | None = None,
846
+ extra_query: Query | None = None,
847
+ extra_body: Body | None = None,
848
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
849
+ ) -> GPUVirtualCluster:
850
+ """
851
+ Update the name of an existing virtual GPU cluster.
852
+
853
+ Args:
854
+ project_id: Project ID
855
+
856
+ region_id: Region ID
857
+
858
+ cluster_id: Cluster unique identifier
859
+
860
+ name: Cluster name
861
+
862
+ extra_headers: Send extra headers
863
+
864
+ extra_query: Add additional query parameters to the request
865
+
866
+ extra_body: Add additional JSON properties to the request
867
+
868
+ timeout: Override the client-level default timeout for this request, in seconds
869
+ """
870
+ if project_id is None:
871
+ project_id = self._client._get_cloud_project_id_path_param()
872
+ if region_id is None:
873
+ region_id = self._client._get_cloud_region_id_path_param()
874
+ if not cluster_id:
875
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
876
+ return await self._patch(
877
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
878
+ body=await async_maybe_transform(
879
+ {"name": name}, gpu_virtual_cluster_update_params.GPUVirtualClusterUpdateParams
880
+ ),
881
+ options=make_request_options(
882
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
883
+ ),
884
+ cast_to=GPUVirtualCluster,
885
+ )
886
+
887
+ def list(
888
+ self,
889
+ *,
890
+ project_id: int | None = None,
891
+ region_id: int | None = None,
892
+ limit: int | Omit = omit,
893
+ offset: int | Omit = omit,
894
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
895
+ # The extra values given here take precedence over values defined on the client or passed to this method.
896
+ extra_headers: Headers | None = None,
897
+ extra_query: Query | None = None,
898
+ extra_body: Body | None = None,
899
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
900
+ ) -> AsyncPaginator[GPUVirtualCluster, AsyncOffsetPage[GPUVirtualCluster]]:
901
+ """
902
+ List all virtual GPU clusters in the specified project and region.
903
+
904
+ Args:
905
+ project_id: Project ID
906
+
907
+ region_id: Region ID
908
+
909
+ limit: Limit of items on a single page
910
+
911
+ offset: Offset in results list
912
+
913
+ extra_headers: Send extra headers
914
+
915
+ extra_query: Add additional query parameters to the request
916
+
917
+ extra_body: Add additional JSON properties to the request
918
+
919
+ timeout: Override the client-level default timeout for this request, in seconds
920
+ """
921
+ if project_id is None:
922
+ project_id = self._client._get_cloud_project_id_path_param()
923
+ if region_id is None:
924
+ region_id = self._client._get_cloud_region_id_path_param()
925
+ return self._get_api_list(
926
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters",
927
+ page=AsyncOffsetPage[GPUVirtualCluster],
928
+ options=make_request_options(
929
+ extra_headers=extra_headers,
930
+ extra_query=extra_query,
931
+ extra_body=extra_body,
932
+ timeout=timeout,
933
+ query=maybe_transform(
934
+ {
935
+ "limit": limit,
936
+ "offset": offset,
937
+ },
938
+ gpu_virtual_cluster_list_params.GPUVirtualClusterListParams,
939
+ ),
940
+ ),
941
+ model=GPUVirtualCluster,
942
+ )
943
+
944
+ async def delete(
945
+ self,
946
+ cluster_id: str,
947
+ *,
948
+ project_id: int | None = None,
949
+ region_id: int | None = None,
950
+ all_floating_ips: bool | Omit = omit,
951
+ all_reserved_fixed_ips: bool | Omit = omit,
952
+ all_volumes: bool | Omit = omit,
953
+ floating_ip_ids: SequenceNotStr[str] | Omit = omit,
954
+ reserved_fixed_ip_ids: SequenceNotStr[str] | Omit = omit,
955
+ volume_ids: SequenceNotStr[str] | Omit = omit,
956
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
957
+ # The extra values given here take precedence over values defined on the client or passed to this method.
958
+ extra_headers: Headers | None = None,
959
+ extra_query: Query | None = None,
960
+ extra_body: Body | None = None,
961
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
962
+ ) -> TaskIDList:
963
+ """
964
+ Delete a virtual GPU cluster and all its associated resources.
965
+
966
+ Args:
967
+ project_id: Project ID
968
+
969
+ region_id: Region ID
970
+
971
+ cluster_id: Cluster unique identifier
972
+
973
+ all_floating_ips: Flag indicating whether the floating ips associated with server / cluster are
974
+ deleted
975
+
976
+ all_reserved_fixed_ips: Flag indicating whether the reserved fixed ips associated with server / cluster
977
+ are deleted
978
+
979
+ all_volumes: Flag indicating whether all attached volumes are deleted
980
+
981
+ floating_ip_ids: Optional list of floating ips to be deleted
982
+
983
+ reserved_fixed_ip_ids: Optional list of reserved fixed ips to be deleted
984
+
985
+ volume_ids: Optional list of volumes to be deleted
986
+
987
+ extra_headers: Send extra headers
988
+
989
+ extra_query: Add additional query parameters to the request
990
+
991
+ extra_body: Add additional JSON properties to the request
992
+
993
+ timeout: Override the client-level default timeout for this request, in seconds
994
+ """
995
+ if project_id is None:
996
+ project_id = self._client._get_cloud_project_id_path_param()
997
+ if region_id is None:
998
+ region_id = self._client._get_cloud_region_id_path_param()
999
+ if not cluster_id:
1000
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
1001
+ return await self._delete(
1002
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
1003
+ options=make_request_options(
1004
+ extra_headers=extra_headers,
1005
+ extra_query=extra_query,
1006
+ extra_body=extra_body,
1007
+ timeout=timeout,
1008
+ query=await async_maybe_transform(
1009
+ {
1010
+ "all_floating_ips": all_floating_ips,
1011
+ "all_reserved_fixed_ips": all_reserved_fixed_ips,
1012
+ "all_volumes": all_volumes,
1013
+ "floating_ip_ids": floating_ip_ids,
1014
+ "reserved_fixed_ip_ids": reserved_fixed_ip_ids,
1015
+ "volume_ids": volume_ids,
1016
+ },
1017
+ gpu_virtual_cluster_delete_params.GPUVirtualClusterDeleteParams,
1018
+ ),
1019
+ ),
1020
+ cast_to=TaskIDList,
1021
+ )
1022
+
1023
+ @overload
1024
+ async def action(
1025
+ self,
1026
+ cluster_id: str,
1027
+ *,
1028
+ project_id: int | None = None,
1029
+ region_id: int | None = None,
1030
+ action: Literal["start"],
1031
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1032
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1033
+ extra_headers: Headers | None = None,
1034
+ extra_query: Query | None = None,
1035
+ extra_body: Body | None = None,
1036
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1037
+ ) -> TaskIDList:
1038
+ """Perform a specific action on a virtual GPU cluster.
1039
+
1040
+ Available actions: start,
1041
+ stop, soft reboot, hard reboot, resize, update tags.
1042
+
1043
+ Args:
1044
+ project_id: Project ID
1045
+
1046
+ region_id: Region ID
1047
+
1048
+ cluster_id: Cluster unique identifier
1049
+
1050
+ action: Action name
1051
+
1052
+ extra_headers: Send extra headers
1053
+
1054
+ extra_query: Add additional query parameters to the request
1055
+
1056
+ extra_body: Add additional JSON properties to the request
1057
+
1058
+ timeout: Override the client-level default timeout for this request, in seconds
1059
+ """
1060
+ ...
1061
+
1062
+ @overload
1063
+ async def action(
1064
+ self,
1065
+ cluster_id: str,
1066
+ *,
1067
+ project_id: int | None = None,
1068
+ region_id: int | None = None,
1069
+ action: Literal["stop"],
1070
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1071
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1072
+ extra_headers: Headers | None = None,
1073
+ extra_query: Query | None = None,
1074
+ extra_body: Body | None = None,
1075
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1076
+ ) -> TaskIDList:
1077
+ """Perform a specific action on a virtual GPU cluster.
1078
+
1079
+ Available actions: start,
1080
+ stop, soft reboot, hard reboot, resize, update tags.
1081
+
1082
+ Args:
1083
+ project_id: Project ID
1084
+
1085
+ region_id: Region ID
1086
+
1087
+ cluster_id: Cluster unique identifier
1088
+
1089
+ action: Action name
1090
+
1091
+ extra_headers: Send extra headers
1092
+
1093
+ extra_query: Add additional query parameters to the request
1094
+
1095
+ extra_body: Add additional JSON properties to the request
1096
+
1097
+ timeout: Override the client-level default timeout for this request, in seconds
1098
+ """
1099
+ ...
1100
+
1101
+ @overload
1102
+ async def action(
1103
+ self,
1104
+ cluster_id: str,
1105
+ *,
1106
+ project_id: int | None = None,
1107
+ region_id: int | None = None,
1108
+ action: Literal["soft_reboot"],
1109
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1110
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1111
+ extra_headers: Headers | None = None,
1112
+ extra_query: Query | None = None,
1113
+ extra_body: Body | None = None,
1114
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1115
+ ) -> TaskIDList:
1116
+ """Perform a specific action on a virtual GPU cluster.
1117
+
1118
+ Available actions: start,
1119
+ stop, soft reboot, hard reboot, resize, update tags.
1120
+
1121
+ Args:
1122
+ project_id: Project ID
1123
+
1124
+ region_id: Region ID
1125
+
1126
+ cluster_id: Cluster unique identifier
1127
+
1128
+ action: Action name
1129
+
1130
+ extra_headers: Send extra headers
1131
+
1132
+ extra_query: Add additional query parameters to the request
1133
+
1134
+ extra_body: Add additional JSON properties to the request
1135
+
1136
+ timeout: Override the client-level default timeout for this request, in seconds
1137
+ """
1138
+ ...
1139
+
1140
+ @overload
1141
+ async def action(
1142
+ self,
1143
+ cluster_id: str,
1144
+ *,
1145
+ project_id: int | None = None,
1146
+ region_id: int | None = None,
1147
+ action: Literal["hard_reboot"],
1148
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1149
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1150
+ extra_headers: Headers | None = None,
1151
+ extra_query: Query | None = None,
1152
+ extra_body: Body | None = None,
1153
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1154
+ ) -> TaskIDList:
1155
+ """Perform a specific action on a virtual GPU cluster.
1156
+
1157
+ Available actions: start,
1158
+ stop, soft reboot, hard reboot, resize, update tags.
1159
+
1160
+ Args:
1161
+ project_id: Project ID
1162
+
1163
+ region_id: Region ID
1164
+
1165
+ cluster_id: Cluster unique identifier
1166
+
1167
+ action: Action name
1168
+
1169
+ extra_headers: Send extra headers
1170
+
1171
+ extra_query: Add additional query parameters to the request
1172
+
1173
+ extra_body: Add additional JSON properties to the request
1174
+
1175
+ timeout: Override the client-level default timeout for this request, in seconds
1176
+ """
1177
+ ...
1178
+
1179
+ @overload
1180
+ async def action(
1181
+ self,
1182
+ cluster_id: str,
1183
+ *,
1184
+ project_id: int | None = None,
1185
+ region_id: int | None = None,
1186
+ action: Literal["update_tags"],
1187
+ tags: Optional[TagUpdateMapParam],
1188
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1189
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1190
+ extra_headers: Headers | None = None,
1191
+ extra_query: Query | None = None,
1192
+ extra_body: Body | None = None,
1193
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1194
+ ) -> TaskIDList:
1195
+ """Perform a specific action on a virtual GPU cluster.
1196
+
1197
+ Available actions: start,
1198
+ stop, soft reboot, hard reboot, resize, update tags.
1199
+
1200
+ Args:
1201
+ project_id: Project ID
1202
+
1203
+ region_id: Region ID
1204
+
1205
+ cluster_id: Cluster unique identifier
1206
+
1207
+ action: Action name
1208
+
1209
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
1210
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
1211
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
1212
+ cannot be modified.
1213
+
1214
+ **Examples:**
1215
+
1216
+ - **Add/update tags:**
1217
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
1218
+ updates existing ones.
1219
+
1220
+ - **Delete tags:** `{'tags': {'old_tag': null}}` removes specific tags.
1221
+
1222
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
1223
+ tags are preserved).
1224
+
1225
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
1226
+ specified tags.
1227
+
1228
+ - **Mixed operations:**
1229
+ `{'tags': {'environment': 'production', 'cost_center': 'engineering', 'deprecated_tag': null}}`
1230
+ adds/updates 'environment' and '`cost_center`' while removing
1231
+ '`deprecated_tag`', preserving other existing tags.
1232
+
1233
+ - **Replace all:** first delete existing tags with null values, then add new
1234
+ ones in the same request.
1235
+
1236
+ extra_headers: Send extra headers
1237
+
1238
+ extra_query: Add additional query parameters to the request
1239
+
1240
+ extra_body: Add additional JSON properties to the request
1241
+
1242
+ timeout: Override the client-level default timeout for this request, in seconds
1243
+ """
1244
+ ...
1245
+
1246
+ @overload
1247
+ async def action(
1248
+ self,
1249
+ cluster_id: str,
1250
+ *,
1251
+ project_id: int | None = None,
1252
+ region_id: int | None = None,
1253
+ action: Literal["resize"],
1254
+ servers_count: int,
1255
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1256
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1257
+ extra_headers: Headers | None = None,
1258
+ extra_query: Query | None = None,
1259
+ extra_body: Body | None = None,
1260
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1261
+ ) -> TaskIDList:
1262
+ """Perform a specific action on a virtual GPU cluster.
1263
+
1264
+ Available actions: start,
1265
+ stop, soft reboot, hard reboot, resize, update tags.
1266
+
1267
+ Args:
1268
+ project_id: Project ID
1269
+
1270
+ region_id: Region ID
1271
+
1272
+ cluster_id: Cluster unique identifier
1273
+
1274
+ action: Action name
1275
+
1276
+ servers_count: Requested servers count
1277
+
1278
+ extra_headers: Send extra headers
1279
+
1280
+ extra_query: Add additional query parameters to the request
1281
+
1282
+ extra_body: Add additional JSON properties to the request
1283
+
1284
+ timeout: Override the client-level default timeout for this request, in seconds
1285
+ """
1286
+ ...
1287
+
1288
+ @required_args(["action"], ["action", "tags"], ["action", "servers_count"])
1289
+ async def action(
1290
+ self,
1291
+ cluster_id: str,
1292
+ *,
1293
+ project_id: int | None = None,
1294
+ region_id: int | None = None,
1295
+ action: Literal["start"]
1296
+ | Literal["stop"]
1297
+ | Literal["soft_reboot"]
1298
+ | Literal["hard_reboot"]
1299
+ | Literal["update_tags"]
1300
+ | Literal["resize"],
1301
+ tags: Optional[TagUpdateMapParam] | Omit = omit,
1302
+ servers_count: int | Omit = omit,
1303
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1304
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1305
+ extra_headers: Headers | None = None,
1306
+ extra_query: Query | None = None,
1307
+ extra_body: Body | None = None,
1308
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1309
+ ) -> TaskIDList:
1310
+ if project_id is None:
1311
+ project_id = self._client._get_cloud_project_id_path_param()
1312
+ if region_id is None:
1313
+ region_id = self._client._get_cloud_region_id_path_param()
1314
+ if not cluster_id:
1315
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
1316
+ return await self._post(
1317
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/action",
1318
+ body=await async_maybe_transform(
1319
+ {
1320
+ "action": action,
1321
+ "tags": tags,
1322
+ "servers_count": servers_count,
1323
+ },
1324
+ gpu_virtual_cluster_action_params.GPUVirtualClusterActionParams,
1325
+ ),
1326
+ options=make_request_options(
1327
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1328
+ ),
1329
+ cast_to=TaskIDList,
1330
+ )
1331
+
1332
+ async def get(
1333
+ self,
1334
+ cluster_id: str,
1335
+ *,
1336
+ project_id: int | None = None,
1337
+ region_id: int | None = None,
1338
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1339
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1340
+ extra_headers: Headers | None = None,
1341
+ extra_query: Query | None = None,
1342
+ extra_body: Body | None = None,
1343
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1344
+ ) -> GPUVirtualCluster:
1345
+ """
1346
+ Get detailed information about a specific virtual GPU cluster.
1347
+
1348
+ Args:
1349
+ project_id: Project ID
1350
+
1351
+ region_id: Region ID
1352
+
1353
+ cluster_id: Cluster unique identifier
1354
+
1355
+ extra_headers: Send extra headers
1356
+
1357
+ extra_query: Add additional query parameters to the request
1358
+
1359
+ extra_body: Add additional JSON properties to the request
1360
+
1361
+ timeout: Override the client-level default timeout for this request, in seconds
1362
+ """
1363
+ if project_id is None:
1364
+ project_id = self._client._get_cloud_project_id_path_param()
1365
+ if region_id is None:
1366
+ region_id = self._client._get_cloud_region_id_path_param()
1367
+ if not cluster_id:
1368
+ raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
1369
+ return await self._get(
1370
+ f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
1371
+ options=make_request_options(
1372
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1373
+ ),
1374
+ cast_to=GPUVirtualCluster,
1375
+ )
1376
+
1377
+
1378
+ class GPUVirtualClustersResourceWithRawResponse:
1379
+ def __init__(self, gpu_virtual_clusters: GPUVirtualClustersResource) -> None:
1380
+ self._gpu_virtual_clusters = gpu_virtual_clusters
1381
+
1382
+ self.create = to_raw_response_wrapper(
1383
+ gpu_virtual_clusters.create,
1384
+ )
1385
+ self.update = to_raw_response_wrapper(
1386
+ gpu_virtual_clusters.update,
1387
+ )
1388
+ self.list = to_raw_response_wrapper(
1389
+ gpu_virtual_clusters.list,
1390
+ )
1391
+ self.delete = to_raw_response_wrapper(
1392
+ gpu_virtual_clusters.delete,
1393
+ )
1394
+ self.action = to_raw_response_wrapper(
1395
+ gpu_virtual_clusters.action,
1396
+ )
1397
+ self.get = to_raw_response_wrapper(
1398
+ gpu_virtual_clusters.get,
1399
+ )
1400
+
1401
+ @cached_property
1402
+ def servers(self) -> ServersResourceWithRawResponse:
1403
+ return ServersResourceWithRawResponse(self._gpu_virtual_clusters.servers)
1404
+
1405
+ @cached_property
1406
+ def volumes(self) -> VolumesResourceWithRawResponse:
1407
+ return VolumesResourceWithRawResponse(self._gpu_virtual_clusters.volumes)
1408
+
1409
+ @cached_property
1410
+ def interfaces(self) -> InterfacesResourceWithRawResponse:
1411
+ return InterfacesResourceWithRawResponse(self._gpu_virtual_clusters.interfaces)
1412
+
1413
+ @cached_property
1414
+ def flavors(self) -> FlavorsResourceWithRawResponse:
1415
+ return FlavorsResourceWithRawResponse(self._gpu_virtual_clusters.flavors)
1416
+
1417
+ @cached_property
1418
+ def images(self) -> ImagesResourceWithRawResponse:
1419
+ return ImagesResourceWithRawResponse(self._gpu_virtual_clusters.images)
1420
+
1421
+
1422
+ class AsyncGPUVirtualClustersResourceWithRawResponse:
1423
+ def __init__(self, gpu_virtual_clusters: AsyncGPUVirtualClustersResource) -> None:
1424
+ self._gpu_virtual_clusters = gpu_virtual_clusters
1425
+
1426
+ self.create = async_to_raw_response_wrapper(
1427
+ gpu_virtual_clusters.create,
1428
+ )
1429
+ self.update = async_to_raw_response_wrapper(
1430
+ gpu_virtual_clusters.update,
1431
+ )
1432
+ self.list = async_to_raw_response_wrapper(
1433
+ gpu_virtual_clusters.list,
1434
+ )
1435
+ self.delete = async_to_raw_response_wrapper(
1436
+ gpu_virtual_clusters.delete,
1437
+ )
1438
+ self.action = async_to_raw_response_wrapper(
1439
+ gpu_virtual_clusters.action,
1440
+ )
1441
+ self.get = async_to_raw_response_wrapper(
1442
+ gpu_virtual_clusters.get,
1443
+ )
1444
+
1445
+ @cached_property
1446
+ def servers(self) -> AsyncServersResourceWithRawResponse:
1447
+ return AsyncServersResourceWithRawResponse(self._gpu_virtual_clusters.servers)
1448
+
1449
+ @cached_property
1450
+ def volumes(self) -> AsyncVolumesResourceWithRawResponse:
1451
+ return AsyncVolumesResourceWithRawResponse(self._gpu_virtual_clusters.volumes)
1452
+
1453
+ @cached_property
1454
+ def interfaces(self) -> AsyncInterfacesResourceWithRawResponse:
1455
+ return AsyncInterfacesResourceWithRawResponse(self._gpu_virtual_clusters.interfaces)
1456
+
1457
+ @cached_property
1458
+ def flavors(self) -> AsyncFlavorsResourceWithRawResponse:
1459
+ return AsyncFlavorsResourceWithRawResponse(self._gpu_virtual_clusters.flavors)
1460
+
1461
+ @cached_property
1462
+ def images(self) -> AsyncImagesResourceWithRawResponse:
1463
+ return AsyncImagesResourceWithRawResponse(self._gpu_virtual_clusters.images)
1464
+
1465
+
1466
+ class GPUVirtualClustersResourceWithStreamingResponse:
1467
+ def __init__(self, gpu_virtual_clusters: GPUVirtualClustersResource) -> None:
1468
+ self._gpu_virtual_clusters = gpu_virtual_clusters
1469
+
1470
+ self.create = to_streamed_response_wrapper(
1471
+ gpu_virtual_clusters.create,
1472
+ )
1473
+ self.update = to_streamed_response_wrapper(
1474
+ gpu_virtual_clusters.update,
1475
+ )
1476
+ self.list = to_streamed_response_wrapper(
1477
+ gpu_virtual_clusters.list,
1478
+ )
1479
+ self.delete = to_streamed_response_wrapper(
1480
+ gpu_virtual_clusters.delete,
1481
+ )
1482
+ self.action = to_streamed_response_wrapper(
1483
+ gpu_virtual_clusters.action,
1484
+ )
1485
+ self.get = to_streamed_response_wrapper(
1486
+ gpu_virtual_clusters.get,
1487
+ )
1488
+
1489
+ @cached_property
1490
+ def servers(self) -> ServersResourceWithStreamingResponse:
1491
+ return ServersResourceWithStreamingResponse(self._gpu_virtual_clusters.servers)
1492
+
1493
+ @cached_property
1494
+ def volumes(self) -> VolumesResourceWithStreamingResponse:
1495
+ return VolumesResourceWithStreamingResponse(self._gpu_virtual_clusters.volumes)
1496
+
1497
+ @cached_property
1498
+ def interfaces(self) -> InterfacesResourceWithStreamingResponse:
1499
+ return InterfacesResourceWithStreamingResponse(self._gpu_virtual_clusters.interfaces)
1500
+
1501
+ @cached_property
1502
+ def flavors(self) -> FlavorsResourceWithStreamingResponse:
1503
+ return FlavorsResourceWithStreamingResponse(self._gpu_virtual_clusters.flavors)
1504
+
1505
+ @cached_property
1506
+ def images(self) -> ImagesResourceWithStreamingResponse:
1507
+ return ImagesResourceWithStreamingResponse(self._gpu_virtual_clusters.images)
1508
+
1509
+
1510
+ class AsyncGPUVirtualClustersResourceWithStreamingResponse:
1511
+ def __init__(self, gpu_virtual_clusters: AsyncGPUVirtualClustersResource) -> None:
1512
+ self._gpu_virtual_clusters = gpu_virtual_clusters
1513
+
1514
+ self.create = async_to_streamed_response_wrapper(
1515
+ gpu_virtual_clusters.create,
1516
+ )
1517
+ self.update = async_to_streamed_response_wrapper(
1518
+ gpu_virtual_clusters.update,
1519
+ )
1520
+ self.list = async_to_streamed_response_wrapper(
1521
+ gpu_virtual_clusters.list,
1522
+ )
1523
+ self.delete = async_to_streamed_response_wrapper(
1524
+ gpu_virtual_clusters.delete,
1525
+ )
1526
+ self.action = async_to_streamed_response_wrapper(
1527
+ gpu_virtual_clusters.action,
1528
+ )
1529
+ self.get = async_to_streamed_response_wrapper(
1530
+ gpu_virtual_clusters.get,
1531
+ )
1532
+
1533
+ @cached_property
1534
+ def servers(self) -> AsyncServersResourceWithStreamingResponse:
1535
+ return AsyncServersResourceWithStreamingResponse(self._gpu_virtual_clusters.servers)
1536
+
1537
+ @cached_property
1538
+ def volumes(self) -> AsyncVolumesResourceWithStreamingResponse:
1539
+ return AsyncVolumesResourceWithStreamingResponse(self._gpu_virtual_clusters.volumes)
1540
+
1541
+ @cached_property
1542
+ def interfaces(self) -> AsyncInterfacesResourceWithStreamingResponse:
1543
+ return AsyncInterfacesResourceWithStreamingResponse(self._gpu_virtual_clusters.interfaces)
1544
+
1545
+ @cached_property
1546
+ def flavors(self) -> AsyncFlavorsResourceWithStreamingResponse:
1547
+ return AsyncFlavorsResourceWithStreamingResponse(self._gpu_virtual_clusters.flavors)
1548
+
1549
+ @cached_property
1550
+ def images(self) -> AsyncImagesResourceWithStreamingResponse:
1551
+ return AsyncImagesResourceWithStreamingResponse(self._gpu_virtual_clusters.images)