Skip to content

Commit c406d97

Browse files
feat(cloud): add support for GPU virtual clusters
1 parent 767fdd5 commit c406d97

38 files changed

Lines changed: 7133 additions & 2 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 618
1+
configured_endpoints: 633
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-cf3ae8749ead0412e761136b7c81a9ca98dd46ca9ef76c1f700cb1ecc814630d.yml
33
openapi_spec_hash: d5b2b66116339bbe16ec0bbff5b6366f
4-
config_hash: db560bc3873a6441828babf34ae5f184
4+
config_hash: e759f29c457a9e3ac5031e760c36594a

api.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,87 @@ Methods:
826826
- <code title="get /cloud/v3/gpu/baremetal/{project_id}/{region_id}/images/{image_id}">client.cloud.gpu_baremetal_clusters.images.<a href="./src/gcore/resources/cloud/gpu_baremetal_clusters/images.py">get</a>(image_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/gpu_image.py">GPUImage</a></code>
827827
- <code title="post /cloud/v3/gpu/baremetal/{project_id}/{region_id}/images">client.cloud.gpu_baremetal_clusters.images.<a href="./src/gcore/resources/cloud/gpu_baremetal_clusters/images.py">upload</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
828828

829+
## GPUVirtualClusters
830+
831+
Types:
832+
833+
```python
834+
from gcore.types.cloud import GPUVirtualCluster
835+
```
836+
837+
Methods:
838+
839+
- <code title="post /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters">client.cloud.gpu_virtual_clusters.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py">create</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_cluster_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
840+
- <code title="patch /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}">client.cloud.gpu_virtual_clusters.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py">update</a>(cluster_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_cluster_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/gpu_virtual_cluster.py">GPUVirtualCluster</a></code>
841+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters">client.cloud.gpu_virtual_clusters.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_cluster_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/gpu_virtual_cluster.py">SyncOffsetPage[GPUVirtualCluster]</a></code>
842+
- <code title="delete /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}">client.cloud.gpu_virtual_clusters.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py">delete</a>(cluster_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_cluster_delete_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
843+
- <code title="post /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/action">client.cloud.gpu_virtual_clusters.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py">action</a>(cluster_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_cluster_action_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
844+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}">client.cloud.gpu_virtual_clusters.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py">get</a>(cluster_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/gpu_virtual_cluster.py">GPUVirtualCluster</a></code>
845+
846+
### Servers
847+
848+
Types:
849+
850+
```python
851+
from gcore.types.cloud.gpu_virtual_clusters import (
852+
GPUVirtualClusterServer,
853+
GPUVirtualClusterServerList,
854+
)
855+
```
856+
857+
Methods:
858+
859+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/servers">client.cloud.gpu_virtual_clusters.servers.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/servers.py">list</a>(cluster_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_clusters/server_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py">GPUVirtualClusterServerList</a></code>
860+
- <code title="delete /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/servers/{server_id}">client.cloud.gpu_virtual_clusters.servers.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/servers.py">delete</a>(server_id, \*, project_id, region_id, cluster_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
861+
862+
### Volumes
863+
864+
Types:
865+
866+
```python
867+
from gcore.types.cloud.gpu_virtual_clusters import (
868+
GPUVirtualClusterVolume,
869+
GPUVirtualClusterVolumeList,
870+
)
871+
```
872+
873+
Methods:
874+
875+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/volumes">client.cloud.gpu_virtual_clusters.volumes.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/volumes.py">list</a>(cluster_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py">GPUVirtualClusterVolumeList</a></code>
876+
877+
### Interfaces
878+
879+
Types:
880+
881+
```python
882+
from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualInterface, GPUVirtualInterfaceList
883+
```
884+
885+
Methods:
886+
887+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}/interfaces">client.cloud.gpu_virtual_clusters.interfaces.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/interfaces.py">list</a>(cluster_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py">GPUVirtualInterfaceList</a></code>
888+
889+
### Flavors
890+
891+
Types:
892+
893+
```python
894+
from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualFlavor, GPUVirtualFlavorList
895+
```
896+
897+
Methods:
898+
899+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/flavors">client.cloud.gpu_virtual_clusters.flavors.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/flavors.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py">GPUVirtualFlavorList</a></code>
900+
901+
### Images
902+
903+
Methods:
904+
905+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/images">client.cloud.gpu_virtual_clusters.images.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/images.py">list</a>(\*, project_id, region_id) -> <a href="./src/gcore/types/cloud/gpu_image_list.py">GPUImageList</a></code>
906+
- <code title="delete /cloud/v3/gpu/virtual/{project_id}/{region_id}/images/{image_id}">client.cloud.gpu_virtual_clusters.images.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/images.py">delete</a>(image_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
907+
- <code title="get /cloud/v3/gpu/virtual/{project_id}/{region_id}/images/{image_id}">client.cloud.gpu_virtual_clusters.images.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/images.py">get</a>(image_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/gpu_image.py">GPUImage</a></code>
908+
- <code title="post /cloud/v3/gpu/virtual/{project_id}/{region_id}/images">client.cloud.gpu_virtual_clusters.images.<a href="./src/gcore/resources/cloud/gpu_virtual_clusters/images.py">upload</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
909+
829910
## Instances
830911

831912
Types:

src/gcore/resources/cloud/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@
216216
BillingReservationsResourceWithStreamingResponse,
217217
AsyncBillingReservationsResourceWithStreamingResponse,
218218
)
219+
from .gpu_virtual_clusters import (
220+
GPUVirtualClustersResource,
221+
AsyncGPUVirtualClustersResource,
222+
GPUVirtualClustersResourceWithRawResponse,
223+
AsyncGPUVirtualClustersResourceWithRawResponse,
224+
GPUVirtualClustersResourceWithStreamingResponse,
225+
AsyncGPUVirtualClustersResourceWithStreamingResponse,
226+
)
219227
from .gpu_baremetal_clusters import (
220228
GPUBaremetalClustersResource,
221229
AsyncGPUBaremetalClustersResource,
@@ -352,6 +360,12 @@
352360
"AsyncGPUBaremetalClustersResourceWithRawResponse",
353361
"GPUBaremetalClustersResourceWithStreamingResponse",
354362
"AsyncGPUBaremetalClustersResourceWithStreamingResponse",
363+
"GPUVirtualClustersResource",
364+
"AsyncGPUVirtualClustersResource",
365+
"GPUVirtualClustersResourceWithRawResponse",
366+
"AsyncGPUVirtualClustersResourceWithRawResponse",
367+
"GPUVirtualClustersResourceWithStreamingResponse",
368+
"AsyncGPUVirtualClustersResourceWithStreamingResponse",
355369
"InstancesResource",
356370
"AsyncInstancesResource",
357371
"InstancesResourceWithRawResponse",

src/gcore/resources/cloud/cloud.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@
212212
ReservedFixedIPsResourceWithStreamingResponse,
213213
AsyncReservedFixedIPsResourceWithStreamingResponse,
214214
)
215+
from .gpu_virtual_clusters.gpu_virtual_clusters import (
216+
GPUVirtualClustersResource,
217+
AsyncGPUVirtualClustersResource,
218+
GPUVirtualClustersResourceWithRawResponse,
219+
AsyncGPUVirtualClustersResourceWithRawResponse,
220+
GPUVirtualClustersResourceWithStreamingResponse,
221+
AsyncGPUVirtualClustersResourceWithStreamingResponse,
222+
)
215223
from .gpu_baremetal_clusters.gpu_baremetal_clusters import (
216224
GPUBaremetalClustersResource,
217225
AsyncGPUBaremetalClustersResource,
@@ -316,6 +324,10 @@ def billing_reservations(self) -> BillingReservationsResource:
316324
def gpu_baremetal_clusters(self) -> GPUBaremetalClustersResource:
317325
return GPUBaremetalClustersResource(self._client)
318326

327+
@cached_property
328+
def gpu_virtual_clusters(self) -> GPUVirtualClustersResource:
329+
return GPUVirtualClustersResource(self._client)
330+
319331
@cached_property
320332
def instances(self) -> InstancesResource:
321333
return InstancesResource(self._client)
@@ -452,6 +464,10 @@ def billing_reservations(self) -> AsyncBillingReservationsResource:
452464
def gpu_baremetal_clusters(self) -> AsyncGPUBaremetalClustersResource:
453465
return AsyncGPUBaremetalClustersResource(self._client)
454466

467+
@cached_property
468+
def gpu_virtual_clusters(self) -> AsyncGPUVirtualClustersResource:
469+
return AsyncGPUVirtualClustersResource(self._client)
470+
455471
@cached_property
456472
def instances(self) -> AsyncInstancesResource:
457473
return AsyncInstancesResource(self._client)
@@ -591,6 +607,10 @@ def billing_reservations(self) -> BillingReservationsResourceWithRawResponse:
591607
def gpu_baremetal_clusters(self) -> GPUBaremetalClustersResourceWithRawResponse:
592608
return GPUBaremetalClustersResourceWithRawResponse(self._cloud.gpu_baremetal_clusters)
593609

610+
@cached_property
611+
def gpu_virtual_clusters(self) -> GPUVirtualClustersResourceWithRawResponse:
612+
return GPUVirtualClustersResourceWithRawResponse(self._cloud.gpu_virtual_clusters)
613+
594614
@cached_property
595615
def instances(self) -> InstancesResourceWithRawResponse:
596616
return InstancesResourceWithRawResponse(self._cloud.instances)
@@ -711,6 +731,10 @@ def billing_reservations(self) -> AsyncBillingReservationsResourceWithRawRespons
711731
def gpu_baremetal_clusters(self) -> AsyncGPUBaremetalClustersResourceWithRawResponse:
712732
return AsyncGPUBaremetalClustersResourceWithRawResponse(self._cloud.gpu_baremetal_clusters)
713733

734+
@cached_property
735+
def gpu_virtual_clusters(self) -> AsyncGPUVirtualClustersResourceWithRawResponse:
736+
return AsyncGPUVirtualClustersResourceWithRawResponse(self._cloud.gpu_virtual_clusters)
737+
714738
@cached_property
715739
def instances(self) -> AsyncInstancesResourceWithRawResponse:
716740
return AsyncInstancesResourceWithRawResponse(self._cloud.instances)
@@ -831,6 +855,10 @@ def billing_reservations(self) -> BillingReservationsResourceWithStreamingRespon
831855
def gpu_baremetal_clusters(self) -> GPUBaremetalClustersResourceWithStreamingResponse:
832856
return GPUBaremetalClustersResourceWithStreamingResponse(self._cloud.gpu_baremetal_clusters)
833857

858+
@cached_property
859+
def gpu_virtual_clusters(self) -> GPUVirtualClustersResourceWithStreamingResponse:
860+
return GPUVirtualClustersResourceWithStreamingResponse(self._cloud.gpu_virtual_clusters)
861+
834862
@cached_property
835863
def instances(self) -> InstancesResourceWithStreamingResponse:
836864
return InstancesResourceWithStreamingResponse(self._cloud.instances)
@@ -951,6 +979,10 @@ def billing_reservations(self) -> AsyncBillingReservationsResourceWithStreamingR
951979
def gpu_baremetal_clusters(self) -> AsyncGPUBaremetalClustersResourceWithStreamingResponse:
952980
return AsyncGPUBaremetalClustersResourceWithStreamingResponse(self._cloud.gpu_baremetal_clusters)
953981

982+
@cached_property
983+
def gpu_virtual_clusters(self) -> AsyncGPUVirtualClustersResourceWithStreamingResponse:
984+
return AsyncGPUVirtualClustersResourceWithStreamingResponse(self._cloud.gpu_virtual_clusters)
985+
954986
@cached_property
955987
def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
956988
return AsyncInstancesResourceWithStreamingResponse(self._cloud.instances)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .images import (
4+
ImagesResource,
5+
AsyncImagesResource,
6+
ImagesResourceWithRawResponse,
7+
AsyncImagesResourceWithRawResponse,
8+
ImagesResourceWithStreamingResponse,
9+
AsyncImagesResourceWithStreamingResponse,
10+
)
11+
from .flavors import (
12+
FlavorsResource,
13+
AsyncFlavorsResource,
14+
FlavorsResourceWithRawResponse,
15+
AsyncFlavorsResourceWithRawResponse,
16+
FlavorsResourceWithStreamingResponse,
17+
AsyncFlavorsResourceWithStreamingResponse,
18+
)
19+
from .servers import (
20+
ServersResource,
21+
AsyncServersResource,
22+
ServersResourceWithRawResponse,
23+
AsyncServersResourceWithRawResponse,
24+
ServersResourceWithStreamingResponse,
25+
AsyncServersResourceWithStreamingResponse,
26+
)
27+
from .volumes import (
28+
VolumesResource,
29+
AsyncVolumesResource,
30+
VolumesResourceWithRawResponse,
31+
AsyncVolumesResourceWithRawResponse,
32+
VolumesResourceWithStreamingResponse,
33+
AsyncVolumesResourceWithStreamingResponse,
34+
)
35+
from .interfaces import (
36+
InterfacesResource,
37+
AsyncInterfacesResource,
38+
InterfacesResourceWithRawResponse,
39+
AsyncInterfacesResourceWithRawResponse,
40+
InterfacesResourceWithStreamingResponse,
41+
AsyncInterfacesResourceWithStreamingResponse,
42+
)
43+
from .gpu_virtual_clusters import (
44+
GPUVirtualClustersResource,
45+
AsyncGPUVirtualClustersResource,
46+
GPUVirtualClustersResourceWithRawResponse,
47+
AsyncGPUVirtualClustersResourceWithRawResponse,
48+
GPUVirtualClustersResourceWithStreamingResponse,
49+
AsyncGPUVirtualClustersResourceWithStreamingResponse,
50+
)
51+
52+
__all__ = [
53+
"ServersResource",
54+
"AsyncServersResource",
55+
"ServersResourceWithRawResponse",
56+
"AsyncServersResourceWithRawResponse",
57+
"ServersResourceWithStreamingResponse",
58+
"AsyncServersResourceWithStreamingResponse",
59+
"VolumesResource",
60+
"AsyncVolumesResource",
61+
"VolumesResourceWithRawResponse",
62+
"AsyncVolumesResourceWithRawResponse",
63+
"VolumesResourceWithStreamingResponse",
64+
"AsyncVolumesResourceWithStreamingResponse",
65+
"InterfacesResource",
66+
"AsyncInterfacesResource",
67+
"InterfacesResourceWithRawResponse",
68+
"AsyncInterfacesResourceWithRawResponse",
69+
"InterfacesResourceWithStreamingResponse",
70+
"AsyncInterfacesResourceWithStreamingResponse",
71+
"FlavorsResource",
72+
"AsyncFlavorsResource",
73+
"FlavorsResourceWithRawResponse",
74+
"AsyncFlavorsResourceWithRawResponse",
75+
"FlavorsResourceWithStreamingResponse",
76+
"AsyncFlavorsResourceWithStreamingResponse",
77+
"ImagesResource",
78+
"AsyncImagesResource",
79+
"ImagesResourceWithRawResponse",
80+
"AsyncImagesResourceWithRawResponse",
81+
"ImagesResourceWithStreamingResponse",
82+
"AsyncImagesResourceWithStreamingResponse",
83+
"GPUVirtualClustersResource",
84+
"AsyncGPUVirtualClustersResource",
85+
"GPUVirtualClustersResourceWithRawResponse",
86+
"AsyncGPUVirtualClustersResourceWithRawResponse",
87+
"GPUVirtualClustersResourceWithStreamingResponse",
88+
"AsyncGPUVirtualClustersResourceWithStreamingResponse",
89+
]

0 commit comments

Comments
 (0)