From 326786cd4d499fffe760f308326bbd79003e4856 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 15 Dec 2025 11:17:07 +0000
Subject: [PATCH 01/14] feat(cloud): add k8s cluster pools check quotas method
---
.stats.yml | 4 +-
api.md | 3 +-
.../cloud/k8s/clusters/pools/pools.py | 174 ++++++++++++++-
.../types/cloud/k8s/clusters/__init__.py | 2 +
.../k8s/clusters/k8s_cluster_pool_quota.py | 204 ++++++++++++++++++
.../k8s/clusters/pool_check_quota_params.py | 37 ++++
.../cloud/k8s/clusters/test_pools.py | 105 +++++++++
7 files changed, 525 insertions(+), 4 deletions(-)
create mode 100644 src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_quota.py
create mode 100644 src/gcore/types/cloud/k8s/clusters/pool_check_quota_params.py
diff --git a/.stats.yml b/.stats.yml
index 99de8068..e84f2b46 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 640
+configured_endpoints: 641
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-739b0d84ccefaa883a2334ad16738cc87ec625ded28ee0e2e11781f17ba36580.yml
openapi_spec_hash: deb6a4c127edd808cfd8c8eb9eb9610b
-config_hash: 1607041fe51cd832db709af848355624
+config_hash: c6c8ef25ca05ecd4082810d4afd564cf
diff --git a/api.md b/api.md
index 06fef89f..f54b05d3 100644
--- a/api.md
+++ b/api.md
@@ -1046,7 +1046,7 @@ Methods:
Types:
```python
-from gcore.types.cloud.k8s.clusters import K8SClusterPool, K8SClusterPoolList
+from gcore.types.cloud.k8s.clusters import K8SClusterPool, K8SClusterPoolList, K8SClusterPoolQuota
```
Methods:
@@ -1055,6 +1055,7 @@ Methods:
- client.cloud.k8s.clusters.pools.update(pool_name, \*, project_id, region_id, cluster_name, \*\*params) -> K8SClusterPool
- client.cloud.k8s.clusters.pools.list(cluster_name, \*, project_id, region_id) -> K8SClusterPoolList
- client.cloud.k8s.clusters.pools.delete(pool_name, \*, project_id, region_id, cluster_name) -> TaskIDList
+- client.cloud.k8s.clusters.pools.check_quota(\*, project_id, region_id, \*\*params) -> K8SClusterPoolQuota
- client.cloud.k8s.clusters.pools.get(pool_name, \*, project_id, region_id, cluster_name) -> K8SClusterPool
- client.cloud.k8s.clusters.pools.resize(pool_name, \*, project_id, region_id, cluster_name, \*\*params) -> TaskIDList
diff --git a/src/gcore/resources/cloud/k8s/clusters/pools/pools.py b/src/gcore/resources/cloud/k8s/clusters/pools/pools.py
index 6cc9863a..7de8cf65 100644
--- a/src/gcore/resources/cloud/k8s/clusters/pools/pools.py
+++ b/src/gcore/resources/cloud/k8s/clusters/pools/pools.py
@@ -26,10 +26,16 @@
async_to_streamed_response_wrapper,
)
from ......_base_client import make_request_options
-from ......types.cloud.k8s.clusters import pool_create_params, pool_resize_params, pool_update_params
+from ......types.cloud.k8s.clusters import (
+ pool_create_params,
+ pool_resize_params,
+ pool_update_params,
+ pool_check_quota_params,
+)
from ......types.cloud.task_id_list import TaskIDList
from ......types.cloud.k8s.clusters.k8s_cluster_pool import K8SClusterPool
from ......types.cloud.k8s.clusters.k8s_cluster_pool_list import K8SClusterPoolList
+from ......types.cloud.k8s.clusters.k8s_cluster_pool_quota import K8SClusterPoolQuota
__all__ = ["PoolsResource", "AsyncPoolsResource"]
@@ -307,6 +313,83 @@ def delete(
cast_to=TaskIDList,
)
+ def check_quota(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ flavor_id: str,
+ boot_volume_size: Optional[int] | Omit = omit,
+ max_node_count: Optional[int] | Omit = omit,
+ min_node_count: Optional[int] | Omit = omit,
+ name: Optional[str] | Omit = omit,
+ node_count: Optional[int] | Omit = omit,
+ servergroup_policy: Optional[Literal["affinity", "anti-affinity", "soft-anti-affinity"]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> K8SClusterPoolQuota:
+ """Calculate quota requirements for a new cluster pool before creation.
+
+ Returns
+ exceeded quotas if regional limits would be violated. Use before pool creation
+ to validate resource availability. Checks: CPU, RAM, volumes, VMs, GPUs, and
+ baremetal quotas depending on flavor type.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ flavor_id: Flavor ID
+
+ boot_volume_size: Boot volume size
+
+ max_node_count: Maximum node count
+
+ min_node_count: Minimum node count
+
+ name: Name of the cluster pool
+
+ node_count: Maximum node count
+
+ servergroup_policy: Server group policy: anti-affinity, soft-anti-affinity or affinity
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ return self._post(
+ f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/pools/check_limits",
+ body=maybe_transform(
+ {
+ "flavor_id": flavor_id,
+ "boot_volume_size": boot_volume_size,
+ "max_node_count": max_node_count,
+ "min_node_count": min_node_count,
+ "name": name,
+ "node_count": node_count,
+ "servergroup_policy": servergroup_policy,
+ },
+ pool_check_quota_params.PoolCheckQuotaParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=K8SClusterPoolQuota,
+ )
+
def get(
self,
pool_name: str,
@@ -669,6 +752,83 @@ async def delete(
cast_to=TaskIDList,
)
+ async def check_quota(
+ self,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ flavor_id: str,
+ boot_volume_size: Optional[int] | Omit = omit,
+ max_node_count: Optional[int] | Omit = omit,
+ min_node_count: Optional[int] | Omit = omit,
+ name: Optional[str] | Omit = omit,
+ node_count: Optional[int] | Omit = omit,
+ servergroup_policy: Optional[Literal["affinity", "anti-affinity", "soft-anti-affinity"]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> K8SClusterPoolQuota:
+ """Calculate quota requirements for a new cluster pool before creation.
+
+ Returns
+ exceeded quotas if regional limits would be violated. Use before pool creation
+ to validate resource availability. Checks: CPU, RAM, volumes, VMs, GPUs, and
+ baremetal quotas depending on flavor type.
+
+ Args:
+ project_id: Project ID
+
+ region_id: Region ID
+
+ flavor_id: Flavor ID
+
+ boot_volume_size: Boot volume size
+
+ max_node_count: Maximum node count
+
+ min_node_count: Minimum node count
+
+ name: Name of the cluster pool
+
+ node_count: Maximum node count
+
+ servergroup_policy: Server group policy: anti-affinity, soft-anti-affinity or affinity
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ return await self._post(
+ f"/cloud/v2/k8s/clusters/{project_id}/{region_id}/pools/check_limits",
+ body=await async_maybe_transform(
+ {
+ "flavor_id": flavor_id,
+ "boot_volume_size": boot_volume_size,
+ "max_node_count": max_node_count,
+ "min_node_count": min_node_count,
+ "name": name,
+ "node_count": node_count,
+ "servergroup_policy": servergroup_policy,
+ },
+ pool_check_quota_params.PoolCheckQuotaParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=K8SClusterPoolQuota,
+ )
+
async def get(
self,
pool_name: str,
@@ -774,6 +934,9 @@ def __init__(self, pools: PoolsResource) -> None:
self.delete = to_raw_response_wrapper(
pools.delete,
)
+ self.check_quota = to_raw_response_wrapper(
+ pools.check_quota,
+ )
self.get = to_raw_response_wrapper(
pools.get,
)
@@ -802,6 +965,9 @@ def __init__(self, pools: AsyncPoolsResource) -> None:
self.delete = async_to_raw_response_wrapper(
pools.delete,
)
+ self.check_quota = async_to_raw_response_wrapper(
+ pools.check_quota,
+ )
self.get = async_to_raw_response_wrapper(
pools.get,
)
@@ -830,6 +996,9 @@ def __init__(self, pools: PoolsResource) -> None:
self.delete = to_streamed_response_wrapper(
pools.delete,
)
+ self.check_quota = to_streamed_response_wrapper(
+ pools.check_quota,
+ )
self.get = to_streamed_response_wrapper(
pools.get,
)
@@ -858,6 +1027,9 @@ def __init__(self, pools: AsyncPoolsResource) -> None:
self.delete = async_to_streamed_response_wrapper(
pools.delete,
)
+ self.check_quota = async_to_streamed_response_wrapper(
+ pools.check_quota,
+ )
self.get = async_to_streamed_response_wrapper(
pools.get,
)
diff --git a/src/gcore/types/cloud/k8s/clusters/__init__.py b/src/gcore/types/cloud/k8s/clusters/__init__.py
index e145306b..c8c5c859 100644
--- a/src/gcore/types/cloud/k8s/clusters/__init__.py
+++ b/src/gcore/types/cloud/k8s/clusters/__init__.py
@@ -8,3 +8,5 @@
from .pool_resize_params import PoolResizeParams as PoolResizeParams
from .pool_update_params import PoolUpdateParams as PoolUpdateParams
from .k8s_cluster_pool_list import K8SClusterPoolList as K8SClusterPoolList
+from .k8s_cluster_pool_quota import K8SClusterPoolQuota as K8SClusterPoolQuota
+from .pool_check_quota_params import PoolCheckQuotaParams as PoolCheckQuotaParams
diff --git a/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_quota.py b/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_quota.py
new file mode 100644
index 00000000..f7c178db
--- /dev/null
+++ b/src/gcore/types/cloud/k8s/clusters/k8s_cluster_pool_quota.py
@@ -0,0 +1,204 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from ....._models import BaseModel
+
+__all__ = ["K8SClusterPoolQuota"]
+
+
+class K8SClusterPoolQuota(BaseModel):
+ """Response schema for K8s cluster quota check.
+
+ Returns quota fields that are exceeded. Fields are only included when
+ regional limits would be violated. Empty response means no quotas exceeded.
+ """
+
+ baremetal_gpu_a100_count_limit: Optional[int] = None
+ """Bare metal A100 GPU server count limit"""
+
+ baremetal_gpu_a100_count_requested: Optional[int] = None
+ """Bare metal A100 GPU server count requested"""
+
+ baremetal_gpu_a100_count_usage: Optional[int] = None
+ """Bare metal A100 GPU server count usage"""
+
+ baremetal_gpu_h100_count_limit: Optional[int] = None
+ """Bare metal H100 GPU server count limit"""
+
+ baremetal_gpu_h100_count_requested: Optional[int] = None
+ """Bare metal H100 GPU server count requested"""
+
+ baremetal_gpu_h100_count_usage: Optional[int] = None
+ """Bare metal H100 GPU server count usage"""
+
+ baremetal_gpu_h200_count_limit: Optional[int] = None
+ """Bare metal H200 GPU server count limit"""
+
+ baremetal_gpu_h200_count_requested: Optional[int] = None
+ """Bare metal H200 GPU server count requested"""
+
+ baremetal_gpu_h200_count_usage: Optional[int] = None
+ """Bare metal H200 GPU server count usage"""
+
+ baremetal_gpu_l40s_count_limit: Optional[int] = None
+ """Bare metal L40S GPU server count limit"""
+
+ baremetal_gpu_l40s_count_requested: Optional[int] = None
+ """Bare metal L40S GPU server count requested"""
+
+ baremetal_gpu_l40s_count_usage: Optional[int] = None
+ """Bare metal L40S GPU server count usage"""
+
+ baremetal_hf_count_limit: Optional[int] = None
+ """High-frequency bare metal servers count limit"""
+
+ baremetal_hf_count_requested: Optional[int] = None
+ """High-frequency bare metal servers count requested"""
+
+ baremetal_hf_count_usage: Optional[int] = None
+ """High-frequency bare metal servers count usage"""
+
+ cluster_count_limit: Optional[int] = None
+ """K8s clusters count limit"""
+
+ cluster_count_requested: Optional[int] = None
+ """K8s clusters count requested"""
+
+ cluster_count_usage: Optional[int] = None
+ """K8s clusters count usage"""
+
+ cpu_count_limit: Optional[int] = None
+ """vCPU Count limit"""
+
+ cpu_count_requested: Optional[int] = None
+ """vCPU Count requested"""
+
+ cpu_count_usage: Optional[int] = None
+ """vCPU Count usage"""
+
+ firewall_count_limit: Optional[int] = None
+ """Firewalls Count limit"""
+
+ firewall_count_requested: Optional[int] = None
+ """Firewalls Count requested"""
+
+ firewall_count_usage: Optional[int] = None
+ """Firewalls Count usage"""
+
+ floating_count_limit: Optional[int] = None
+ """Floating IP Count limit"""
+
+ floating_count_requested: Optional[int] = None
+ """Floating IP Count requested"""
+
+ floating_count_usage: Optional[int] = None
+ """Floating IP Count usage"""
+
+ gpu_count_limit: Optional[int] = None
+ """GPU Count limit"""
+
+ gpu_count_requested: Optional[int] = None
+ """GPU Count requested"""
+
+ gpu_count_usage: Optional[int] = None
+ """GPU Count usage"""
+
+ gpu_virtual_a100_count_limit: Optional[int] = None
+ """Virtual A100 GPU card count limit"""
+
+ gpu_virtual_a100_count_requested: Optional[int] = None
+ """Virtual A100 GPU card count requested"""
+
+ gpu_virtual_a100_count_usage: Optional[int] = None
+ """Virtual A100 GPU card count usage"""
+
+ gpu_virtual_h100_count_limit: Optional[int] = None
+ """Virtual H100 GPU card count limit"""
+
+ gpu_virtual_h100_count_requested: Optional[int] = None
+ """Virtual H100 GPU card count requested"""
+
+ gpu_virtual_h100_count_usage: Optional[int] = None
+ """Virtual H100 GPU card count usage"""
+
+ gpu_virtual_h200_count_limit: Optional[int] = None
+ """Virtual H200 GPU card count limit"""
+
+ gpu_virtual_h200_count_requested: Optional[int] = None
+ """Virtual H200 GPU card count requested"""
+
+ gpu_virtual_h200_count_usage: Optional[int] = None
+ """Virtual H200 GPU card count usage"""
+
+ gpu_virtual_l40s_count_limit: Optional[int] = None
+ """Virtual L40S GPU card count limit"""
+
+ gpu_virtual_l40s_count_requested: Optional[int] = None
+ """Virtual L40S GPU card count requested"""
+
+ gpu_virtual_l40s_count_usage: Optional[int] = None
+ """Virtual L40S GPU card count usage"""
+
+ laas_topic_count_limit: Optional[int] = None
+ """LaaS Topics Count limit"""
+
+ laas_topic_count_requested: Optional[int] = None
+ """LaaS Topics Count requested"""
+
+ laas_topic_count_usage: Optional[int] = None
+ """LaaS Topics Count usage"""
+
+ loadbalancer_count_limit: Optional[int] = None
+ """Load Balancers Count limit"""
+
+ loadbalancer_count_requested: Optional[int] = None
+ """Load Balancers Count requested"""
+
+ loadbalancer_count_usage: Optional[int] = None
+ """Load Balancers Count usage"""
+
+ ram_limit: Optional[int] = None
+ """RAM Size, MiB limit"""
+
+ ram_requested: Optional[int] = None
+ """RAM Size, MiB requested"""
+
+ ram_usage: Optional[int] = None
+ """RAM Size, MiB usage"""
+
+ servergroup_count_limit: Optional[int] = None
+ """Placement Group Count limit"""
+
+ servergroup_count_requested: Optional[int] = None
+ """Placement Group Count requested"""
+
+ servergroup_count_usage: Optional[int] = None
+ """Placement Group Count usage"""
+
+ vm_count_limit: Optional[int] = None
+ """VMs Count limit"""
+
+ vm_count_requested: Optional[int] = None
+ """VMs Count requested"""
+
+ vm_count_usage: Optional[int] = None
+ """VMs Count usage"""
+
+ volume_count_limit: Optional[int] = None
+ """Volumes Count limit"""
+
+ volume_count_requested: Optional[int] = None
+ """Volumes Count requested"""
+
+ volume_count_usage: Optional[int] = None
+ """Volumes Count usage"""
+
+ volume_size_limit: Optional[int] = None
+ """Volumes Size, GiB limit"""
+
+ volume_size_requested: Optional[int] = None
+ """Volumes Size, GiB requested"""
+
+ volume_size_usage: Optional[int] = None
+ """Volumes Size, GiB usage"""
diff --git a/src/gcore/types/cloud/k8s/clusters/pool_check_quota_params.py b/src/gcore/types/cloud/k8s/clusters/pool_check_quota_params.py
new file mode 100644
index 00000000..06880774
--- /dev/null
+++ b/src/gcore/types/cloud/k8s/clusters/pool_check_quota_params.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["PoolCheckQuotaParams"]
+
+
+class PoolCheckQuotaParams(TypedDict, total=False):
+ project_id: int
+ """Project ID"""
+
+ region_id: int
+ """Region ID"""
+
+ flavor_id: Required[str]
+ """Flavor ID"""
+
+ boot_volume_size: Optional[int]
+ """Boot volume size"""
+
+ max_node_count: Optional[int]
+ """Maximum node count"""
+
+ min_node_count: Optional[int]
+ """Minimum node count"""
+
+ name: Optional[str]
+ """Name of the cluster pool"""
+
+ node_count: Optional[int]
+ """Maximum node count"""
+
+ servergroup_policy: Optional[Literal["affinity", "anti-affinity", "soft-anti-affinity"]]
+ """Server group policy: anti-affinity, soft-anti-affinity or affinity"""
diff --git a/tests/api_resources/cloud/k8s/clusters/test_pools.py b/tests/api_resources/cloud/k8s/clusters/test_pools.py
index 214fa14e..bc2d028a 100644
--- a/tests/api_resources/cloud/k8s/clusters/test_pools.py
+++ b/tests/api_resources/cloud/k8s/clusters/test_pools.py
@@ -13,6 +13,7 @@
from gcore.types.cloud.k8s.clusters import (
K8SClusterPool,
K8SClusterPoolList,
+ K8SClusterPoolQuota,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -279,6 +280,58 @@ def test_path_params_delete(self, client: Gcore) -> None:
cluster_name="cluster_name",
)
+ @parametrize
+ def test_method_check_quota(self, client: Gcore) -> None:
+ pool = client.cloud.k8s.clusters.pools.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ )
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ @parametrize
+ def test_method_check_quota_with_all_params(self, client: Gcore) -> None:
+ pool = client.cloud.k8s.clusters.pools.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ boot_volume_size=50,
+ max_node_count=5,
+ min_node_count=3,
+ name="test",
+ node_count=5,
+ servergroup_policy="anti-affinity",
+ )
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ @parametrize
+ def test_raw_response_check_quota(self, client: Gcore) -> None:
+ response = client.cloud.k8s.clusters.pools.with_raw_response.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ pool = response.parse()
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ @parametrize
+ def test_streaming_response_check_quota(self, client: Gcore) -> None:
+ with client.cloud.k8s.clusters.pools.with_streaming_response.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ pool = response.parse()
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
def test_method_get(self, client: Gcore) -> None:
pool = client.cloud.k8s.clusters.pools.get(
@@ -664,6 +717,58 @@ async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
cluster_name="cluster_name",
)
+ @parametrize
+ async def test_method_check_quota(self, async_client: AsyncGcore) -> None:
+ pool = await async_client.cloud.k8s.clusters.pools.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ )
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ @parametrize
+ async def test_method_check_quota_with_all_params(self, async_client: AsyncGcore) -> None:
+ pool = await async_client.cloud.k8s.clusters.pools.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ boot_volume_size=50,
+ max_node_count=5,
+ min_node_count=3,
+ name="test",
+ node_count=5,
+ servergroup_policy="anti-affinity",
+ )
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ @parametrize
+ async def test_raw_response_check_quota(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.k8s.clusters.pools.with_raw_response.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ pool = await response.parse()
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_check_quota(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.k8s.clusters.pools.with_streaming_response.check_quota(
+ project_id=1,
+ region_id=7,
+ flavor_id="g1-standard-1-2",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ pool = await response.parse()
+ assert_matches_type(K8SClusterPoolQuota, pool, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
async def test_method_get(self, async_client: AsyncGcore) -> None:
pool = await async_client.cloud.k8s.clusters.pools.get(
From b7c0fdde8c38c20a8cf3d35a7457862758046739 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 15 Dec 2025 16:13:13 +0000
Subject: [PATCH 02/14] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e84f2b46..6aabaa4f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-739b0d84ccefaa883a2334ad16738cc87ec625ded28ee0e2e11781f17ba36580.yml
-openapi_spec_hash: deb6a4c127edd808cfd8c8eb9eb9610b
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-049015d30ae7be5a2516de85e7676067a73a19ac93bb7466fe755fa02a50e455.yml
+openapi_spec_hash: 76630a1cbcc682a5654a85734d0d2ec9
config_hash: c6c8ef25ca05ecd4082810d4afd564cf
From 7d81efb323f72cdcaed3faa59a4fc5182f0fedab Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 15 Dec 2025 19:19:15 +0000
Subject: [PATCH 03/14] chore(internal): add missing files argument to base
client
---
src/gcore/_base_client.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/gcore/_base_client.py b/src/gcore/_base_client.py
index b68aa376..dbb20c58 100644
--- a/src/gcore/_base_client.py
+++ b/src/gcore/_base_client.py
@@ -1247,9 +1247,12 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
+ opts = FinalRequestOptions.construct(
+ method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
+ )
return self.request(cast_to, opts)
def put(
@@ -1767,9 +1770,12 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
+ opts = FinalRequestOptions.construct(
+ method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
+ )
return await self.request(cast_to, opts)
async def put(
From 5a5bbc3cfb2274bbf457981372e5cd04b6e46668 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 16 Dec 2025 10:12:03 +0000
Subject: [PATCH 04/14] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 6aabaa4f..4e82abb7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-049015d30ae7be5a2516de85e7676067a73a19ac93bb7466fe755fa02a50e455.yml
-openapi_spec_hash: 76630a1cbcc682a5654a85734d0d2ec9
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-36971faed5b11c78add3bd18144c9e7374da2cb07cdff440b9866fda9b8740a4.yml
+openapi_spec_hash: 0edd74ac0c1bf1c36807d1549d770d38
config_hash: c6c8ef25ca05ecd4082810d4afd564cf
From 9b2d50524b65101a610881af1dd248b7256d3049 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 16 Dec 2025 15:26:25 +0000
Subject: [PATCH 05/14] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 4e82abb7..1628a0a6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-36971faed5b11c78add3bd18144c9e7374da2cb07cdff440b9866fda9b8740a4.yml
-openapi_spec_hash: 0edd74ac0c1bf1c36807d1549d770d38
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-d3062187985fbeaf2d7852a622344a75a8a87e0e941743194c44f74ee0222dbb.yml
+openapi_spec_hash: 01b0048f185d3ceb84fe75a52a27afc8
config_hash: c6c8ef25ca05ecd4082810d4afd564cf
From ff1db23e58ffc5e118bd1fed3585ffc0cd04855e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 16 Dec 2025 17:20:56 +0000
Subject: [PATCH 06/14] chore: speedup initial import
---
src/gcore/_client.py | 456 +++++++++++++++++++++++++-------
src/gcore/resources/__init__.py | 130 ---------
2 files changed, 364 insertions(+), 222 deletions(-)
diff --git a/src/gcore/_client.py b/src/gcore/_client.py
index d900f571..4bd616d2 100644
--- a/src/gcore/_client.py
+++ b/src/gcore/_client.py
@@ -3,7 +3,7 @@
from __future__ import annotations
import os
-from typing import Any, Mapping
+from typing import TYPE_CHECKING, Any, Mapping
from typing_extensions import Self, override
import httpx
@@ -20,6 +20,7 @@
not_given,
)
from ._utils import is_given, get_async_library, maybe_coerce_integer
+from ._compat import cached_property
from ._version import __version__
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import GcoreError, APIStatusError
@@ -28,32 +29,23 @@
SyncAPIClient,
AsyncAPIClient,
)
-from .resources.cdn import cdn
-from .resources.dns import dns
-from .resources.iam import iam
-from .resources.waap import waap
-from .resources.cloud import cloud
-from .resources.storage import storage
-from .resources.fastedge import fastedge
-from .resources.security import security
-from .resources.streaming import streaming
+
+if TYPE_CHECKING:
+ from .resources import cdn, dns, iam, waap, cloud, storage, fastedge, security, streaming
+ from .resources.cdn.cdn import CdnResource, AsyncCdnResource
+ from .resources.dns.dns import DNSResource, AsyncDNSResource
+ from .resources.iam.iam import IamResource, AsyncIamResource
+ from .resources.waap.waap import WaapResource, AsyncWaapResource
+ from .resources.cloud.cloud import CloudResource, AsyncCloudResource
+ from .resources.storage.storage import StorageResource, AsyncStorageResource
+ from .resources.fastedge.fastedge import FastedgeResource, AsyncFastedgeResource
+ from .resources.security.security import SecurityResource, AsyncSecurityResource
+ from .resources.streaming.streaming import StreamingResource, AsyncStreamingResource
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gcore", "AsyncGcore", "Client", "AsyncClient"]
class Gcore(SyncAPIClient):
- cloud: cloud.CloudResource
- waap: waap.WaapResource
- iam: iam.IamResource
- fastedge: fastedge.FastedgeResource
- streaming: streaming.StreamingResource
- security: security.SecurityResource
- dns: dns.DNSResource
- storage: storage.StorageResource
- cdn: cdn.CdnResource
- with_raw_response: GcoreWithRawResponse
- with_streaming_response: GcoreWithStreamedResponse
-
# client options
api_key: str
cloud_project_id: int | None
@@ -135,17 +127,67 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.cloud = cloud.CloudResource(self)
- self.waap = waap.WaapResource(self)
- self.iam = iam.IamResource(self)
- self.fastedge = fastedge.FastedgeResource(self)
- self.streaming = streaming.StreamingResource(self)
- self.security = security.SecurityResource(self)
- self.dns = dns.DNSResource(self)
- self.storage = storage.StorageResource(self)
- self.cdn = cdn.CdnResource(self)
- self.with_raw_response = GcoreWithRawResponse(self)
- self.with_streaming_response = GcoreWithStreamedResponse(self)
+ @cached_property
+ def cloud(self) -> CloudResource:
+ from .resources.cloud import CloudResource
+
+ return CloudResource(self)
+
+ @cached_property
+ def waap(self) -> WaapResource:
+ from .resources.waap import WaapResource
+
+ return WaapResource(self)
+
+ @cached_property
+ def iam(self) -> IamResource:
+ from .resources.iam import IamResource
+
+ return IamResource(self)
+
+ @cached_property
+ def fastedge(self) -> FastedgeResource:
+ from .resources.fastedge import FastedgeResource
+
+ return FastedgeResource(self)
+
+ @cached_property
+ def streaming(self) -> StreamingResource:
+ from .resources.streaming import StreamingResource
+
+ return StreamingResource(self)
+
+ @cached_property
+ def security(self) -> SecurityResource:
+ from .resources.security import SecurityResource
+
+ return SecurityResource(self)
+
+ @cached_property
+ def dns(self) -> DNSResource:
+ from .resources.dns import DNSResource
+
+ return DNSResource(self)
+
+ @cached_property
+ def storage(self) -> StorageResource:
+ from .resources.storage import StorageResource
+
+ return StorageResource(self)
+
+ @cached_property
+ def cdn(self) -> CdnResource:
+ from .resources.cdn import CdnResource
+
+ return CdnResource(self)
+
+ @cached_property
+ def with_raw_response(self) -> GcoreWithRawResponse:
+ return GcoreWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> GcoreWithStreamedResponse:
+ return GcoreWithStreamedResponse(self)
@property
@override
@@ -279,18 +321,6 @@ def _make_status_error(
class AsyncGcore(AsyncAPIClient):
- cloud: cloud.AsyncCloudResource
- waap: waap.AsyncWaapResource
- iam: iam.AsyncIamResource
- fastedge: fastedge.AsyncFastedgeResource
- streaming: streaming.AsyncStreamingResource
- security: security.AsyncSecurityResource
- dns: dns.AsyncDNSResource
- storage: storage.AsyncStorageResource
- cdn: cdn.AsyncCdnResource
- with_raw_response: AsyncGcoreWithRawResponse
- with_streaming_response: AsyncGcoreWithStreamedResponse
-
# client options
api_key: str
cloud_project_id: int | None
@@ -372,17 +402,67 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.cloud = cloud.AsyncCloudResource(self)
- self.waap = waap.AsyncWaapResource(self)
- self.iam = iam.AsyncIamResource(self)
- self.fastedge = fastedge.AsyncFastedgeResource(self)
- self.streaming = streaming.AsyncStreamingResource(self)
- self.security = security.AsyncSecurityResource(self)
- self.dns = dns.AsyncDNSResource(self)
- self.storage = storage.AsyncStorageResource(self)
- self.cdn = cdn.AsyncCdnResource(self)
- self.with_raw_response = AsyncGcoreWithRawResponse(self)
- self.with_streaming_response = AsyncGcoreWithStreamedResponse(self)
+ @cached_property
+ def cloud(self) -> AsyncCloudResource:
+ from .resources.cloud import AsyncCloudResource
+
+ return AsyncCloudResource(self)
+
+ @cached_property
+ def waap(self) -> AsyncWaapResource:
+ from .resources.waap import AsyncWaapResource
+
+ return AsyncWaapResource(self)
+
+ @cached_property
+ def iam(self) -> AsyncIamResource:
+ from .resources.iam import AsyncIamResource
+
+ return AsyncIamResource(self)
+
+ @cached_property
+ def fastedge(self) -> AsyncFastedgeResource:
+ from .resources.fastedge import AsyncFastedgeResource
+
+ return AsyncFastedgeResource(self)
+
+ @cached_property
+ def streaming(self) -> AsyncStreamingResource:
+ from .resources.streaming import AsyncStreamingResource
+
+ return AsyncStreamingResource(self)
+
+ @cached_property
+ def security(self) -> AsyncSecurityResource:
+ from .resources.security import AsyncSecurityResource
+
+ return AsyncSecurityResource(self)
+
+ @cached_property
+ def dns(self) -> AsyncDNSResource:
+ from .resources.dns import AsyncDNSResource
+
+ return AsyncDNSResource(self)
+
+ @cached_property
+ def storage(self) -> AsyncStorageResource:
+ from .resources.storage import AsyncStorageResource
+
+ return AsyncStorageResource(self)
+
+ @cached_property
+ def cdn(self) -> AsyncCdnResource:
+ from .resources.cdn import AsyncCdnResource
+
+ return AsyncCdnResource(self)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncGcoreWithRawResponse:
+ return AsyncGcoreWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncGcoreWithStreamedResponse:
+ return AsyncGcoreWithStreamedResponse(self)
@property
@override
@@ -516,55 +596,247 @@ def _make_status_error(
class GcoreWithRawResponse:
+ _client: Gcore
+
def __init__(self, client: Gcore) -> None:
- self.cloud = cloud.CloudResourceWithRawResponse(client.cloud)
- self.waap = waap.WaapResourceWithRawResponse(client.waap)
- self.iam = iam.IamResourceWithRawResponse(client.iam)
- self.fastedge = fastedge.FastedgeResourceWithRawResponse(client.fastedge)
- self.streaming = streaming.StreamingResourceWithRawResponse(client.streaming)
- self.security = security.SecurityResourceWithRawResponse(client.security)
- self.dns = dns.DNSResourceWithRawResponse(client.dns)
- self.storage = storage.StorageResourceWithRawResponse(client.storage)
- self.cdn = cdn.CdnResourceWithRawResponse(client.cdn)
+ self._client = client
+
+ @cached_property
+ def cloud(self) -> cloud.CloudResourceWithRawResponse:
+ from .resources.cloud import CloudResourceWithRawResponse
+
+ return CloudResourceWithRawResponse(self._client.cloud)
+
+ @cached_property
+ def waap(self) -> waap.WaapResourceWithRawResponse:
+ from .resources.waap import WaapResourceWithRawResponse
+
+ return WaapResourceWithRawResponse(self._client.waap)
+
+ @cached_property
+ def iam(self) -> iam.IamResourceWithRawResponse:
+ from .resources.iam import IamResourceWithRawResponse
+
+ return IamResourceWithRawResponse(self._client.iam)
+
+ @cached_property
+ def fastedge(self) -> fastedge.FastedgeResourceWithRawResponse:
+ from .resources.fastedge import FastedgeResourceWithRawResponse
+
+ return FastedgeResourceWithRawResponse(self._client.fastedge)
+
+ @cached_property
+ def streaming(self) -> streaming.StreamingResourceWithRawResponse:
+ from .resources.streaming import StreamingResourceWithRawResponse
+
+ return StreamingResourceWithRawResponse(self._client.streaming)
+
+ @cached_property
+ def security(self) -> security.SecurityResourceWithRawResponse:
+ from .resources.security import SecurityResourceWithRawResponse
+
+ return SecurityResourceWithRawResponse(self._client.security)
+
+ @cached_property
+ def dns(self) -> dns.DNSResourceWithRawResponse:
+ from .resources.dns import DNSResourceWithRawResponse
+
+ return DNSResourceWithRawResponse(self._client.dns)
+
+ @cached_property
+ def storage(self) -> storage.StorageResourceWithRawResponse:
+ from .resources.storage import StorageResourceWithRawResponse
+
+ return StorageResourceWithRawResponse(self._client.storage)
+
+ @cached_property
+ def cdn(self) -> cdn.CdnResourceWithRawResponse:
+ from .resources.cdn import CdnResourceWithRawResponse
+
+ return CdnResourceWithRawResponse(self._client.cdn)
class AsyncGcoreWithRawResponse:
+ _client: AsyncGcore
+
def __init__(self, client: AsyncGcore) -> None:
- self.cloud = cloud.AsyncCloudResourceWithRawResponse(client.cloud)
- self.waap = waap.AsyncWaapResourceWithRawResponse(client.waap)
- self.iam = iam.AsyncIamResourceWithRawResponse(client.iam)
- self.fastedge = fastedge.AsyncFastedgeResourceWithRawResponse(client.fastedge)
- self.streaming = streaming.AsyncStreamingResourceWithRawResponse(client.streaming)
- self.security = security.AsyncSecurityResourceWithRawResponse(client.security)
- self.dns = dns.AsyncDNSResourceWithRawResponse(client.dns)
- self.storage = storage.AsyncStorageResourceWithRawResponse(client.storage)
- self.cdn = cdn.AsyncCdnResourceWithRawResponse(client.cdn)
+ self._client = client
+
+ @cached_property
+ def cloud(self) -> cloud.AsyncCloudResourceWithRawResponse:
+ from .resources.cloud import AsyncCloudResourceWithRawResponse
+
+ return AsyncCloudResourceWithRawResponse(self._client.cloud)
+
+ @cached_property
+ def waap(self) -> waap.AsyncWaapResourceWithRawResponse:
+ from .resources.waap import AsyncWaapResourceWithRawResponse
+
+ return AsyncWaapResourceWithRawResponse(self._client.waap)
+
+ @cached_property
+ def iam(self) -> iam.AsyncIamResourceWithRawResponse:
+ from .resources.iam import AsyncIamResourceWithRawResponse
+
+ return AsyncIamResourceWithRawResponse(self._client.iam)
+
+ @cached_property
+ def fastedge(self) -> fastedge.AsyncFastedgeResourceWithRawResponse:
+ from .resources.fastedge import AsyncFastedgeResourceWithRawResponse
+
+ return AsyncFastedgeResourceWithRawResponse(self._client.fastedge)
+
+ @cached_property
+ def streaming(self) -> streaming.AsyncStreamingResourceWithRawResponse:
+ from .resources.streaming import AsyncStreamingResourceWithRawResponse
+
+ return AsyncStreamingResourceWithRawResponse(self._client.streaming)
+
+ @cached_property
+ def security(self) -> security.AsyncSecurityResourceWithRawResponse:
+ from .resources.security import AsyncSecurityResourceWithRawResponse
+
+ return AsyncSecurityResourceWithRawResponse(self._client.security)
+
+ @cached_property
+ def dns(self) -> dns.AsyncDNSResourceWithRawResponse:
+ from .resources.dns import AsyncDNSResourceWithRawResponse
+
+ return AsyncDNSResourceWithRawResponse(self._client.dns)
+
+ @cached_property
+ def storage(self) -> storage.AsyncStorageResourceWithRawResponse:
+ from .resources.storage import AsyncStorageResourceWithRawResponse
+
+ return AsyncStorageResourceWithRawResponse(self._client.storage)
+
+ @cached_property
+ def cdn(self) -> cdn.AsyncCdnResourceWithRawResponse:
+ from .resources.cdn import AsyncCdnResourceWithRawResponse
+
+ return AsyncCdnResourceWithRawResponse(self._client.cdn)
class GcoreWithStreamedResponse:
+ _client: Gcore
+
def __init__(self, client: Gcore) -> None:
- self.cloud = cloud.CloudResourceWithStreamingResponse(client.cloud)
- self.waap = waap.WaapResourceWithStreamingResponse(client.waap)
- self.iam = iam.IamResourceWithStreamingResponse(client.iam)
- self.fastedge = fastedge.FastedgeResourceWithStreamingResponse(client.fastedge)
- self.streaming = streaming.StreamingResourceWithStreamingResponse(client.streaming)
- self.security = security.SecurityResourceWithStreamingResponse(client.security)
- self.dns = dns.DNSResourceWithStreamingResponse(client.dns)
- self.storage = storage.StorageResourceWithStreamingResponse(client.storage)
- self.cdn = cdn.CdnResourceWithStreamingResponse(client.cdn)
+ self._client = client
+
+ @cached_property
+ def cloud(self) -> cloud.CloudResourceWithStreamingResponse:
+ from .resources.cloud import CloudResourceWithStreamingResponse
+
+ return CloudResourceWithStreamingResponse(self._client.cloud)
+
+ @cached_property
+ def waap(self) -> waap.WaapResourceWithStreamingResponse:
+ from .resources.waap import WaapResourceWithStreamingResponse
+
+ return WaapResourceWithStreamingResponse(self._client.waap)
+
+ @cached_property
+ def iam(self) -> iam.IamResourceWithStreamingResponse:
+ from .resources.iam import IamResourceWithStreamingResponse
+
+ return IamResourceWithStreamingResponse(self._client.iam)
+
+ @cached_property
+ def fastedge(self) -> fastedge.FastedgeResourceWithStreamingResponse:
+ from .resources.fastedge import FastedgeResourceWithStreamingResponse
+
+ return FastedgeResourceWithStreamingResponse(self._client.fastedge)
+
+ @cached_property
+ def streaming(self) -> streaming.StreamingResourceWithStreamingResponse:
+ from .resources.streaming import StreamingResourceWithStreamingResponse
+
+ return StreamingResourceWithStreamingResponse(self._client.streaming)
+
+ @cached_property
+ def security(self) -> security.SecurityResourceWithStreamingResponse:
+ from .resources.security import SecurityResourceWithStreamingResponse
+
+ return SecurityResourceWithStreamingResponse(self._client.security)
+
+ @cached_property
+ def dns(self) -> dns.DNSResourceWithStreamingResponse:
+ from .resources.dns import DNSResourceWithStreamingResponse
+
+ return DNSResourceWithStreamingResponse(self._client.dns)
+
+ @cached_property
+ def storage(self) -> storage.StorageResourceWithStreamingResponse:
+ from .resources.storage import StorageResourceWithStreamingResponse
+
+ return StorageResourceWithStreamingResponse(self._client.storage)
+
+ @cached_property
+ def cdn(self) -> cdn.CdnResourceWithStreamingResponse:
+ from .resources.cdn import CdnResourceWithStreamingResponse
+
+ return CdnResourceWithStreamingResponse(self._client.cdn)
class AsyncGcoreWithStreamedResponse:
+ _client: AsyncGcore
+
def __init__(self, client: AsyncGcore) -> None:
- self.cloud = cloud.AsyncCloudResourceWithStreamingResponse(client.cloud)
- self.waap = waap.AsyncWaapResourceWithStreamingResponse(client.waap)
- self.iam = iam.AsyncIamResourceWithStreamingResponse(client.iam)
- self.fastedge = fastedge.AsyncFastedgeResourceWithStreamingResponse(client.fastedge)
- self.streaming = streaming.AsyncStreamingResourceWithStreamingResponse(client.streaming)
- self.security = security.AsyncSecurityResourceWithStreamingResponse(client.security)
- self.dns = dns.AsyncDNSResourceWithStreamingResponse(client.dns)
- self.storage = storage.AsyncStorageResourceWithStreamingResponse(client.storage)
- self.cdn = cdn.AsyncCdnResourceWithStreamingResponse(client.cdn)
+ self._client = client
+
+ @cached_property
+ def cloud(self) -> cloud.AsyncCloudResourceWithStreamingResponse:
+ from .resources.cloud import AsyncCloudResourceWithStreamingResponse
+
+ return AsyncCloudResourceWithStreamingResponse(self._client.cloud)
+
+ @cached_property
+ def waap(self) -> waap.AsyncWaapResourceWithStreamingResponse:
+ from .resources.waap import AsyncWaapResourceWithStreamingResponse
+
+ return AsyncWaapResourceWithStreamingResponse(self._client.waap)
+
+ @cached_property
+ def iam(self) -> iam.AsyncIamResourceWithStreamingResponse:
+ from .resources.iam import AsyncIamResourceWithStreamingResponse
+
+ return AsyncIamResourceWithStreamingResponse(self._client.iam)
+
+ @cached_property
+ def fastedge(self) -> fastedge.AsyncFastedgeResourceWithStreamingResponse:
+ from .resources.fastedge import AsyncFastedgeResourceWithStreamingResponse
+
+ return AsyncFastedgeResourceWithStreamingResponse(self._client.fastedge)
+
+ @cached_property
+ def streaming(self) -> streaming.AsyncStreamingResourceWithStreamingResponse:
+ from .resources.streaming import AsyncStreamingResourceWithStreamingResponse
+
+ return AsyncStreamingResourceWithStreamingResponse(self._client.streaming)
+
+ @cached_property
+ def security(self) -> security.AsyncSecurityResourceWithStreamingResponse:
+ from .resources.security import AsyncSecurityResourceWithStreamingResponse
+
+ return AsyncSecurityResourceWithStreamingResponse(self._client.security)
+
+ @cached_property
+ def dns(self) -> dns.AsyncDNSResourceWithStreamingResponse:
+ from .resources.dns import AsyncDNSResourceWithStreamingResponse
+
+ return AsyncDNSResourceWithStreamingResponse(self._client.dns)
+
+ @cached_property
+ def storage(self) -> storage.AsyncStorageResourceWithStreamingResponse:
+ from .resources.storage import AsyncStorageResourceWithStreamingResponse
+
+ return AsyncStorageResourceWithStreamingResponse(self._client.storage)
+
+ @cached_property
+ def cdn(self) -> cdn.AsyncCdnResourceWithStreamingResponse:
+ from .resources.cdn import AsyncCdnResourceWithStreamingResponse
+
+ return AsyncCdnResourceWithStreamingResponse(self._client.cdn)
Client = Gcore
diff --git a/src/gcore/resources/__init__.py b/src/gcore/resources/__init__.py
index c8aaa6a7..fd8019a9 100644
--- a/src/gcore/resources/__init__.py
+++ b/src/gcore/resources/__init__.py
@@ -1,131 +1 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from .cdn import (
- CdnResource,
- AsyncCdnResource,
- CdnResourceWithRawResponse,
- AsyncCdnResourceWithRawResponse,
- CdnResourceWithStreamingResponse,
- AsyncCdnResourceWithStreamingResponse,
-)
-from .dns import (
- DNSResource,
- AsyncDNSResource,
- DNSResourceWithRawResponse,
- AsyncDNSResourceWithRawResponse,
- DNSResourceWithStreamingResponse,
- AsyncDNSResourceWithStreamingResponse,
-)
-from .iam import (
- IamResource,
- AsyncIamResource,
- IamResourceWithRawResponse,
- AsyncIamResourceWithRawResponse,
- IamResourceWithStreamingResponse,
- AsyncIamResourceWithStreamingResponse,
-)
-from .waap import (
- WaapResource,
- AsyncWaapResource,
- WaapResourceWithRawResponse,
- AsyncWaapResourceWithRawResponse,
- WaapResourceWithStreamingResponse,
- AsyncWaapResourceWithStreamingResponse,
-)
-from .cloud import (
- CloudResource,
- AsyncCloudResource,
- CloudResourceWithRawResponse,
- AsyncCloudResourceWithRawResponse,
- CloudResourceWithStreamingResponse,
- AsyncCloudResourceWithStreamingResponse,
-)
-from .storage import (
- StorageResource,
- AsyncStorageResource,
- StorageResourceWithRawResponse,
- AsyncStorageResourceWithRawResponse,
- StorageResourceWithStreamingResponse,
- AsyncStorageResourceWithStreamingResponse,
-)
-from .fastedge import (
- FastedgeResource,
- AsyncFastedgeResource,
- FastedgeResourceWithRawResponse,
- AsyncFastedgeResourceWithRawResponse,
- FastedgeResourceWithStreamingResponse,
- AsyncFastedgeResourceWithStreamingResponse,
-)
-from .security import (
- SecurityResource,
- AsyncSecurityResource,
- SecurityResourceWithRawResponse,
- AsyncSecurityResourceWithRawResponse,
- SecurityResourceWithStreamingResponse,
- AsyncSecurityResourceWithStreamingResponse,
-)
-from .streaming import (
- StreamingResource,
- AsyncStreamingResource,
- StreamingResourceWithRawResponse,
- AsyncStreamingResourceWithRawResponse,
- StreamingResourceWithStreamingResponse,
- AsyncStreamingResourceWithStreamingResponse,
-)
-
-__all__ = [
- "CloudResource",
- "AsyncCloudResource",
- "CloudResourceWithRawResponse",
- "AsyncCloudResourceWithRawResponse",
- "CloudResourceWithStreamingResponse",
- "AsyncCloudResourceWithStreamingResponse",
- "WaapResource",
- "AsyncWaapResource",
- "WaapResourceWithRawResponse",
- "AsyncWaapResourceWithRawResponse",
- "WaapResourceWithStreamingResponse",
- "AsyncWaapResourceWithStreamingResponse",
- "IamResource",
- "AsyncIamResource",
- "IamResourceWithRawResponse",
- "AsyncIamResourceWithRawResponse",
- "IamResourceWithStreamingResponse",
- "AsyncIamResourceWithStreamingResponse",
- "FastedgeResource",
- "AsyncFastedgeResource",
- "FastedgeResourceWithRawResponse",
- "AsyncFastedgeResourceWithRawResponse",
- "FastedgeResourceWithStreamingResponse",
- "AsyncFastedgeResourceWithStreamingResponse",
- "StreamingResource",
- "AsyncStreamingResource",
- "StreamingResourceWithRawResponse",
- "AsyncStreamingResourceWithRawResponse",
- "StreamingResourceWithStreamingResponse",
- "AsyncStreamingResourceWithStreamingResponse",
- "SecurityResource",
- "AsyncSecurityResource",
- "SecurityResourceWithRawResponse",
- "AsyncSecurityResourceWithRawResponse",
- "SecurityResourceWithStreamingResponse",
- "AsyncSecurityResourceWithStreamingResponse",
- "DNSResource",
- "AsyncDNSResource",
- "DNSResourceWithRawResponse",
- "AsyncDNSResourceWithRawResponse",
- "DNSResourceWithStreamingResponse",
- "AsyncDNSResourceWithStreamingResponse",
- "StorageResource",
- "AsyncStorageResource",
- "StorageResourceWithRawResponse",
- "AsyncStorageResourceWithRawResponse",
- "StorageResourceWithStreamingResponse",
- "AsyncStorageResourceWithStreamingResponse",
- "CdnResource",
- "AsyncCdnResource",
- "CdnResourceWithRawResponse",
- "AsyncCdnResourceWithRawResponse",
- "CdnResourceWithStreamingResponse",
- "AsyncCdnResourceWithStreamingResponse",
-]
From 789277a61a3ead490d9b8b0f439e0e21100036ba Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 10:11:29 +0000
Subject: [PATCH 07/14] feat(api): aggregated API specs update
---
.stats.yml | 4 +--
api.md | 2 +-
src/gcore/resources/dns/network_mappings.py | 16 +++------
src/gcore/types/dns/dns_mapping_entry.py | 4 +--
.../types/dns/dns_mapping_entry_param.py | 5 ++-
.../dns/network_mapping_create_params.py | 2 --
.../dns/network_mapping_replace_params.py | 5 +--
.../dns/test_network_mappings.py | 36 +++++++++----------
8 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 1628a0a6..cf556c22 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-d3062187985fbeaf2d7852a622344a75a8a87e0e941743194c44f74ee0222dbb.yml
-openapi_spec_hash: 01b0048f185d3ceb84fe75a52a27afc8
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-26212428643e136f317e84302b933a8f4c65f88cc78c254ed40ad1c0793341f2.yml
+openapi_spec_hash: 6907d8b360bddcbc5adaef5054eab10e
config_hash: c6c8ef25ca05ecd4082810d4afd564cf
diff --git a/api.md b/api.md
index f54b05d3..41beddd2 100644
--- a/api.md
+++ b/api.md
@@ -2156,7 +2156,7 @@ Methods:
- client.dns.network_mappings.get(id) -> DNSNetworkMapping
- client.dns.network_mappings.get_by_name(name) -> DNSNetworkMapping
- client.dns.network*mappings.import*() -> NetworkMappingImportResponse
-- client.dns.network_mappings.replace(path_id, \*\*params) -> object
+- client.dns.network_mappings.replace(id, \*\*params) -> object
# Storage
diff --git a/src/gcore/resources/dns/network_mappings.py b/src/gcore/resources/dns/network_mappings.py
index 1292d320..1feb1047 100644
--- a/src/gcore/resources/dns/network_mappings.py
+++ b/src/gcore/resources/dns/network_mappings.py
@@ -51,7 +51,6 @@ def with_streaming_response(self) -> NetworkMappingsResourceWithStreamingRespons
def create(
self,
*,
- id: int | Omit = omit,
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
name: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -112,7 +111,6 @@ def create(
"/dns/v2/network-mappings",
body=maybe_transform(
{
- "id": id,
"mapping": mapping,
"name": name,
},
@@ -388,9 +386,8 @@ def import_(
def replace(
self,
- path_id: int,
+ id: int,
*,
- body_id: int | Omit = omit,
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
name: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -446,10 +443,9 @@ def replace(
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._put(
- f"/dns/v2/network-mappings/{path_id}",
+ f"/dns/v2/network-mappings/{id}",
body=maybe_transform(
{
- "body_id": body_id,
"mapping": mapping,
"name": name,
},
@@ -485,7 +481,6 @@ def with_streaming_response(self) -> AsyncNetworkMappingsResourceWithStreamingRe
async def create(
self,
*,
- id: int | Omit = omit,
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
name: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -546,7 +541,6 @@ async def create(
"/dns/v2/network-mappings",
body=await async_maybe_transform(
{
- "id": id,
"mapping": mapping,
"name": name,
},
@@ -822,9 +816,8 @@ async def import_(
async def replace(
self,
- path_id: int,
+ id: int,
*,
- body_id: int | Omit = omit,
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
name: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -880,10 +873,9 @@ async def replace(
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._put(
- f"/dns/v2/network-mappings/{path_id}",
+ f"/dns/v2/network-mappings/{id}",
body=await async_maybe_transform(
{
- "body_id": body_id,
"mapping": mapping,
"name": name,
},
diff --git a/src/gcore/types/dns/dns_mapping_entry.py b/src/gcore/types/dns/dns_mapping_entry.py
index 8f96c644..5d8db17c 100644
--- a/src/gcore/types/dns/dns_mapping_entry.py
+++ b/src/gcore/types/dns/dns_mapping_entry.py
@@ -8,8 +8,8 @@
class DNSMappingEntry(BaseModel):
- cidr4: Optional[List[object]] = None
+ cidr4: Optional[List[str]] = None
- cidr6: Optional[List[object]] = None
+ cidr6: Optional[List[str]] = None
tags: Optional[List[str]] = None
diff --git a/src/gcore/types/dns/dns_mapping_entry_param.py b/src/gcore/types/dns/dns_mapping_entry_param.py
index 67942c37..d6504b98 100644
--- a/src/gcore/types/dns/dns_mapping_entry_param.py
+++ b/src/gcore/types/dns/dns_mapping_entry_param.py
@@ -2,7 +2,6 @@
from __future__ import annotations
-from typing import Iterable
from typing_extensions import TypedDict
from ..._types import SequenceNotStr
@@ -11,8 +10,8 @@
class DNSMappingEntryParam(TypedDict, total=False):
- cidr4: Iterable[object]
+ cidr4: SequenceNotStr[str]
- cidr6: Iterable[object]
+ cidr6: SequenceNotStr[str]
tags: SequenceNotStr[str]
diff --git a/src/gcore/types/dns/network_mapping_create_params.py b/src/gcore/types/dns/network_mapping_create_params.py
index 2b82ed34..d670478a 100644
--- a/src/gcore/types/dns/network_mapping_create_params.py
+++ b/src/gcore/types/dns/network_mapping_create_params.py
@@ -11,8 +11,6 @@
class NetworkMappingCreateParams(TypedDict, total=False):
- id: int
-
mapping: Iterable[DNSMappingEntryParam]
name: str
diff --git a/src/gcore/types/dns/network_mapping_replace_params.py b/src/gcore/types/dns/network_mapping_replace_params.py
index cb10d570..7e7d7b2e 100644
--- a/src/gcore/types/dns/network_mapping_replace_params.py
+++ b/src/gcore/types/dns/network_mapping_replace_params.py
@@ -3,17 +3,14 @@
from __future__ import annotations
from typing import Iterable
-from typing_extensions import Annotated, TypedDict
+from typing_extensions import TypedDict
-from ..._utils import PropertyInfo
from .dns_mapping_entry_param import DNSMappingEntryParam
__all__ = ["NetworkMappingReplaceParams"]
class NetworkMappingReplaceParams(TypedDict, total=False):
- body_id: Annotated[int, PropertyInfo(alias="id")]
-
mapping: Iterable[DNSMappingEntryParam]
name: str
diff --git a/tests/api_resources/dns/test_network_mappings.py b/tests/api_resources/dns/test_network_mappings.py
index 7f7e164a..158a3f7b 100644
--- a/tests/api_resources/dns/test_network_mappings.py
+++ b/tests/api_resources/dns/test_network_mappings.py
@@ -30,11 +30,10 @@ def test_method_create(self, client: Gcore) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Gcore) -> None:
network_mapping = client.dns.network_mappings.create(
- id=0,
mapping=[
{
- "cidr4": [{}],
- "cidr6": [{}],
+ "cidr4": ["string"],
+ "cidr6": ["string"],
"tags": ["string"],
}
],
@@ -225,19 +224,18 @@ def test_streaming_response_import(self, client: Gcore) -> None:
@parametrize
def test_method_replace(self, client: Gcore) -> None:
network_mapping = client.dns.network_mappings.replace(
- path_id=0,
+ id=0,
)
assert_matches_type(object, network_mapping, path=["response"])
@parametrize
def test_method_replace_with_all_params(self, client: Gcore) -> None:
network_mapping = client.dns.network_mappings.replace(
- path_id=0,
- body_id=0,
+ id=0,
mapping=[
{
- "cidr4": [{}],
- "cidr6": [{}],
+ "cidr4": ["string"],
+ "cidr6": ["string"],
"tags": ["string"],
}
],
@@ -248,7 +246,7 @@ def test_method_replace_with_all_params(self, client: Gcore) -> None:
@parametrize
def test_raw_response_replace(self, client: Gcore) -> None:
response = client.dns.network_mappings.with_raw_response.replace(
- path_id=0,
+ id=0,
)
assert response.is_closed is True
@@ -259,7 +257,7 @@ def test_raw_response_replace(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_replace(self, client: Gcore) -> None:
with client.dns.network_mappings.with_streaming_response.replace(
- path_id=0,
+ id=0,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -283,11 +281,10 @@ async def test_method_create(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
network_mapping = await async_client.dns.network_mappings.create(
- id=0,
mapping=[
{
- "cidr4": [{}],
- "cidr6": [{}],
+ "cidr4": ["string"],
+ "cidr6": ["string"],
"tags": ["string"],
}
],
@@ -478,19 +475,18 @@ async def test_streaming_response_import(self, async_client: AsyncGcore) -> None
@parametrize
async def test_method_replace(self, async_client: AsyncGcore) -> None:
network_mapping = await async_client.dns.network_mappings.replace(
- path_id=0,
+ id=0,
)
assert_matches_type(object, network_mapping, path=["response"])
@parametrize
async def test_method_replace_with_all_params(self, async_client: AsyncGcore) -> None:
network_mapping = await async_client.dns.network_mappings.replace(
- path_id=0,
- body_id=0,
+ id=0,
mapping=[
{
- "cidr4": [{}],
- "cidr6": [{}],
+ "cidr4": ["string"],
+ "cidr6": ["string"],
"tags": ["string"],
}
],
@@ -501,7 +497,7 @@ async def test_method_replace_with_all_params(self, async_client: AsyncGcore) ->
@parametrize
async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
response = await async_client.dns.network_mappings.with_raw_response.replace(
- path_id=0,
+ id=0,
)
assert response.is_closed is True
@@ -512,7 +508,7 @@ async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_replace(self, async_client: AsyncGcore) -> None:
async with async_client.dns.network_mappings.with_streaming_response.replace(
- path_id=0,
+ id=0,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
From 88c4050f59d8a55796ab553a60b1e55aaadc81ca Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 15:48:39 +0000
Subject: [PATCH 08/14] fix: use async_to_httpx_files in patch method
---
src/gcore/_base_client.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gcore/_base_client.py b/src/gcore/_base_client.py
index dbb20c58..56aeddf3 100644
--- a/src/gcore/_base_client.py
+++ b/src/gcore/_base_client.py
@@ -1774,7 +1774,7 @@ async def patch(
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(
- method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
+ method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
)
return await self.request(cast_to, opts)
From 3a272e8b9a0399be48094ce82cc9127e59a2867a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 18 Dec 2025 14:11:46 +0000
Subject: [PATCH 09/14] feat(api): aggregated API specs update
---
.stats.yml | 4 ++--
.../resources/cloud/load_balancers/listeners.py | 12 ++++++++++--
src/gcore/types/cloud/gpu_baremetal_cluster.py | 3 +++
.../cloud/load_balancers/listener_create_params.py | 5 ++++-
.../cloud/load_balancers/test_listeners.py | 2 ++
5 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index cf556c22..8dc34720 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-26212428643e136f317e84302b933a8f4c65f88cc78c254ed40ad1c0793341f2.yml
-openapi_spec_hash: 6907d8b360bddcbc5adaef5054eab10e
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-2c3abe1f1637f97f6bc750aff6eb77efc45ac2b527376541ac2af6b9626b35af.yml
+openapi_spec_hash: ff74a4ccd9ec5ddb1a65963d52e709ba
config_hash: c6c8ef25ca05ecd4082810d4afd564cf
diff --git a/src/gcore/resources/cloud/load_balancers/listeners.py b/src/gcore/resources/cloud/load_balancers/listeners.py
index 1e8c89e0..fe0177c0 100644
--- a/src/gcore/resources/cloud/load_balancers/listeners.py
+++ b/src/gcore/resources/cloud/load_balancers/listeners.py
@@ -64,6 +64,7 @@ def create(
protocol_port: int,
allowed_cidrs: Optional[SequenceNotStr[str]] | Omit = omit,
connection_limit: int | Omit = omit,
+ default_pool_id: str | Omit = omit,
insert_x_forwarded: bool | Omit = omit,
secret_id: str | Omit = omit,
sni_secret_id: SequenceNotStr[str] | Omit = omit,
@@ -86,7 +87,7 @@ def create(
region_id: Region ID
- load_balancer_id: Load balancer ID
+ load_balancer_id: ID of already existent Load Balancer.
name: Load balancer listener name
@@ -99,6 +100,8 @@ def create(
connection_limit: Limit of the simultaneous connections. If -1 is provided, it is translated to
the default value 100000.
+ default_pool_id: ID of already existent Load Balancer Pool to attach listener to.
+
insert_x_forwarded: Add headers X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto to requests.
Only used with HTTP or `TERMINATED_HTTPS` protocols.
@@ -138,6 +141,7 @@ def create(
"protocol_port": protocol_port,
"allowed_cidrs": allowed_cidrs,
"connection_limit": connection_limit,
+ "default_pool_id": default_pool_id,
"insert_x_forwarded": insert_x_forwarded,
"secret_id": secret_id,
"sni_secret_id": sni_secret_id,
@@ -604,6 +608,7 @@ async def create(
protocol_port: int,
allowed_cidrs: Optional[SequenceNotStr[str]] | Omit = omit,
connection_limit: int | Omit = omit,
+ default_pool_id: str | Omit = omit,
insert_x_forwarded: bool | Omit = omit,
secret_id: str | Omit = omit,
sni_secret_id: SequenceNotStr[str] | Omit = omit,
@@ -626,7 +631,7 @@ async def create(
region_id: Region ID
- load_balancer_id: Load balancer ID
+ load_balancer_id: ID of already existent Load Balancer.
name: Load balancer listener name
@@ -639,6 +644,8 @@ async def create(
connection_limit: Limit of the simultaneous connections. If -1 is provided, it is translated to
the default value 100000.
+ default_pool_id: ID of already existent Load Balancer Pool to attach listener to.
+
insert_x_forwarded: Add headers X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto to requests.
Only used with HTTP or `TERMINATED_HTTPS` protocols.
@@ -678,6 +685,7 @@ async def create(
"protocol_port": protocol_port,
"allowed_cidrs": allowed_cidrs,
"connection_limit": connection_limit,
+ "default_pool_id": default_pool_id,
"insert_x_forwarded": insert_x_forwarded,
"secret_id": secret_id,
"sni_secret_id": sni_secret_id,
diff --git a/src/gcore/types/cloud/gpu_baremetal_cluster.py b/src/gcore/types/cloud/gpu_baremetal_cluster.py
index 85bc978c..bfbdff15 100644
--- a/src/gcore/types/cloud/gpu_baremetal_cluster.py
+++ b/src/gcore/types/cloud/gpu_baremetal_cluster.py
@@ -131,6 +131,9 @@ class GPUBaremetalCluster(BaseModel):
flavor: str
"""Cluster flavor name"""
+ image_id: str
+ """Image ID"""
+
managed_by: Literal["k8s", "user"]
"""User type managing the resource"""
diff --git a/src/gcore/types/cloud/load_balancers/listener_create_params.py b/src/gcore/types/cloud/load_balancers/listener_create_params.py
index 9850d348..8dc00324 100644
--- a/src/gcore/types/cloud/load_balancers/listener_create_params.py
+++ b/src/gcore/types/cloud/load_balancers/listener_create_params.py
@@ -19,7 +19,7 @@ class ListenerCreateParams(TypedDict, total=False):
"""Region ID"""
load_balancer_id: Required[str]
- """Load balancer ID"""
+ """ID of already existent Load Balancer."""
name: Required[str]
"""Load balancer listener name"""
@@ -39,6 +39,9 @@ class ListenerCreateParams(TypedDict, total=False):
If -1 is provided, it is translated to the default value 100000.
"""
+ default_pool_id: str
+ """ID of already existent Load Balancer Pool to attach listener to."""
+
insert_x_forwarded: bool
"""Add headers X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto to requests.
diff --git a/tests/api_resources/cloud/load_balancers/test_listeners.py b/tests/api_resources/cloud/load_balancers/test_listeners.py
index 628a84f8..2e098f0f 100644
--- a/tests/api_resources/cloud/load_balancers/test_listeners.py
+++ b/tests/api_resources/cloud/load_balancers/test_listeners.py
@@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: Gcore) -> None:
protocol_port=80,
allowed_cidrs=["10.0.0.0/8"],
connection_limit=100000,
+ default_pool_id="00000000-0000-4000-8000-000000000000",
insert_x_forwarded=False,
secret_id="f2e734d0-fa2b-42c2-ad33-4c6db5101e00",
sni_secret_id=["f2e734d0-fa2b-42c2-ad33-4c6db5101e00", "eb121225-7ded-4ff3-ae1f-599e145dd7cb"],
@@ -343,6 +344,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) ->
protocol_port=80,
allowed_cidrs=["10.0.0.0/8"],
connection_limit=100000,
+ default_pool_id="00000000-0000-4000-8000-000000000000",
insert_x_forwarded=False,
secret_id="f2e734d0-fa2b-42c2-ad33-4c6db5101e00",
sni_secret_id=["f2e734d0-fa2b-42c2-ad33-4c6db5101e00", "eb121225-7ded-4ff3-ae1f-599e145dd7cb"],
From 3c38f4280bc1b57f987ff984c7504c4781d74ab8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 18 Dec 2025 22:24:18 +0000
Subject: [PATCH 10/14] chore(internal): codegen related update
---
scripts/lint | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/lint b/scripts/lint
index 3bb2d385..1d30512d 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -4,8 +4,13 @@ set -e
cd "$(dirname "$0")/.."
-echo "==> Running lints"
-rye run lint
+if [ "$1" = "--fix" ]; then
+ echo "==> Running lints with --fix"
+ rye run fix:ruff
+else
+ echo "==> Running lints"
+ rye run lint
+fi
echo "==> Making sure it imports"
rye run python -c 'import gcore'
From 85a03310d31fa3ac6b74897b8754a19bd905df75 Mon Sep 17 00:00:00 2001
From: Pedro Oliveira <8281907+pedrodeoliveira@users.noreply.github.com>
Date: Mon, 22 Dec 2025 16:49:16 +0000
Subject: [PATCH 11/14] fix(examples): make code consistent with comment
---
examples/cloud/audit_logs.py | 4 ++--
examples/cloud/audit_logs_async.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/examples/cloud/audit_logs.py b/examples/cloud/audit_logs.py
index 2dbdd2c9..5d9ff505 100644
--- a/examples/cloud/audit_logs.py
+++ b/examples/cloud/audit_logs.py
@@ -21,8 +21,8 @@ def main() -> None:
# Example: list the last 10 user actions of type 'create' in the 'instance' api_group from the last 7 days
from_time = (datetime.now(timezone.utc) - timedelta(days=7)).isoformat()
logs = gcore.cloud.audit_logs.list(
- # action_type=["create"],
- # api_group=["instance"],
+ action_type=["create"],
+ api_group=["instance"],
from_timestamp=from_time,
limit=10,
order_by="desc",
diff --git a/examples/cloud/audit_logs_async.py b/examples/cloud/audit_logs_async.py
index 8e56fa8d..994bb3b8 100644
--- a/examples/cloud/audit_logs_async.py
+++ b/examples/cloud/audit_logs_async.py
@@ -22,8 +22,8 @@ async def main() -> None:
# Example: list the last 10 user actions of type 'create' in the 'instance' api_group from the last 7 days
from_time = (datetime.now(timezone.utc) - timedelta(days=7)).isoformat()
logs = await gcore.cloud.audit_logs.list(
- # action_type=["create"],
- # api_group=["instance"],
+ action_type=["create"],
+ api_group=["instance"],
from_timestamp=from_time,
limit=10,
order_by="desc",
From 36b7b63d98a20c3927069bb396154b068304f321 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 23 Dec 2025 10:54:44 +0000
Subject: [PATCH 12/14] fix(cloud)!: restructure to be gpu_virtual.clusters
---
.stats.yml | 2 +-
api.md | 54 +--
src/gcore/resources/cloud/__init__.py | 28 +-
src/gcore/resources/cloud/cloud.py | 40 +-
.../resources/cloud/gpu_virtual/__init__.py | 33 ++
.../clusters}/__init__.py | 28 +-
.../clusters/clusters.py} | 192 ++++----
.../clusters}/flavors.py | 16 +-
.../clusters}/images.py | 20 +-
.../clusters}/interfaces.py | 12 +-
.../clusters}/servers.py | 18 +-
.../clusters}/volumes.py | 12 +-
.../cloud/gpu_virtual/gpu_virtual.py | 102 +++++
src/gcore/types/cloud/__init__.py | 6 -
src/gcore/types/cloud/gpu_virtual/__init__.py | 10 +
.../cluster_action_params.py} | 6 +-
.../cluster_create_params.py} | 4 +-
.../cluster_delete_params.py} | 6 +-
.../cluster_list_params.py} | 4 +-
.../cluster_update_params.py} | 4 +-
.../clusters}/__init__.py | 0
.../clusters}/flavor_list_params.py | 0
.../clusters}/gpu_virtual_cluster_server.py | 4 +-
.../gpu_virtual_cluster_server_list.py | 2 +-
.../clusters}/gpu_virtual_cluster_volume.py | 4 +-
.../gpu_virtual_cluster_volume_list.py | 2 +-
.../clusters}/gpu_virtual_flavor.py | 2 +-
.../clusters}/gpu_virtual_flavor_list.py | 2 +-
.../clusters}/gpu_virtual_interface.py | 10 +-
.../clusters}/gpu_virtual_interface_list.py | 2 +-
.../clusters}/image_upload_params.py | 0
.../clusters}/server_delete_params.py | 2 +-
.../clusters}/server_list_params.py | 4 +-
.../{ => gpu_virtual}/gpu_virtual_cluster.py | 6 +-
.../__init__.py | 0
.../cloud/gpu_virtual/clusters/__init__.py | 1 +
.../clusters}/test_flavors.py | 18 +-
.../clusters}/test_images.py | 60 +--
.../clusters}/test_interfaces.py | 18 +-
.../clusters}/test_servers.py | 46 +-
.../clusters}/test_volumes.py | 18 +-
.../test_clusters.py} | 420 +++++++++---------
42 files changed, 679 insertions(+), 539 deletions(-)
create mode 100644 src/gcore/resources/cloud/gpu_virtual/__init__.py
rename src/gcore/resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/__init__.py (80%)
rename src/gcore/resources/cloud/{gpu_virtual_clusters/gpu_virtual_clusters.py => gpu_virtual/clusters/clusters.py} (89%)
rename src/gcore/resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/flavors.py (93%)
rename src/gcore/resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/images.py (97%)
rename src/gcore/resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/interfaces.py (95%)
rename src/gcore/resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/servers.py (96%)
rename src/gcore/resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/volumes.py (94%)
create mode 100644 src/gcore/resources/cloud/gpu_virtual/gpu_virtual.py
create mode 100644 src/gcore/types/cloud/gpu_virtual/__init__.py
rename src/gcore/types/cloud/{gpu_virtual_cluster_action_params.py => gpu_virtual/cluster_action_params.py} (95%)
rename src/gcore/types/cloud/{gpu_virtual_cluster_create_params.py => gpu_virtual/cluster_create_params.py} (98%)
rename src/gcore/types/cloud/{gpu_virtual_cluster_delete_params.py => gpu_virtual/cluster_delete_params.py} (86%)
rename src/gcore/types/cloud/{gpu_virtual_cluster_list_params.py => gpu_virtual/cluster_list_params.py} (77%)
rename src/gcore/types/cloud/{gpu_virtual_cluster_update_params.py => gpu_virtual/cluster_update_params.py} (74%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/__init__.py (100%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/flavor_list_params.py (100%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_cluster_server.py (96%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_cluster_server_list.py (91%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_cluster_volume.py (95%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_cluster_volume_list.py (91%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_flavor.py (99%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_flavor_list.py (90%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_interface.py (96%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/gpu_virtual_interface_list.py (90%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/image_upload_params.py (100%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/server_delete_params.py (96%)
rename src/gcore/types/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/server_list_params.py (96%)
rename src/gcore/types/cloud/{ => gpu_virtual}/gpu_virtual_cluster.py (98%)
rename tests/api_resources/cloud/{gpu_virtual_clusters => gpu_virtual}/__init__.py (100%)
create mode 100644 tests/api_resources/cloud/gpu_virtual/clusters/__init__.py
rename tests/api_resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/test_flavors.py (86%)
rename tests/api_resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/test_images.py (87%)
rename tests/api_resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/test_interfaces.py (87%)
rename tests/api_resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/test_servers.py (88%)
rename tests/api_resources/cloud/{gpu_virtual_clusters => gpu_virtual/clusters}/test_volumes.py (87%)
rename tests/api_resources/cloud/{test_gpu_virtual_clusters.py => gpu_virtual/test_clusters.py} (73%)
diff --git a/.stats.yml b/.stats.yml
index 8dc34720..fc3e8dc4 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-2c3abe1f1637f97f6bc750aff6eb77efc45ac2b527376541ac2af6b9626b35af.yml
openapi_spec_hash: ff74a4ccd9ec5ddb1a65963d52e709ba
-config_hash: c6c8ef25ca05ecd4082810d4afd564cf
+config_hash: e76c698a64f32a4f2b33e2099e771d83
diff --git a/api.md b/api.md
index 41beddd2..bc132d4d 100644
--- a/api.md
+++ b/api.md
@@ -842,29 +842,31 @@ Methods:
- client.cloud.gpu_baremetal_clusters.images.get(image_id, \*, project_id, region_id) -> GPUImage
- client.cloud.gpu_baremetal_clusters.images.upload(\*, project_id, region_id, \*\*params) -> TaskIDList
-## GPUVirtualClusters
+## GPUVirtual
+
+### Clusters
Types:
```python
-from gcore.types.cloud import GPUVirtualCluster
+from gcore.types.cloud.gpu_virtual import GPUVirtualCluster
```
Methods:
-- client.cloud.gpu_virtual_clusters.create(\*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.gpu_virtual_clusters.update(cluster_id, \*, project_id, region_id, \*\*params) -> GPUVirtualCluster
-- client.cloud.gpu_virtual_clusters.list(\*, project_id, region_id, \*\*params) -> SyncOffsetPage[GPUVirtualCluster]
-- client.cloud.gpu_virtual_clusters.delete(cluster_id, \*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.gpu_virtual_clusters.action(cluster_id, \*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.gpu_virtual_clusters.get(cluster_id, \*, project_id, region_id) -> GPUVirtualCluster
+- client.cloud.gpu_virtual.clusters.create(\*, project_id, region_id, \*\*params) -> TaskIDList
+- client.cloud.gpu_virtual.clusters.update(cluster_id, \*, project_id, region_id, \*\*params) -> GPUVirtualCluster
+- client.cloud.gpu_virtual.clusters.list(\*, project_id, region_id, \*\*params) -> SyncOffsetPage[GPUVirtualCluster]
+- client.cloud.gpu_virtual.clusters.delete(cluster_id, \*, project_id, region_id, \*\*params) -> TaskIDList
+- client.cloud.gpu_virtual.clusters.action(cluster_id, \*, project_id, region_id, \*\*params) -> TaskIDList
+- client.cloud.gpu_virtual.clusters.get(cluster_id, \*, project_id, region_id) -> GPUVirtualCluster
-### Servers
+#### Servers
Types:
```python
-from gcore.types.cloud.gpu_virtual_clusters import (
+from gcore.types.cloud.gpu_virtual.clusters import (
GPUVirtualClusterServer,
GPUVirtualClusterServerList,
)
@@ -872,15 +874,15 @@ from gcore.types.cloud.gpu_virtual_clusters import (
Methods:
-- client.cloud.gpu_virtual_clusters.servers.list(cluster_id, \*, project_id, region_id, \*\*params) -> GPUVirtualClusterServerList
-- client.cloud.gpu_virtual_clusters.servers.delete(server_id, \*, project_id, region_id, cluster_id, \*\*params) -> TaskIDList
+- client.cloud.gpu_virtual.clusters.servers.list(cluster_id, \*, project_id, region_id, \*\*params) -> GPUVirtualClusterServerList
+- client.cloud.gpu_virtual.clusters.servers.delete(server_id, \*, project_id, region_id, cluster_id, \*\*params) -> TaskIDList
-### Volumes
+#### Volumes
Types:
```python
-from gcore.types.cloud.gpu_virtual_clusters import (
+from gcore.types.cloud.gpu_virtual.clusters import (
GPUVirtualClusterVolume,
GPUVirtualClusterVolumeList,
)
@@ -888,40 +890,40 @@ from gcore.types.cloud.gpu_virtual_clusters import (
Methods:
-- client.cloud.gpu_virtual_clusters.volumes.list(cluster_id, \*, project_id, region_id) -> GPUVirtualClusterVolumeList
+- client.cloud.gpu_virtual.clusters.volumes.list(cluster_id, \*, project_id, region_id) -> GPUVirtualClusterVolumeList
-### Interfaces
+#### Interfaces
Types:
```python
-from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualInterface, GPUVirtualInterfaceList
+from gcore.types.cloud.gpu_virtual.clusters import GPUVirtualInterface, GPUVirtualInterfaceList
```
Methods:
-- client.cloud.gpu_virtual_clusters.interfaces.list(cluster_id, \*, project_id, region_id) -> GPUVirtualInterfaceList
+- client.cloud.gpu_virtual.clusters.interfaces.list(cluster_id, \*, project_id, region_id) -> GPUVirtualInterfaceList
-### Flavors
+#### Flavors
Types:
```python
-from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualFlavor, GPUVirtualFlavorList
+from gcore.types.cloud.gpu_virtual.clusters import GPUVirtualFlavor, GPUVirtualFlavorList
```
Methods:
-- client.cloud.gpu_virtual_clusters.flavors.list(\*, project_id, region_id, \*\*params) -> GPUVirtualFlavorList
+- client.cloud.gpu_virtual.clusters.flavors.list(\*, project_id, region_id, \*\*params) -> GPUVirtualFlavorList
-### Images
+#### Images
Methods:
-- client.cloud.gpu_virtual_clusters.images.list(\*, project_id, region_id) -> GPUImageList
-- client.cloud.gpu_virtual_clusters.images.delete(image_id, \*, project_id, region_id) -> TaskIDList
-- client.cloud.gpu_virtual_clusters.images.get(image_id, \*, project_id, region_id) -> GPUImage
-- client.cloud.gpu_virtual_clusters.images.upload(\*, project_id, region_id, \*\*params) -> TaskIDList
+- client.cloud.gpu_virtual.clusters.images.list(\*, project_id, region_id) -> GPUImageList
+- client.cloud.gpu_virtual.clusters.images.delete(image_id, \*, project_id, region_id) -> TaskIDList
+- client.cloud.gpu_virtual.clusters.images.get(image_id, \*, project_id, region_id) -> GPUImage
+- client.cloud.gpu_virtual.clusters.images.upload(\*, project_id, region_id, \*\*params) -> TaskIDList
## Instances
diff --git a/src/gcore/resources/cloud/__init__.py b/src/gcore/resources/cloud/__init__.py
index aa77fd72..e4c125cc 100644
--- a/src/gcore/resources/cloud/__init__.py
+++ b/src/gcore/resources/cloud/__init__.py
@@ -152,6 +152,14 @@
FileSharesResourceWithStreamingResponse,
AsyncFileSharesResourceWithStreamingResponse,
)
+from .gpu_virtual import (
+ GPUVirtualResource,
+ AsyncGPUVirtualResource,
+ GPUVirtualResourceWithRawResponse,
+ AsyncGPUVirtualResourceWithRawResponse,
+ GPUVirtualResourceWithStreamingResponse,
+ AsyncGPUVirtualResourceWithStreamingResponse,
+)
from .cost_reports import (
CostReportsResource,
AsyncCostReportsResource,
@@ -216,14 +224,6 @@
BillingReservationsResourceWithStreamingResponse,
AsyncBillingReservationsResourceWithStreamingResponse,
)
-from .gpu_virtual_clusters import (
- GPUVirtualClustersResource,
- AsyncGPUVirtualClustersResource,
- GPUVirtualClustersResourceWithRawResponse,
- AsyncGPUVirtualClustersResourceWithRawResponse,
- GPUVirtualClustersResourceWithStreamingResponse,
- AsyncGPUVirtualClustersResourceWithStreamingResponse,
-)
from .gpu_baremetal_clusters import (
GPUBaremetalClustersResource,
AsyncGPUBaremetalClustersResource,
@@ -360,12 +360,12 @@
"AsyncGPUBaremetalClustersResourceWithRawResponse",
"GPUBaremetalClustersResourceWithStreamingResponse",
"AsyncGPUBaremetalClustersResourceWithStreamingResponse",
- "GPUVirtualClustersResource",
- "AsyncGPUVirtualClustersResource",
- "GPUVirtualClustersResourceWithRawResponse",
- "AsyncGPUVirtualClustersResourceWithRawResponse",
- "GPUVirtualClustersResourceWithStreamingResponse",
- "AsyncGPUVirtualClustersResourceWithStreamingResponse",
+ "GPUVirtualResource",
+ "AsyncGPUVirtualResource",
+ "GPUVirtualResourceWithRawResponse",
+ "AsyncGPUVirtualResourceWithRawResponse",
+ "GPUVirtualResourceWithStreamingResponse",
+ "AsyncGPUVirtualResourceWithStreamingResponse",
"InstancesResource",
"AsyncInstancesResource",
"InstancesResourceWithRawResponse",
diff --git a/src/gcore/resources/cloud/cloud.py b/src/gcore/resources/cloud/cloud.py
index 6147e663..9db7efd3 100644
--- a/src/gcore/resources/cloud/cloud.py
+++ b/src/gcore/resources/cloud/cloud.py
@@ -188,6 +188,14 @@
FileSharesResourceWithStreamingResponse,
AsyncFileSharesResourceWithStreamingResponse,
)
+from .gpu_virtual.gpu_virtual import (
+ GPUVirtualResource,
+ AsyncGPUVirtualResource,
+ GPUVirtualResourceWithRawResponse,
+ AsyncGPUVirtualResourceWithRawResponse,
+ GPUVirtualResourceWithStreamingResponse,
+ AsyncGPUVirtualResourceWithStreamingResponse,
+)
from .load_balancers.load_balancers import (
LoadBalancersResource,
AsyncLoadBalancersResource,
@@ -212,14 +220,6 @@
ReservedFixedIPsResourceWithStreamingResponse,
AsyncReservedFixedIPsResourceWithStreamingResponse,
)
-from .gpu_virtual_clusters.gpu_virtual_clusters import (
- GPUVirtualClustersResource,
- AsyncGPUVirtualClustersResource,
- GPUVirtualClustersResourceWithRawResponse,
- AsyncGPUVirtualClustersResourceWithRawResponse,
- GPUVirtualClustersResourceWithStreamingResponse,
- AsyncGPUVirtualClustersResourceWithStreamingResponse,
-)
from .gpu_baremetal_clusters.gpu_baremetal_clusters import (
GPUBaremetalClustersResource,
AsyncGPUBaremetalClustersResource,
@@ -325,8 +325,8 @@ def gpu_baremetal_clusters(self) -> GPUBaremetalClustersResource:
return GPUBaremetalClustersResource(self._client)
@cached_property
- def gpu_virtual_clusters(self) -> GPUVirtualClustersResource:
- return GPUVirtualClustersResource(self._client)
+ def gpu_virtual(self) -> GPUVirtualResource:
+ return GPUVirtualResource(self._client)
@cached_property
def instances(self) -> InstancesResource:
@@ -465,8 +465,8 @@ def gpu_baremetal_clusters(self) -> AsyncGPUBaremetalClustersResource:
return AsyncGPUBaremetalClustersResource(self._client)
@cached_property
- def gpu_virtual_clusters(self) -> AsyncGPUVirtualClustersResource:
- return AsyncGPUVirtualClustersResource(self._client)
+ def gpu_virtual(self) -> AsyncGPUVirtualResource:
+ return AsyncGPUVirtualResource(self._client)
@cached_property
def instances(self) -> AsyncInstancesResource:
@@ -608,8 +608,8 @@ def gpu_baremetal_clusters(self) -> GPUBaremetalClustersResourceWithRawResponse:
return GPUBaremetalClustersResourceWithRawResponse(self._cloud.gpu_baremetal_clusters)
@cached_property
- def gpu_virtual_clusters(self) -> GPUVirtualClustersResourceWithRawResponse:
- return GPUVirtualClustersResourceWithRawResponse(self._cloud.gpu_virtual_clusters)
+ def gpu_virtual(self) -> GPUVirtualResourceWithRawResponse:
+ return GPUVirtualResourceWithRawResponse(self._cloud.gpu_virtual)
@cached_property
def instances(self) -> InstancesResourceWithRawResponse:
@@ -732,8 +732,8 @@ def gpu_baremetal_clusters(self) -> AsyncGPUBaremetalClustersResourceWithRawResp
return AsyncGPUBaremetalClustersResourceWithRawResponse(self._cloud.gpu_baremetal_clusters)
@cached_property
- def gpu_virtual_clusters(self) -> AsyncGPUVirtualClustersResourceWithRawResponse:
- return AsyncGPUVirtualClustersResourceWithRawResponse(self._cloud.gpu_virtual_clusters)
+ def gpu_virtual(self) -> AsyncGPUVirtualResourceWithRawResponse:
+ return AsyncGPUVirtualResourceWithRawResponse(self._cloud.gpu_virtual)
@cached_property
def instances(self) -> AsyncInstancesResourceWithRawResponse:
@@ -856,8 +856,8 @@ def gpu_baremetal_clusters(self) -> GPUBaremetalClustersResourceWithStreamingRes
return GPUBaremetalClustersResourceWithStreamingResponse(self._cloud.gpu_baremetal_clusters)
@cached_property
- def gpu_virtual_clusters(self) -> GPUVirtualClustersResourceWithStreamingResponse:
- return GPUVirtualClustersResourceWithStreamingResponse(self._cloud.gpu_virtual_clusters)
+ def gpu_virtual(self) -> GPUVirtualResourceWithStreamingResponse:
+ return GPUVirtualResourceWithStreamingResponse(self._cloud.gpu_virtual)
@cached_property
def instances(self) -> InstancesResourceWithStreamingResponse:
@@ -980,8 +980,8 @@ def gpu_baremetal_clusters(self) -> AsyncGPUBaremetalClustersResourceWithStreami
return AsyncGPUBaremetalClustersResourceWithStreamingResponse(self._cloud.gpu_baremetal_clusters)
@cached_property
- def gpu_virtual_clusters(self) -> AsyncGPUVirtualClustersResourceWithStreamingResponse:
- return AsyncGPUVirtualClustersResourceWithStreamingResponse(self._cloud.gpu_virtual_clusters)
+ def gpu_virtual(self) -> AsyncGPUVirtualResourceWithStreamingResponse:
+ return AsyncGPUVirtualResourceWithStreamingResponse(self._cloud.gpu_virtual)
@cached_property
def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
diff --git a/src/gcore/resources/cloud/gpu_virtual/__init__.py b/src/gcore/resources/cloud/gpu_virtual/__init__.py
new file mode 100644
index 00000000..214d9c94
--- /dev/null
+++ b/src/gcore/resources/cloud/gpu_virtual/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .clusters import (
+ ClustersResource,
+ AsyncClustersResource,
+ ClustersResourceWithRawResponse,
+ AsyncClustersResourceWithRawResponse,
+ ClustersResourceWithStreamingResponse,
+ AsyncClustersResourceWithStreamingResponse,
+)
+from .gpu_virtual import (
+ GPUVirtualResource,
+ AsyncGPUVirtualResource,
+ GPUVirtualResourceWithRawResponse,
+ AsyncGPUVirtualResourceWithRawResponse,
+ GPUVirtualResourceWithStreamingResponse,
+ AsyncGPUVirtualResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "ClustersResource",
+ "AsyncClustersResource",
+ "ClustersResourceWithRawResponse",
+ "AsyncClustersResourceWithRawResponse",
+ "ClustersResourceWithStreamingResponse",
+ "AsyncClustersResourceWithStreamingResponse",
+ "GPUVirtualResource",
+ "AsyncGPUVirtualResource",
+ "GPUVirtualResourceWithRawResponse",
+ "AsyncGPUVirtualResourceWithRawResponse",
+ "GPUVirtualResourceWithStreamingResponse",
+ "AsyncGPUVirtualResourceWithStreamingResponse",
+]
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/__init__.py b/src/gcore/resources/cloud/gpu_virtual/clusters/__init__.py
similarity index 80%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/__init__.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/__init__.py
index 6957a34c..567fb0f3 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/__init__.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/__init__.py
@@ -32,6 +32,14 @@
VolumesResourceWithStreamingResponse,
AsyncVolumesResourceWithStreamingResponse,
)
+from .clusters import (
+ ClustersResource,
+ AsyncClustersResource,
+ ClustersResourceWithRawResponse,
+ AsyncClustersResourceWithRawResponse,
+ ClustersResourceWithStreamingResponse,
+ AsyncClustersResourceWithStreamingResponse,
+)
from .interfaces import (
InterfacesResource,
AsyncInterfacesResource,
@@ -40,14 +48,6 @@
InterfacesResourceWithStreamingResponse,
AsyncInterfacesResourceWithStreamingResponse,
)
-from .gpu_virtual_clusters import (
- GPUVirtualClustersResource,
- AsyncGPUVirtualClustersResource,
- GPUVirtualClustersResourceWithRawResponse,
- AsyncGPUVirtualClustersResourceWithRawResponse,
- GPUVirtualClustersResourceWithStreamingResponse,
- AsyncGPUVirtualClustersResourceWithStreamingResponse,
-)
__all__ = [
"ServersResource",
@@ -80,10 +80,10 @@
"AsyncImagesResourceWithRawResponse",
"ImagesResourceWithStreamingResponse",
"AsyncImagesResourceWithStreamingResponse",
- "GPUVirtualClustersResource",
- "AsyncGPUVirtualClustersResource",
- "GPUVirtualClustersResourceWithRawResponse",
- "AsyncGPUVirtualClustersResourceWithRawResponse",
- "GPUVirtualClustersResourceWithStreamingResponse",
- "AsyncGPUVirtualClustersResourceWithStreamingResponse",
+ "ClustersResource",
+ "AsyncClustersResource",
+ "ClustersResourceWithRawResponse",
+ "AsyncClustersResourceWithRawResponse",
+ "ClustersResourceWithStreamingResponse",
+ "AsyncClustersResourceWithStreamingResponse",
]
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py b/src/gcore/resources/cloud/gpu_virtual/clusters/clusters.py
similarity index 89%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/clusters.py
index 6d00751f..a94d8752 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/clusters.py
@@ -39,9 +39,8 @@
VolumesResourceWithStreamingResponse,
AsyncVolumesResourceWithStreamingResponse,
)
-from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import required_args, maybe_transform, async_maybe_transform
-from ...._compat import cached_property
+from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ....._utils import required_args, maybe_transform, async_maybe_transform
from .interfaces import (
InterfacesResource,
AsyncInterfacesResource,
@@ -50,30 +49,31 @@
InterfacesResourceWithStreamingResponse,
AsyncInterfacesResourceWithStreamingResponse,
)
-from ...._resource import SyncAPIResource, AsyncAPIResource
-from ...._response import (
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ....pagination import SyncOffsetPage, AsyncOffsetPage
-from ....types.cloud import (
- gpu_virtual_cluster_list_params,
- gpu_virtual_cluster_action_params,
- gpu_virtual_cluster_create_params,
- gpu_virtual_cluster_delete_params,
- gpu_virtual_cluster_update_params,
+from .....pagination import SyncOffsetPage, AsyncOffsetPage
+from ....._base_client import AsyncPaginator, make_request_options
+from .....types.cloud.gpu_virtual import (
+ cluster_list_params,
+ cluster_action_params,
+ cluster_create_params,
+ cluster_delete_params,
+ cluster_update_params,
)
-from ...._base_client import AsyncPaginator, make_request_options
-from ....types.cloud.task_id_list import TaskIDList
-from ....types.cloud.gpu_virtual_cluster import GPUVirtualCluster
-from ....types.cloud.tag_update_map_param import TagUpdateMapParam
+from .....types.cloud.task_id_list import TaskIDList
+from .....types.cloud.tag_update_map_param import TagUpdateMapParam
+from .....types.cloud.gpu_virtual.gpu_virtual_cluster import GPUVirtualCluster
-__all__ = ["GPUVirtualClustersResource", "AsyncGPUVirtualClustersResource"]
+__all__ = ["ClustersResource", "AsyncClustersResource"]
-class GPUVirtualClustersResource(SyncAPIResource):
+class ClustersResource(SyncAPIResource):
@cached_property
def servers(self) -> ServersResource:
return ServersResource(self._client)
@@ -95,23 +95,23 @@ def images(self) -> ImagesResource:
return ImagesResource(self._client)
@cached_property
- def with_raw_response(self) -> GPUVirtualClustersResourceWithRawResponse:
+ def with_raw_response(self) -> ClustersResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
"""
- return GPUVirtualClustersResourceWithRawResponse(self)
+ return ClustersResourceWithRawResponse(self)
@cached_property
- def with_streaming_response(self) -> GPUVirtualClustersResourceWithStreamingResponse:
+ def with_streaming_response(self) -> ClustersResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
"""
- return GPUVirtualClustersResourceWithStreamingResponse(self)
+ return ClustersResourceWithStreamingResponse(self)
def create(
self,
@@ -121,7 +121,7 @@ def create(
flavor: str,
name: str,
servers_count: int,
- servers_settings: gpu_virtual_cluster_create_params.ServersSettings,
+ servers_settings: cluster_create_params.ServersSettings,
tags: Dict[str, str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -175,7 +175,7 @@ def create(
"servers_settings": servers_settings,
"tags": tags,
},
- gpu_virtual_cluster_create_params.GPUVirtualClusterCreateParams,
+ cluster_create_params.ClusterCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -225,7 +225,7 @@ def update(
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
return self._patch(
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
- body=maybe_transform({"name": name}, gpu_virtual_cluster_update_params.GPUVirtualClusterUpdateParams),
+ body=maybe_transform({"name": name}, cluster_update_params.ClusterUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -283,7 +283,7 @@ def list(
"limit": limit,
"offset": offset,
},
- gpu_virtual_cluster_list_params.GPUVirtualClusterListParams,
+ cluster_list_params.ClusterListParams,
),
),
model=GPUVirtualCluster,
@@ -362,7 +362,7 @@ def delete(
"reserved_fixed_ip_ids": reserved_fixed_ip_ids,
"volume_ids": volume_ids,
},
- gpu_virtual_cluster_delete_params.GPUVirtualClusterDeleteParams,
+ cluster_delete_params.ClusterDeleteParams,
),
),
cast_to=TaskIDList,
@@ -669,7 +669,7 @@ def action(
"tags": tags,
"servers_count": servers_count,
},
- gpu_virtual_cluster_action_params.GPUVirtualClusterActionParams,
+ cluster_action_params.ClusterActionParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -723,7 +723,7 @@ def get(
)
-class AsyncGPUVirtualClustersResource(AsyncAPIResource):
+class AsyncClustersResource(AsyncAPIResource):
@cached_property
def servers(self) -> AsyncServersResource:
return AsyncServersResource(self._client)
@@ -745,23 +745,23 @@ def images(self) -> AsyncImagesResource:
return AsyncImagesResource(self._client)
@cached_property
- def with_raw_response(self) -> AsyncGPUVirtualClustersResourceWithRawResponse:
+ def with_raw_response(self) -> AsyncClustersResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
"""
- return AsyncGPUVirtualClustersResourceWithRawResponse(self)
+ return AsyncClustersResourceWithRawResponse(self)
@cached_property
- def with_streaming_response(self) -> AsyncGPUVirtualClustersResourceWithStreamingResponse:
+ def with_streaming_response(self) -> AsyncClustersResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
"""
- return AsyncGPUVirtualClustersResourceWithStreamingResponse(self)
+ return AsyncClustersResourceWithStreamingResponse(self)
async def create(
self,
@@ -771,7 +771,7 @@ async def create(
flavor: str,
name: str,
servers_count: int,
- servers_settings: gpu_virtual_cluster_create_params.ServersSettings,
+ servers_settings: cluster_create_params.ServersSettings,
tags: Dict[str, str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -825,7 +825,7 @@ async def create(
"servers_settings": servers_settings,
"tags": tags,
},
- gpu_virtual_cluster_create_params.GPUVirtualClusterCreateParams,
+ cluster_create_params.ClusterCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -875,9 +875,7 @@ async def update(
raise ValueError(f"Expected a non-empty value for `cluster_id` but received {cluster_id!r}")
return await self._patch(
f"/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters/{cluster_id}",
- body=await async_maybe_transform(
- {"name": name}, gpu_virtual_cluster_update_params.GPUVirtualClusterUpdateParams
- ),
+ body=await async_maybe_transform({"name": name}, cluster_update_params.ClusterUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -935,7 +933,7 @@ def list(
"limit": limit,
"offset": offset,
},
- gpu_virtual_cluster_list_params.GPUVirtualClusterListParams,
+ cluster_list_params.ClusterListParams,
),
),
model=GPUVirtualCluster,
@@ -1014,7 +1012,7 @@ async def delete(
"reserved_fixed_ip_ids": reserved_fixed_ip_ids,
"volume_ids": volume_ids,
},
- gpu_virtual_cluster_delete_params.GPUVirtualClusterDeleteParams,
+ cluster_delete_params.ClusterDeleteParams,
),
),
cast_to=TaskIDList,
@@ -1321,7 +1319,7 @@ async def action(
"tags": tags,
"servers_count": servers_count,
},
- gpu_virtual_cluster_action_params.GPUVirtualClusterActionParams,
+ cluster_action_params.ClusterActionParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -1375,177 +1373,177 @@ async def get(
)
-class GPUVirtualClustersResourceWithRawResponse:
- def __init__(self, gpu_virtual_clusters: GPUVirtualClustersResource) -> None:
- self._gpu_virtual_clusters = gpu_virtual_clusters
+class ClustersResourceWithRawResponse:
+ def __init__(self, clusters: ClustersResource) -> None:
+ self._clusters = clusters
self.create = to_raw_response_wrapper(
- gpu_virtual_clusters.create,
+ clusters.create,
)
self.update = to_raw_response_wrapper(
- gpu_virtual_clusters.update,
+ clusters.update,
)
self.list = to_raw_response_wrapper(
- gpu_virtual_clusters.list,
+ clusters.list,
)
self.delete = to_raw_response_wrapper(
- gpu_virtual_clusters.delete,
+ clusters.delete,
)
self.action = to_raw_response_wrapper(
- gpu_virtual_clusters.action,
+ clusters.action,
)
self.get = to_raw_response_wrapper(
- gpu_virtual_clusters.get,
+ clusters.get,
)
@cached_property
def servers(self) -> ServersResourceWithRawResponse:
- return ServersResourceWithRawResponse(self._gpu_virtual_clusters.servers)
+ return ServersResourceWithRawResponse(self._clusters.servers)
@cached_property
def volumes(self) -> VolumesResourceWithRawResponse:
- return VolumesResourceWithRawResponse(self._gpu_virtual_clusters.volumes)
+ return VolumesResourceWithRawResponse(self._clusters.volumes)
@cached_property
def interfaces(self) -> InterfacesResourceWithRawResponse:
- return InterfacesResourceWithRawResponse(self._gpu_virtual_clusters.interfaces)
+ return InterfacesResourceWithRawResponse(self._clusters.interfaces)
@cached_property
def flavors(self) -> FlavorsResourceWithRawResponse:
- return FlavorsResourceWithRawResponse(self._gpu_virtual_clusters.flavors)
+ return FlavorsResourceWithRawResponse(self._clusters.flavors)
@cached_property
def images(self) -> ImagesResourceWithRawResponse:
- return ImagesResourceWithRawResponse(self._gpu_virtual_clusters.images)
+ return ImagesResourceWithRawResponse(self._clusters.images)
-class AsyncGPUVirtualClustersResourceWithRawResponse:
- def __init__(self, gpu_virtual_clusters: AsyncGPUVirtualClustersResource) -> None:
- self._gpu_virtual_clusters = gpu_virtual_clusters
+class AsyncClustersResourceWithRawResponse:
+ def __init__(self, clusters: AsyncClustersResource) -> None:
+ self._clusters = clusters
self.create = async_to_raw_response_wrapper(
- gpu_virtual_clusters.create,
+ clusters.create,
)
self.update = async_to_raw_response_wrapper(
- gpu_virtual_clusters.update,
+ clusters.update,
)
self.list = async_to_raw_response_wrapper(
- gpu_virtual_clusters.list,
+ clusters.list,
)
self.delete = async_to_raw_response_wrapper(
- gpu_virtual_clusters.delete,
+ clusters.delete,
)
self.action = async_to_raw_response_wrapper(
- gpu_virtual_clusters.action,
+ clusters.action,
)
self.get = async_to_raw_response_wrapper(
- gpu_virtual_clusters.get,
+ clusters.get,
)
@cached_property
def servers(self) -> AsyncServersResourceWithRawResponse:
- return AsyncServersResourceWithRawResponse(self._gpu_virtual_clusters.servers)
+ return AsyncServersResourceWithRawResponse(self._clusters.servers)
@cached_property
def volumes(self) -> AsyncVolumesResourceWithRawResponse:
- return AsyncVolumesResourceWithRawResponse(self._gpu_virtual_clusters.volumes)
+ return AsyncVolumesResourceWithRawResponse(self._clusters.volumes)
@cached_property
def interfaces(self) -> AsyncInterfacesResourceWithRawResponse:
- return AsyncInterfacesResourceWithRawResponse(self._gpu_virtual_clusters.interfaces)
+ return AsyncInterfacesResourceWithRawResponse(self._clusters.interfaces)
@cached_property
def flavors(self) -> AsyncFlavorsResourceWithRawResponse:
- return AsyncFlavorsResourceWithRawResponse(self._gpu_virtual_clusters.flavors)
+ return AsyncFlavorsResourceWithRawResponse(self._clusters.flavors)
@cached_property
def images(self) -> AsyncImagesResourceWithRawResponse:
- return AsyncImagesResourceWithRawResponse(self._gpu_virtual_clusters.images)
+ return AsyncImagesResourceWithRawResponse(self._clusters.images)
-class GPUVirtualClustersResourceWithStreamingResponse:
- def __init__(self, gpu_virtual_clusters: GPUVirtualClustersResource) -> None:
- self._gpu_virtual_clusters = gpu_virtual_clusters
+class ClustersResourceWithStreamingResponse:
+ def __init__(self, clusters: ClustersResource) -> None:
+ self._clusters = clusters
self.create = to_streamed_response_wrapper(
- gpu_virtual_clusters.create,
+ clusters.create,
)
self.update = to_streamed_response_wrapper(
- gpu_virtual_clusters.update,
+ clusters.update,
)
self.list = to_streamed_response_wrapper(
- gpu_virtual_clusters.list,
+ clusters.list,
)
self.delete = to_streamed_response_wrapper(
- gpu_virtual_clusters.delete,
+ clusters.delete,
)
self.action = to_streamed_response_wrapper(
- gpu_virtual_clusters.action,
+ clusters.action,
)
self.get = to_streamed_response_wrapper(
- gpu_virtual_clusters.get,
+ clusters.get,
)
@cached_property
def servers(self) -> ServersResourceWithStreamingResponse:
- return ServersResourceWithStreamingResponse(self._gpu_virtual_clusters.servers)
+ return ServersResourceWithStreamingResponse(self._clusters.servers)
@cached_property
def volumes(self) -> VolumesResourceWithStreamingResponse:
- return VolumesResourceWithStreamingResponse(self._gpu_virtual_clusters.volumes)
+ return VolumesResourceWithStreamingResponse(self._clusters.volumes)
@cached_property
def interfaces(self) -> InterfacesResourceWithStreamingResponse:
- return InterfacesResourceWithStreamingResponse(self._gpu_virtual_clusters.interfaces)
+ return InterfacesResourceWithStreamingResponse(self._clusters.interfaces)
@cached_property
def flavors(self) -> FlavorsResourceWithStreamingResponse:
- return FlavorsResourceWithStreamingResponse(self._gpu_virtual_clusters.flavors)
+ return FlavorsResourceWithStreamingResponse(self._clusters.flavors)
@cached_property
def images(self) -> ImagesResourceWithStreamingResponse:
- return ImagesResourceWithStreamingResponse(self._gpu_virtual_clusters.images)
+ return ImagesResourceWithStreamingResponse(self._clusters.images)
-class AsyncGPUVirtualClustersResourceWithStreamingResponse:
- def __init__(self, gpu_virtual_clusters: AsyncGPUVirtualClustersResource) -> None:
- self._gpu_virtual_clusters = gpu_virtual_clusters
+class AsyncClustersResourceWithStreamingResponse:
+ def __init__(self, clusters: AsyncClustersResource) -> None:
+ self._clusters = clusters
self.create = async_to_streamed_response_wrapper(
- gpu_virtual_clusters.create,
+ clusters.create,
)
self.update = async_to_streamed_response_wrapper(
- gpu_virtual_clusters.update,
+ clusters.update,
)
self.list = async_to_streamed_response_wrapper(
- gpu_virtual_clusters.list,
+ clusters.list,
)
self.delete = async_to_streamed_response_wrapper(
- gpu_virtual_clusters.delete,
+ clusters.delete,
)
self.action = async_to_streamed_response_wrapper(
- gpu_virtual_clusters.action,
+ clusters.action,
)
self.get = async_to_streamed_response_wrapper(
- gpu_virtual_clusters.get,
+ clusters.get,
)
@cached_property
def servers(self) -> AsyncServersResourceWithStreamingResponse:
- return AsyncServersResourceWithStreamingResponse(self._gpu_virtual_clusters.servers)
+ return AsyncServersResourceWithStreamingResponse(self._clusters.servers)
@cached_property
def volumes(self) -> AsyncVolumesResourceWithStreamingResponse:
- return AsyncVolumesResourceWithStreamingResponse(self._gpu_virtual_clusters.volumes)
+ return AsyncVolumesResourceWithStreamingResponse(self._clusters.volumes)
@cached_property
def interfaces(self) -> AsyncInterfacesResourceWithStreamingResponse:
- return AsyncInterfacesResourceWithStreamingResponse(self._gpu_virtual_clusters.interfaces)
+ return AsyncInterfacesResourceWithStreamingResponse(self._clusters.interfaces)
@cached_property
def flavors(self) -> AsyncFlavorsResourceWithStreamingResponse:
- return AsyncFlavorsResourceWithStreamingResponse(self._gpu_virtual_clusters.flavors)
+ return AsyncFlavorsResourceWithStreamingResponse(self._clusters.flavors)
@cached_property
def images(self) -> AsyncImagesResourceWithStreamingResponse:
- return AsyncImagesResourceWithStreamingResponse(self._gpu_virtual_clusters.images)
+ return AsyncImagesResourceWithStreamingResponse(self._clusters.images)
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/flavors.py b/src/gcore/resources/cloud/gpu_virtual/clusters/flavors.py
similarity index 93%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/flavors.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/flavors.py
index 269932f2..ee6fd7dc 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/flavors.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/flavors.py
@@ -4,19 +4,19 @@
import httpx
-from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
-from ...._compat import cached_property
-from ...._resource import SyncAPIResource, AsyncAPIResource
-from ...._response import (
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...._base_client import make_request_options
-from ....types.cloud.gpu_virtual_clusters import flavor_list_params
-from ....types.cloud.gpu_virtual_clusters.gpu_virtual_flavor_list import GPUVirtualFlavorList
+from ....._base_client import make_request_options
+from .....types.cloud.gpu_virtual.clusters import flavor_list_params
+from .....types.cloud.gpu_virtual.clusters.gpu_virtual_flavor_list import GPUVirtualFlavorList
__all__ = ["FlavorsResource", "AsyncFlavorsResource"]
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/images.py b/src/gcore/resources/cloud/gpu_virtual/clusters/images.py
similarity index 97%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/images.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/images.py
index 8d408ad5..9c7d1472 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/images.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/images.py
@@ -7,21 +7,21 @@
import httpx
-from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
-from ...._compat import cached_property
-from ...._resource import SyncAPIResource, AsyncAPIResource
-from ...._response import (
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...._base_client import make_request_options
-from ....types.cloud.gpu_image import GPUImage
-from ....types.cloud.task_id_list import TaskIDList
-from ....types.cloud.gpu_image_list import GPUImageList
-from ....types.cloud.gpu_virtual_clusters import image_upload_params
+from ....._base_client import make_request_options
+from .....types.cloud.gpu_image import GPUImage
+from .....types.cloud.task_id_list import TaskIDList
+from .....types.cloud.gpu_image_list import GPUImageList
+from .....types.cloud.gpu_virtual.clusters import image_upload_params
__all__ = ["ImagesResource", "AsyncImagesResource"]
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/interfaces.py b/src/gcore/resources/cloud/gpu_virtual/clusters/interfaces.py
similarity index 95%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/interfaces.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/interfaces.py
index ca97cda6..28bae5d4 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/interfaces.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/interfaces.py
@@ -4,17 +4,17 @@
import httpx
-from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._compat import cached_property
-from ...._resource import SyncAPIResource, AsyncAPIResource
-from ...._response import (
+from ....._types import Body, Query, Headers, NotGiven, not_given
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...._base_client import make_request_options
-from ....types.cloud.gpu_virtual_clusters.gpu_virtual_interface_list import GPUVirtualInterfaceList
+from ....._base_client import make_request_options
+from .....types.cloud.gpu_virtual.clusters.gpu_virtual_interface_list import GPUVirtualInterfaceList
__all__ = ["InterfacesResource", "AsyncInterfacesResource"]
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/servers.py b/src/gcore/resources/cloud/gpu_virtual/clusters/servers.py
similarity index 96%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/servers.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/servers.py
index a0176570..4895fd83 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/servers.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/servers.py
@@ -8,20 +8,20 @@
import httpx
-from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
-from ...._compat import cached_property
-from ...._resource import SyncAPIResource, AsyncAPIResource
-from ...._response import (
+from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ....._utils import maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...._base_client import make_request_options
-from ....types.cloud.task_id_list import TaskIDList
-from ....types.cloud.gpu_virtual_clusters import server_list_params, server_delete_params
-from ....types.cloud.gpu_virtual_clusters.gpu_virtual_cluster_server_list import GPUVirtualClusterServerList
+from ....._base_client import make_request_options
+from .....types.cloud.task_id_list import TaskIDList
+from .....types.cloud.gpu_virtual.clusters import server_list_params, server_delete_params
+from .....types.cloud.gpu_virtual.clusters.gpu_virtual_cluster_server_list import GPUVirtualClusterServerList
__all__ = ["ServersResource", "AsyncServersResource"]
diff --git a/src/gcore/resources/cloud/gpu_virtual_clusters/volumes.py b/src/gcore/resources/cloud/gpu_virtual/clusters/volumes.py
similarity index 94%
rename from src/gcore/resources/cloud/gpu_virtual_clusters/volumes.py
rename to src/gcore/resources/cloud/gpu_virtual/clusters/volumes.py
index 390e7cf9..afa07662 100644
--- a/src/gcore/resources/cloud/gpu_virtual_clusters/volumes.py
+++ b/src/gcore/resources/cloud/gpu_virtual/clusters/volumes.py
@@ -4,17 +4,17 @@
import httpx
-from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._compat import cached_property
-from ...._resource import SyncAPIResource, AsyncAPIResource
-from ...._response import (
+from ....._types import Body, Query, Headers, NotGiven, not_given
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...._base_client import make_request_options
-from ....types.cloud.gpu_virtual_clusters.gpu_virtual_cluster_volume_list import GPUVirtualClusterVolumeList
+from ....._base_client import make_request_options
+from .....types.cloud.gpu_virtual.clusters.gpu_virtual_cluster_volume_list import GPUVirtualClusterVolumeList
__all__ = ["VolumesResource", "AsyncVolumesResource"]
diff --git a/src/gcore/resources/cloud/gpu_virtual/gpu_virtual.py b/src/gcore/resources/cloud/gpu_virtual/gpu_virtual.py
new file mode 100644
index 00000000..959b2156
--- /dev/null
+++ b/src/gcore/resources/cloud/gpu_virtual/gpu_virtual.py
@@ -0,0 +1,102 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from .clusters.clusters import (
+ ClustersResource,
+ AsyncClustersResource,
+ ClustersResourceWithRawResponse,
+ AsyncClustersResourceWithRawResponse,
+ ClustersResourceWithStreamingResponse,
+ AsyncClustersResourceWithStreamingResponse,
+)
+
+__all__ = ["GPUVirtualResource", "AsyncGPUVirtualResource"]
+
+
+class GPUVirtualResource(SyncAPIResource):
+ @cached_property
+ def clusters(self) -> ClustersResource:
+ return ClustersResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> GPUVirtualResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
+ """
+ return GPUVirtualResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> GPUVirtualResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
+ """
+ return GPUVirtualResourceWithStreamingResponse(self)
+
+
+class AsyncGPUVirtualResource(AsyncAPIResource):
+ @cached_property
+ def clusters(self) -> AsyncClustersResource:
+ return AsyncClustersResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncGPUVirtualResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncGPUVirtualResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncGPUVirtualResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
+ """
+ return AsyncGPUVirtualResourceWithStreamingResponse(self)
+
+
+class GPUVirtualResourceWithRawResponse:
+ def __init__(self, gpu_virtual: GPUVirtualResource) -> None:
+ self._gpu_virtual = gpu_virtual
+
+ @cached_property
+ def clusters(self) -> ClustersResourceWithRawResponse:
+ return ClustersResourceWithRawResponse(self._gpu_virtual.clusters)
+
+
+class AsyncGPUVirtualResourceWithRawResponse:
+ def __init__(self, gpu_virtual: AsyncGPUVirtualResource) -> None:
+ self._gpu_virtual = gpu_virtual
+
+ @cached_property
+ def clusters(self) -> AsyncClustersResourceWithRawResponse:
+ return AsyncClustersResourceWithRawResponse(self._gpu_virtual.clusters)
+
+
+class GPUVirtualResourceWithStreamingResponse:
+ def __init__(self, gpu_virtual: GPUVirtualResource) -> None:
+ self._gpu_virtual = gpu_virtual
+
+ @cached_property
+ def clusters(self) -> ClustersResourceWithStreamingResponse:
+ return ClustersResourceWithStreamingResponse(self._gpu_virtual.clusters)
+
+
+class AsyncGPUVirtualResourceWithStreamingResponse:
+ def __init__(self, gpu_virtual: AsyncGPUVirtualResource) -> None:
+ self._gpu_virtual = gpu_virtual
+
+ @cached_property
+ def clusters(self) -> AsyncClustersResourceWithStreamingResponse:
+ return AsyncClustersResourceWithStreamingResponse(self._gpu_virtual.clusters)
diff --git a/src/gcore/types/cloud/__init__.py b/src/gcore/types/cloud/__init__.py
index 33f051d9..0503e14b 100644
--- a/src/gcore/types/cloud/__init__.py
+++ b/src/gcore/types/cloud/__init__.py
@@ -64,7 +64,6 @@
from .billing_reservation import BillingReservation as BillingReservation
from .ddos_profile_status import DDOSProfileStatus as DDOSProfileStatus
from .fixed_address_short import FixedAddressShort as FixedAddressShort
-from .gpu_virtual_cluster import GPUVirtualCluster as GPUVirtualCluster
from .interface_ip_family import InterfaceIPFamily as InterfaceIPFamily
from .k8s_cluster_version import K8SClusterVersion as K8SClusterVersion
from .network_list_params import NetworkListParams as NetworkListParams
@@ -161,16 +160,11 @@
from .load_balancer_operating_status import LoadBalancerOperatingStatus as LoadBalancerOperatingStatus
from .billing_reservation_list_params import BillingReservationListParams as BillingReservationListParams
from .cost_report_get_detailed_params import CostReportGetDetailedParams as CostReportGetDetailedParams
-from .gpu_virtual_cluster_list_params import GPUVirtualClusterListParams as GPUVirtualClusterListParams
from .reserved_fixed_ip_create_params import ReservedFixedIPCreateParams as ReservedFixedIPCreateParams
from .reserved_fixed_ip_update_params import ReservedFixedIPUpdateParams as ReservedFixedIPUpdateParams
from .volume_attach_to_instance_params import VolumeAttachToInstanceParams as VolumeAttachToInstanceParams
from .cost_report_get_aggregated_params import CostReportGetAggregatedParams as CostReportGetAggregatedParams
from .gpu_baremetal_cluster_list_params import GPUBaremetalClusterListParams as GPUBaremetalClusterListParams
-from .gpu_virtual_cluster_action_params import GPUVirtualClusterActionParams as GPUVirtualClusterActionParams
-from .gpu_virtual_cluster_create_params import GPUVirtualClusterCreateParams as GPUVirtualClusterCreateParams
-from .gpu_virtual_cluster_delete_params import GPUVirtualClusterDeleteParams as GPUVirtualClusterDeleteParams
-from .gpu_virtual_cluster_update_params import GPUVirtualClusterUpdateParams as GPUVirtualClusterUpdateParams
from .laas_index_retention_policy_param import LaasIndexRetentionPolicyParam as LaasIndexRetentionPolicyParam
from .load_balancer_member_connectivity import LoadBalancerMemberConnectivity as LoadBalancerMemberConnectivity
from .volume_detach_from_instance_params import VolumeDetachFromInstanceParams as VolumeDetachFromInstanceParams
diff --git a/src/gcore/types/cloud/gpu_virtual/__init__.py b/src/gcore/types/cloud/gpu_virtual/__init__.py
new file mode 100644
index 00000000..9c1abcb8
--- /dev/null
+++ b/src/gcore/types/cloud/gpu_virtual/__init__.py
@@ -0,0 +1,10 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .cluster_list_params import ClusterListParams as ClusterListParams
+from .gpu_virtual_cluster import GPUVirtualCluster as GPUVirtualCluster
+from .cluster_action_params import ClusterActionParams as ClusterActionParams
+from .cluster_create_params import ClusterCreateParams as ClusterCreateParams
+from .cluster_delete_params import ClusterDeleteParams as ClusterDeleteParams
+from .cluster_update_params import ClusterUpdateParams as ClusterUpdateParams
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster_action_params.py b/src/gcore/types/cloud/gpu_virtual/cluster_action_params.py
similarity index 95%
rename from src/gcore/types/cloud/gpu_virtual_cluster_action_params.py
rename to src/gcore/types/cloud/gpu_virtual/cluster_action_params.py
index 9319deff..a1c0cd75 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster_action_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/cluster_action_params.py
@@ -5,10 +5,10 @@
from typing import Union, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
-from .tag_update_map_param import TagUpdateMapParam
+from ..tag_update_map_param import TagUpdateMapParam
__all__ = [
- "GPUVirtualClusterActionParams",
+ "ClusterActionParams",
"StartVirtualGPUClusterSerializer",
"StopVirtualGPUClusterSerializer",
"SoftRebootVirtualGPUClusterSerializer",
@@ -117,7 +117,7 @@ class ResizeVirtualGPUClusterSerializer(TypedDict, total=False):
"""Requested servers count"""
-GPUVirtualClusterActionParams: TypeAlias = Union[
+ClusterActionParams: TypeAlias = Union[
StartVirtualGPUClusterSerializer,
StopVirtualGPUClusterSerializer,
SoftRebootVirtualGPUClusterSerializer,
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster_create_params.py b/src/gcore/types/cloud/gpu_virtual/cluster_create_params.py
similarity index 98%
rename from src/gcore/types/cloud/gpu_virtual_cluster_create_params.py
rename to src/gcore/types/cloud/gpu_virtual/cluster_create_params.py
index b678cabf..f6235455 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster_create_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/cluster_create_params.py
@@ -6,7 +6,7 @@
from typing_extensions import Literal, Required, TypeAlias, TypedDict
__all__ = [
- "GPUVirtualClusterCreateParams",
+ "ClusterCreateParams",
"ServersSettings",
"ServersSettingsInterface",
"ServersSettingsInterfaceExternalInterfaceInputSerializer",
@@ -23,7 +23,7 @@
]
-class GPUVirtualClusterCreateParams(TypedDict, total=False):
+class ClusterCreateParams(TypedDict, total=False):
project_id: int
"""Project ID"""
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster_delete_params.py b/src/gcore/types/cloud/gpu_virtual/cluster_delete_params.py
similarity index 86%
rename from src/gcore/types/cloud/gpu_virtual_cluster_delete_params.py
rename to src/gcore/types/cloud/gpu_virtual/cluster_delete_params.py
index 3cd9988b..5734cd7c 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster_delete_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/cluster_delete_params.py
@@ -4,12 +4,12 @@
from typing_extensions import TypedDict
-from ..._types import SequenceNotStr
+from ...._types import SequenceNotStr
-__all__ = ["GPUVirtualClusterDeleteParams"]
+__all__ = ["ClusterDeleteParams"]
-class GPUVirtualClusterDeleteParams(TypedDict, total=False):
+class ClusterDeleteParams(TypedDict, total=False):
project_id: int
"""Project ID"""
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster_list_params.py b/src/gcore/types/cloud/gpu_virtual/cluster_list_params.py
similarity index 77%
rename from src/gcore/types/cloud/gpu_virtual_cluster_list_params.py
rename to src/gcore/types/cloud/gpu_virtual/cluster_list_params.py
index ff0dba49..e62cf44f 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster_list_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/cluster_list_params.py
@@ -4,10 +4,10 @@
from typing_extensions import TypedDict
-__all__ = ["GPUVirtualClusterListParams"]
+__all__ = ["ClusterListParams"]
-class GPUVirtualClusterListParams(TypedDict, total=False):
+class ClusterListParams(TypedDict, total=False):
project_id: int
"""Project ID"""
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster_update_params.py b/src/gcore/types/cloud/gpu_virtual/cluster_update_params.py
similarity index 74%
rename from src/gcore/types/cloud/gpu_virtual_cluster_update_params.py
rename to src/gcore/types/cloud/gpu_virtual/cluster_update_params.py
index 790bbf88..8ce9c924 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster_update_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/cluster_update_params.py
@@ -4,10 +4,10 @@
from typing_extensions import Required, TypedDict
-__all__ = ["GPUVirtualClusterUpdateParams"]
+__all__ = ["ClusterUpdateParams"]
-class GPUVirtualClusterUpdateParams(TypedDict, total=False):
+class ClusterUpdateParams(TypedDict, total=False):
project_id: int
"""Project ID"""
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/__init__.py b/src/gcore/types/cloud/gpu_virtual/clusters/__init__.py
similarity index 100%
rename from src/gcore/types/cloud/gpu_virtual_clusters/__init__.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/__init__.py
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py b/src/gcore/types/cloud/gpu_virtual/clusters/flavor_list_params.py
similarity index 100%
rename from src/gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/flavor_list_params.py
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server.py
similarity index 96%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server.py
index b1b8b52f..d8126e53 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server.py
@@ -4,8 +4,8 @@
from datetime import datetime
from typing_extensions import Literal
-from ..tag import Tag
-from ...._models import BaseModel
+from ...tag import Tag
+from ....._models import BaseModel
__all__ = ["GPUVirtualClusterServer", "SecurityGroup"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server_list.py
similarity index 91%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server_list.py
index d9cdad5a..4d6f87a2 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server_list.py
@@ -2,7 +2,7 @@
from typing import List
-from ...._models import BaseModel
+from ....._models import BaseModel
from .gpu_virtual_cluster_server import GPUVirtualClusterServer
__all__ = ["GPUVirtualClusterServerList"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_volume.py
similarity index 95%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_volume.py
index 06653cde..bab71b55 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_volume.py
@@ -4,8 +4,8 @@
from datetime import datetime
from typing_extensions import Literal
-from ..tag import Tag
-from ...._models import BaseModel
+from ...tag import Tag
+from ....._models import BaseModel
__all__ = ["GPUVirtualClusterVolume"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_volume_list.py
similarity index 91%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_volume_list.py
index feb8afbc..85b9ab5d 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_volume_list.py
@@ -2,7 +2,7 @@
from typing import List
-from ...._models import BaseModel
+from ....._models import BaseModel
from .gpu_virtual_cluster_volume import GPUVirtualClusterVolume
__all__ = ["GPUVirtualClusterVolumeList"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_flavor.py
similarity index 99%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_flavor.py
index 5b94d243..9acea9fb 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_flavor.py
@@ -3,7 +3,7 @@
from typing import Union, Optional
from typing_extensions import Literal, TypeAlias
-from ...._models import BaseModel
+from ....._models import BaseModel
__all__ = [
"GPUVirtualFlavor",
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_flavor_list.py
similarity index 90%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_flavor_list.py
index fdfab090..71caf1fc 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_flavor_list.py
@@ -2,7 +2,7 @@
from typing import List
-from ...._models import BaseModel
+from ....._models import BaseModel
from .gpu_virtual_flavor import GPUVirtualFlavor
__all__ = ["GPUVirtualFlavorList"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_interface.py
similarity index 96%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_interface.py
index 22892dca..50473b10 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_interface.py
@@ -3,11 +3,11 @@
from typing import List, Optional
from datetime import datetime
-from ..tag import Tag
-from ..route import Route
-from ...._models import BaseModel
-from ..ip_version import IPVersion
-from ..floating_ip_status import FloatingIPStatus
+from ...tag import Tag
+from ...route import Route
+from ....._models import BaseModel
+from ...ip_version import IPVersion
+from ...floating_ip_status import FloatingIPStatus
__all__ = ["GPUVirtualInterface", "FloatingIP", "IPAssignment", "Network", "NetworkSubnet"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_interface_list.py
similarity index 90%
rename from src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_interface_list.py
index ae39f4cf..006974ba 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_interface_list.py
@@ -2,7 +2,7 @@
from typing import List
-from ...._models import BaseModel
+from ....._models import BaseModel
from .gpu_virtual_interface import GPUVirtualInterface
__all__ = ["GPUVirtualInterfaceList"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py b/src/gcore/types/cloud/gpu_virtual/clusters/image_upload_params.py
similarity index 100%
rename from src/gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/image_upload_params.py
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py b/src/gcore/types/cloud/gpu_virtual/clusters/server_delete_params.py
similarity index 96%
rename from src/gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/server_delete_params.py
index 714cb4bb..a9b463f7 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/server_delete_params.py
@@ -4,7 +4,7 @@
from typing_extensions import Required, TypedDict
-from ...._types import SequenceNotStr
+from ....._types import SequenceNotStr
__all__ = ["ServerDeleteParams"]
diff --git a/src/gcore/types/cloud/gpu_virtual_clusters/server_list_params.py b/src/gcore/types/cloud/gpu_virtual/clusters/server_list_params.py
similarity index 96%
rename from src/gcore/types/cloud/gpu_virtual_clusters/server_list_params.py
rename to src/gcore/types/cloud/gpu_virtual/clusters/server_list_params.py
index 35c7f374..89f4cb6d 100644
--- a/src/gcore/types/cloud/gpu_virtual_clusters/server_list_params.py
+++ b/src/gcore/types/cloud/gpu_virtual/clusters/server_list_params.py
@@ -6,8 +6,8 @@
from datetime import datetime
from typing_extensions import Literal, Annotated, TypedDict
-from ...._types import SequenceNotStr
-from ...._utils import PropertyInfo
+from ....._types import SequenceNotStr
+from ....._utils import PropertyInfo
__all__ = ["ServerListParams"]
diff --git a/src/gcore/types/cloud/gpu_virtual_cluster.py b/src/gcore/types/cloud/gpu_virtual/gpu_virtual_cluster.py
similarity index 98%
rename from src/gcore/types/cloud/gpu_virtual_cluster.py
rename to src/gcore/types/cloud/gpu_virtual/gpu_virtual_cluster.py
index 72aaad4e..9b71eb5e 100644
--- a/src/gcore/types/cloud/gpu_virtual_cluster.py
+++ b/src/gcore/types/cloud/gpu_virtual/gpu_virtual_cluster.py
@@ -4,9 +4,9 @@
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
-from .tag import Tag
-from ..._utils import PropertyInfo
-from ..._models import BaseModel
+from ..tag import Tag
+from ...._utils import PropertyInfo
+from ...._models import BaseModel
__all__ = [
"GPUVirtualCluster",
diff --git a/tests/api_resources/cloud/gpu_virtual_clusters/__init__.py b/tests/api_resources/cloud/gpu_virtual/__init__.py
similarity index 100%
rename from tests/api_resources/cloud/gpu_virtual_clusters/__init__.py
rename to tests/api_resources/cloud/gpu_virtual/__init__.py
diff --git a/tests/api_resources/cloud/gpu_virtual/clusters/__init__.py b/tests/api_resources/cloud/gpu_virtual/clusters/__init__.py
new file mode 100644
index 00000000..fd8019a9
--- /dev/null
+++ b/tests/api_resources/cloud/gpu_virtual/clusters/__init__.py
@@ -0,0 +1 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/cloud/gpu_virtual_clusters/test_flavors.py b/tests/api_resources/cloud/gpu_virtual/clusters/test_flavors.py
similarity index 86%
rename from tests/api_resources/cloud/gpu_virtual_clusters/test_flavors.py
rename to tests/api_resources/cloud/gpu_virtual/clusters/test_flavors.py
index 89b949ed..4f1118ae 100644
--- a/tests/api_resources/cloud/gpu_virtual_clusters/test_flavors.py
+++ b/tests/api_resources/cloud/gpu_virtual/clusters/test_flavors.py
@@ -9,7 +9,7 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
-from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualFlavorList
+from gcore.types.cloud.gpu_virtual.clusters import GPUVirtualFlavorList
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -19,7 +19,7 @@ class TestFlavors:
@parametrize
def test_method_list(self, client: Gcore) -> None:
- flavor = client.cloud.gpu_virtual_clusters.flavors.list(
+ flavor = client.cloud.gpu_virtual.clusters.flavors.list(
project_id=1,
region_id=7,
)
@@ -27,7 +27,7 @@ def test_method_list(self, client: Gcore) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Gcore) -> None:
- flavor = client.cloud.gpu_virtual_clusters.flavors.list(
+ flavor = client.cloud.gpu_virtual.clusters.flavors.list(
project_id=1,
region_id=7,
hide_disabled=True,
@@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Gcore) -> None:
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.flavors.with_raw_response.list(
+ response = client.cloud.gpu_virtual.clusters.flavors.with_raw_response.list(
project_id=1,
region_id=7,
)
@@ -49,7 +49,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.flavors.with_streaming_response.list(
+ with client.cloud.gpu_virtual.clusters.flavors.with_streaming_response.list(
project_id=1,
region_id=7,
) as response:
@@ -69,7 +69,7 @@ class TestAsyncFlavors:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
- flavor = await async_client.cloud.gpu_virtual_clusters.flavors.list(
+ flavor = await async_client.cloud.gpu_virtual.clusters.flavors.list(
project_id=1,
region_id=7,
)
@@ -77,7 +77,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None:
- flavor = await async_client.cloud.gpu_virtual_clusters.flavors.list(
+ flavor = await async_client.cloud.gpu_virtual.clusters.flavors.list(
project_id=1,
region_id=7,
hide_disabled=True,
@@ -87,7 +87,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> No
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.flavors.with_raw_response.list(
+ response = await async_client.cloud.gpu_virtual.clusters.flavors.with_raw_response.list(
project_id=1,
region_id=7,
)
@@ -99,7 +99,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.flavors.with_streaming_response.list(
+ async with async_client.cloud.gpu_virtual.clusters.flavors.with_streaming_response.list(
project_id=1,
region_id=7,
) as response:
diff --git a/tests/api_resources/cloud/gpu_virtual_clusters/test_images.py b/tests/api_resources/cloud/gpu_virtual/clusters/test_images.py
similarity index 87%
rename from tests/api_resources/cloud/gpu_virtual_clusters/test_images.py
rename to tests/api_resources/cloud/gpu_virtual/clusters/test_images.py
index 7312ccb7..669aa6c0 100644
--- a/tests/api_resources/cloud/gpu_virtual_clusters/test_images.py
+++ b/tests/api_resources/cloud/gpu_virtual/clusters/test_images.py
@@ -19,7 +19,7 @@ class TestImages:
@parametrize
def test_method_list(self, client: Gcore) -> None:
- image = client.cloud.gpu_virtual_clusters.images.list(
+ image = client.cloud.gpu_virtual.clusters.images.list(
project_id=1,
region_id=7,
)
@@ -27,7 +27,7 @@ def test_method_list(self, client: Gcore) -> None:
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.images.with_raw_response.list(
+ response = client.cloud.gpu_virtual.clusters.images.with_raw_response.list(
project_id=1,
region_id=7,
)
@@ -39,7 +39,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.images.with_streaming_response.list(
+ with client.cloud.gpu_virtual.clusters.images.with_streaming_response.list(
project_id=1,
region_id=7,
) as response:
@@ -53,7 +53,7 @@ def test_streaming_response_list(self, client: Gcore) -> None:
@parametrize
def test_method_delete(self, client: Gcore) -> None:
- image = client.cloud.gpu_virtual_clusters.images.delete(
+ image = client.cloud.gpu_virtual.clusters.images.delete(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -62,7 +62,7 @@ def test_method_delete(self, client: Gcore) -> None:
@parametrize
def test_raw_response_delete(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.images.with_raw_response.delete(
+ response = client.cloud.gpu_virtual.clusters.images.with_raw_response.delete(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -75,7 +75,7 @@ def test_raw_response_delete(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_delete(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.images.with_streaming_response.delete(
+ with client.cloud.gpu_virtual.clusters.images.with_streaming_response.delete(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -91,7 +91,7 @@ def test_streaming_response_delete(self, client: Gcore) -> None:
@parametrize
def test_path_params_delete(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `image_id` but received ''"):
- client.cloud.gpu_virtual_clusters.images.with_raw_response.delete(
+ client.cloud.gpu_virtual.clusters.images.with_raw_response.delete(
image_id="",
project_id=1,
region_id=7,
@@ -99,7 +99,7 @@ def test_path_params_delete(self, client: Gcore) -> None:
@parametrize
def test_method_get(self, client: Gcore) -> None:
- image = client.cloud.gpu_virtual_clusters.images.get(
+ image = client.cloud.gpu_virtual.clusters.images.get(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -108,7 +108,7 @@ def test_method_get(self, client: Gcore) -> None:
@parametrize
def test_raw_response_get(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.images.with_raw_response.get(
+ response = client.cloud.gpu_virtual.clusters.images.with_raw_response.get(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -121,7 +121,7 @@ def test_raw_response_get(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_get(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.images.with_streaming_response.get(
+ with client.cloud.gpu_virtual.clusters.images.with_streaming_response.get(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -137,7 +137,7 @@ def test_streaming_response_get(self, client: Gcore) -> None:
@parametrize
def test_path_params_get(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `image_id` but received ''"):
- client.cloud.gpu_virtual_clusters.images.with_raw_response.get(
+ client.cloud.gpu_virtual.clusters.images.with_raw_response.get(
image_id="",
project_id=1,
region_id=7,
@@ -145,7 +145,7 @@ def test_path_params_get(self, client: Gcore) -> None:
@parametrize
def test_method_upload(self, client: Gcore) -> None:
- image = client.cloud.gpu_virtual_clusters.images.upload(
+ image = client.cloud.gpu_virtual.clusters.images.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -155,7 +155,7 @@ def test_method_upload(self, client: Gcore) -> None:
@parametrize
def test_method_upload_with_all_params(self, client: Gcore) -> None:
- image = client.cloud.gpu_virtual_clusters.images.upload(
+ image = client.cloud.gpu_virtual.clusters.images.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -173,7 +173,7 @@ def test_method_upload_with_all_params(self, client: Gcore) -> None:
@parametrize
def test_raw_response_upload(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.images.with_raw_response.upload(
+ response = client.cloud.gpu_virtual.clusters.images.with_raw_response.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -187,7 +187,7 @@ def test_raw_response_upload(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_upload(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.images.with_streaming_response.upload(
+ with client.cloud.gpu_virtual.clusters.images.with_streaming_response.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -209,7 +209,7 @@ class TestAsyncImages:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
- image = await async_client.cloud.gpu_virtual_clusters.images.list(
+ image = await async_client.cloud.gpu_virtual.clusters.images.list(
project_id=1,
region_id=7,
)
@@ -217,7 +217,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.images.with_raw_response.list(
+ response = await async_client.cloud.gpu_virtual.clusters.images.with_raw_response.list(
project_id=1,
region_id=7,
)
@@ -229,7 +229,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.images.with_streaming_response.list(
+ async with async_client.cloud.gpu_virtual.clusters.images.with_streaming_response.list(
project_id=1,
region_id=7,
) as response:
@@ -243,7 +243,7 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_delete(self, async_client: AsyncGcore) -> None:
- image = await async_client.cloud.gpu_virtual_clusters.images.delete(
+ image = await async_client.cloud.gpu_virtual.clusters.images.delete(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -252,7 +252,7 @@ async def test_method_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.images.with_raw_response.delete(
+ response = await async_client.cloud.gpu_virtual.clusters.images.with_raw_response.delete(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -265,7 +265,7 @@ async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.images.with_streaming_response.delete(
+ async with async_client.cloud.gpu_virtual.clusters.images.with_streaming_response.delete(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -281,7 +281,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None
@parametrize
async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `image_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.images.with_raw_response.delete(
+ await async_client.cloud.gpu_virtual.clusters.images.with_raw_response.delete(
image_id="",
project_id=1,
region_id=7,
@@ -289,7 +289,7 @@ async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_get(self, async_client: AsyncGcore) -> None:
- image = await async_client.cloud.gpu_virtual_clusters.images.get(
+ image = await async_client.cloud.gpu_virtual.clusters.images.get(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -298,7 +298,7 @@ async def test_method_get(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.images.with_raw_response.get(
+ response = await async_client.cloud.gpu_virtual.clusters.images.with_raw_response.get(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -311,7 +311,7 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.images.with_streaming_response.get(
+ async with async_client.cloud.gpu_virtual.clusters.images.with_streaming_response.get(
image_id="8cab6f28-09ca-4201-b3f7-23c7893f4bd6",
project_id=1,
region_id=7,
@@ -327,7 +327,7 @@ async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_path_params_get(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `image_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.images.with_raw_response.get(
+ await async_client.cloud.gpu_virtual.clusters.images.with_raw_response.get(
image_id="",
project_id=1,
region_id=7,
@@ -335,7 +335,7 @@ async def test_path_params_get(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_upload(self, async_client: AsyncGcore) -> None:
- image = await async_client.cloud.gpu_virtual_clusters.images.upload(
+ image = await async_client.cloud.gpu_virtual.clusters.images.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -345,7 +345,7 @@ async def test_method_upload(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_upload_with_all_params(self, async_client: AsyncGcore) -> None:
- image = await async_client.cloud.gpu_virtual_clusters.images.upload(
+ image = await async_client.cloud.gpu_virtual.clusters.images.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -363,7 +363,7 @@ async def test_method_upload_with_all_params(self, async_client: AsyncGcore) ->
@parametrize
async def test_raw_response_upload(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.images.with_raw_response.upload(
+ response = await async_client.cloud.gpu_virtual.clusters.images.with_raw_response.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
@@ -377,7 +377,7 @@ async def test_raw_response_upload(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_upload(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.images.with_streaming_response.upload(
+ async with async_client.cloud.gpu_virtual.clusters.images.with_streaming_response.upload(
project_id=1,
region_id=7,
name="ubuntu-23.10-x64",
diff --git a/tests/api_resources/cloud/gpu_virtual_clusters/test_interfaces.py b/tests/api_resources/cloud/gpu_virtual/clusters/test_interfaces.py
similarity index 87%
rename from tests/api_resources/cloud/gpu_virtual_clusters/test_interfaces.py
rename to tests/api_resources/cloud/gpu_virtual/clusters/test_interfaces.py
index c36ac28b..b2cbbb85 100644
--- a/tests/api_resources/cloud/gpu_virtual_clusters/test_interfaces.py
+++ b/tests/api_resources/cloud/gpu_virtual/clusters/test_interfaces.py
@@ -9,7 +9,7 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
-from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualInterfaceList
+from gcore.types.cloud.gpu_virtual.clusters import GPUVirtualInterfaceList
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -19,7 +19,7 @@ class TestInterfaces:
@parametrize
def test_method_list(self, client: Gcore) -> None:
- interface = client.cloud.gpu_virtual_clusters.interfaces.list(
+ interface = client.cloud.gpu_virtual.clusters.interfaces.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -28,7 +28,7 @@ def test_method_list(self, client: Gcore) -> None:
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.interfaces.with_raw_response.list(
+ response = client.cloud.gpu_virtual.clusters.interfaces.with_raw_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.interfaces.with_streaming_response.list(
+ with client.cloud.gpu_virtual.clusters.interfaces.with_streaming_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -57,7 +57,7 @@ def test_streaming_response_list(self, client: Gcore) -> None:
@parametrize
def test_path_params_list(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.interfaces.with_raw_response.list(
+ client.cloud.gpu_virtual.clusters.interfaces.with_raw_response.list(
cluster_id="",
project_id=1,
region_id=7,
@@ -71,7 +71,7 @@ class TestAsyncInterfaces:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
- interface = await async_client.cloud.gpu_virtual_clusters.interfaces.list(
+ interface = await async_client.cloud.gpu_virtual.clusters.interfaces.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -80,7 +80,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.interfaces.with_raw_response.list(
+ response = await async_client.cloud.gpu_virtual.clusters.interfaces.with_raw_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -93,7 +93,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.interfaces.with_streaming_response.list(
+ async with async_client.cloud.gpu_virtual.clusters.interfaces.with_streaming_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -109,7 +109,7 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_path_params_list(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.interfaces.with_raw_response.list(
+ await async_client.cloud.gpu_virtual.clusters.interfaces.with_raw_response.list(
cluster_id="",
project_id=1,
region_id=7,
diff --git a/tests/api_resources/cloud/gpu_virtual_clusters/test_servers.py b/tests/api_resources/cloud/gpu_virtual/clusters/test_servers.py
similarity index 88%
rename from tests/api_resources/cloud/gpu_virtual_clusters/test_servers.py
rename to tests/api_resources/cloud/gpu_virtual/clusters/test_servers.py
index 6e341c99..29ca8dc8 100644
--- a/tests/api_resources/cloud/gpu_virtual_clusters/test_servers.py
+++ b/tests/api_resources/cloud/gpu_virtual/clusters/test_servers.py
@@ -11,7 +11,7 @@
from tests.utils import assert_matches_type
from gcore._utils import parse_datetime
from gcore.types.cloud import TaskIDList
-from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualClusterServerList
+from gcore.types.cloud.gpu_virtual.clusters import GPUVirtualClusterServerList
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -21,7 +21,7 @@ class TestServers:
@parametrize
def test_method_list(self, client: Gcore) -> None:
- server = client.cloud.gpu_virtual_clusters.servers.list(
+ server = client.cloud.gpu_virtual.clusters.servers.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -30,7 +30,7 @@ def test_method_list(self, client: Gcore) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Gcore) -> None:
- server = client.cloud.gpu_virtual_clusters.servers.list(
+ server = client.cloud.gpu_virtual.clusters.servers.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -48,7 +48,7 @@ def test_method_list_with_all_params(self, client: Gcore) -> None:
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.servers.with_raw_response.list(
+ response = client.cloud.gpu_virtual.clusters.servers.with_raw_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -61,7 +61,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.servers.with_streaming_response.list(
+ with client.cloud.gpu_virtual.clusters.servers.with_streaming_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -77,7 +77,7 @@ def test_streaming_response_list(self, client: Gcore) -> None:
@parametrize
def test_path_params_list(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.servers.with_raw_response.list(
+ client.cloud.gpu_virtual.clusters.servers.with_raw_response.list(
cluster_id="",
project_id=1,
region_id=7,
@@ -85,7 +85,7 @@ def test_path_params_list(self, client: Gcore) -> None:
@parametrize
def test_method_delete(self, client: Gcore) -> None:
- server = client.cloud.gpu_virtual_clusters.servers.delete(
+ server = client.cloud.gpu_virtual.clusters.servers.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -95,7 +95,7 @@ def test_method_delete(self, client: Gcore) -> None:
@parametrize
def test_method_delete_with_all_params(self, client: Gcore) -> None:
- server = client.cloud.gpu_virtual_clusters.servers.delete(
+ server = client.cloud.gpu_virtual.clusters.servers.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -111,7 +111,7 @@ def test_method_delete_with_all_params(self, client: Gcore) -> None:
@parametrize
def test_raw_response_delete(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.servers.with_raw_response.delete(
+ response = client.cloud.gpu_virtual.clusters.servers.with_raw_response.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -125,7 +125,7 @@ def test_raw_response_delete(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_delete(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.servers.with_streaming_response.delete(
+ with client.cloud.gpu_virtual.clusters.servers.with_streaming_response.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -142,7 +142,7 @@ def test_streaming_response_delete(self, client: Gcore) -> None:
@parametrize
def test_path_params_delete(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.servers.with_raw_response.delete(
+ client.cloud.gpu_virtual.clusters.servers.with_raw_response.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -150,7 +150,7 @@ def test_path_params_delete(self, client: Gcore) -> None:
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `server_id` but received ''"):
- client.cloud.gpu_virtual_clusters.servers.with_raw_response.delete(
+ client.cloud.gpu_virtual.clusters.servers.with_raw_response.delete(
server_id="",
project_id=1,
region_id=7,
@@ -165,7 +165,7 @@ class TestAsyncServers:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_virtual_clusters.servers.list(
+ server = await async_client.cloud.gpu_virtual.clusters.servers.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -174,7 +174,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_virtual_clusters.servers.list(
+ server = await async_client.cloud.gpu_virtual.clusters.servers.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -192,7 +192,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> No
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.servers.with_raw_response.list(
+ response = await async_client.cloud.gpu_virtual.clusters.servers.with_raw_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -205,7 +205,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.servers.with_streaming_response.list(
+ async with async_client.cloud.gpu_virtual.clusters.servers.with_streaming_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -221,7 +221,7 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_path_params_list(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.servers.with_raw_response.list(
+ await async_client.cloud.gpu_virtual.clusters.servers.with_raw_response.list(
cluster_id="",
project_id=1,
region_id=7,
@@ -229,7 +229,7 @@ async def test_path_params_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_delete(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_virtual_clusters.servers.delete(
+ server = await async_client.cloud.gpu_virtual.clusters.servers.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -239,7 +239,7 @@ async def test_method_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_delete_with_all_params(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_virtual_clusters.servers.delete(
+ server = await async_client.cloud.gpu_virtual.clusters.servers.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -255,7 +255,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGcore) ->
@parametrize
async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.servers.with_raw_response.delete(
+ response = await async_client.cloud.gpu_virtual.clusters.servers.with_raw_response.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -269,7 +269,7 @@ async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.servers.with_streaming_response.delete(
+ async with async_client.cloud.gpu_virtual.clusters.servers.with_streaming_response.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -286,7 +286,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None
@parametrize
async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.servers.with_raw_response.delete(
+ await async_client.cloud.gpu_virtual.clusters.servers.with_raw_response.delete(
server_id="f1c1eeb6-1834-48c9-a7b0-daafce64872b",
project_id=1,
region_id=7,
@@ -294,7 +294,7 @@ async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `server_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.servers.with_raw_response.delete(
+ await async_client.cloud.gpu_virtual.clusters.servers.with_raw_response.delete(
server_id="",
project_id=1,
region_id=7,
diff --git a/tests/api_resources/cloud/gpu_virtual_clusters/test_volumes.py b/tests/api_resources/cloud/gpu_virtual/clusters/test_volumes.py
similarity index 87%
rename from tests/api_resources/cloud/gpu_virtual_clusters/test_volumes.py
rename to tests/api_resources/cloud/gpu_virtual/clusters/test_volumes.py
index 294f4466..37d10355 100644
--- a/tests/api_resources/cloud/gpu_virtual_clusters/test_volumes.py
+++ b/tests/api_resources/cloud/gpu_virtual/clusters/test_volumes.py
@@ -9,7 +9,7 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
-from gcore.types.cloud.gpu_virtual_clusters import GPUVirtualClusterVolumeList
+from gcore.types.cloud.gpu_virtual.clusters import GPUVirtualClusterVolumeList
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -19,7 +19,7 @@ class TestVolumes:
@parametrize
def test_method_list(self, client: Gcore) -> None:
- volume = client.cloud.gpu_virtual_clusters.volumes.list(
+ volume = client.cloud.gpu_virtual.clusters.volumes.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -28,7 +28,7 @@ def test_method_list(self, client: Gcore) -> None:
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.volumes.with_raw_response.list(
+ response = client.cloud.gpu_virtual.clusters.volumes.with_raw_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Gcore) -> None:
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.volumes.with_streaming_response.list(
+ with client.cloud.gpu_virtual.clusters.volumes.with_streaming_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -57,7 +57,7 @@ def test_streaming_response_list(self, client: Gcore) -> None:
@parametrize
def test_path_params_list(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.volumes.with_raw_response.list(
+ client.cloud.gpu_virtual.clusters.volumes.with_raw_response.list(
cluster_id="",
project_id=1,
region_id=7,
@@ -71,7 +71,7 @@ class TestAsyncVolumes:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
- volume = await async_client.cloud.gpu_virtual_clusters.volumes.list(
+ volume = await async_client.cloud.gpu_virtual.clusters.volumes.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -80,7 +80,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.volumes.with_raw_response.list(
+ response = await async_client.cloud.gpu_virtual.clusters.volumes.with_raw_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -93,7 +93,7 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.volumes.with_streaming_response.list(
+ async with async_client.cloud.gpu_virtual.clusters.volumes.with_streaming_response.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -109,7 +109,7 @@ async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_path_params_list(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.volumes.with_raw_response.list(
+ await async_client.cloud.gpu_virtual.clusters.volumes.with_raw_response.list(
cluster_id="",
project_id=1,
region_id=7,
diff --git a/tests/api_resources/cloud/test_gpu_virtual_clusters.py b/tests/api_resources/cloud/gpu_virtual/test_clusters.py
similarity index 73%
rename from tests/api_resources/cloud/test_gpu_virtual_clusters.py
rename to tests/api_resources/cloud/gpu_virtual/test_clusters.py
index 6f3758e5..91d2ae2d 100644
--- a/tests/api_resources/cloud/test_gpu_virtual_clusters.py
+++ b/tests/api_resources/cloud/gpu_virtual/test_clusters.py
@@ -10,20 +10,20 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
from gcore.pagination import SyncOffsetPage, AsyncOffsetPage
-from gcore.types.cloud import (
- TaskIDList,
+from gcore.types.cloud import TaskIDList
+from gcore.types.cloud.gpu_virtual import (
GPUVirtualCluster,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-class TestGPUVirtualClusters:
+class TestClusters:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
def test_method_create(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.create(
+ cluster = client.cloud.gpu_virtual.clusters.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -42,11 +42,11 @@ def test_method_create(self, client: Gcore) -> None:
],
},
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.create(
+ cluster = client.cloud.gpu_virtual.clusters.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -87,11 +87,11 @@ def test_method_create_with_all_params(self, client: Gcore) -> None:
},
tags={"my-tag": "my-tag-value"},
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_create(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.create(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -113,12 +113,12 @@ def test_raw_response_create(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.create(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -140,24 +140,24 @@ def test_streaming_response_create(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_method_update(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.update(
+ cluster = client.cloud.gpu_virtual.clusters.update(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
name="gpu-cluster-1",
)
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
def test_raw_response_update(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.update(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.update(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -166,12 +166,12 @@ def test_raw_response_update(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.update(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.update(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -180,15 +180,15 @@ def test_streaming_response_update(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_update(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.update(
+ client.cloud.gpu_virtual.clusters.with_raw_response.update(
cluster_id="",
project_id=1,
region_id=7,
@@ -197,60 +197,60 @@ def test_path_params_update(self, client: Gcore) -> None:
@parametrize
def test_method_list(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.list(
+ cluster = client.cloud.gpu_virtual.clusters.list(
project_id=1,
region_id=7,
)
- assert_matches_type(SyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ assert_matches_type(SyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.list(
+ cluster = client.cloud.gpu_virtual.clusters.list(
project_id=1,
region_id=7,
limit=10,
offset=0,
)
- assert_matches_type(SyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ assert_matches_type(SyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
@parametrize
def test_raw_response_list(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.list(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.list(
project_id=1,
region_id=7,
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(SyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(SyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.list(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.list(
project_id=1,
region_id=7,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(SyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(SyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_method_delete(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.delete(
+ cluster = client.cloud.gpu_virtual.clusters.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_method_delete_with_all_params(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.delete(
+ cluster = client.cloud.gpu_virtual.clusters.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -261,11 +261,11 @@ def test_method_delete_with_all_params(self, client: Gcore) -> None:
reserved_fixed_ip_ids=["a29b8e1e-08d3-4cec-91fb-06e81e5f46d5"],
volume_ids=["1333c684-c3da-4b91-ac9e-a92706aa2824"],
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.delete(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -273,12 +273,12 @@ def test_raw_response_delete(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_delete(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.delete(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -286,15 +286,15 @@ def test_streaming_response_delete(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_delete(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.delete(
+ client.cloud.gpu_virtual.clusters.with_raw_response.delete(
cluster_id="",
project_id=1,
region_id=7,
@@ -302,17 +302,17 @@ def test_path_params_delete(self, client: Gcore) -> None:
@parametrize
def test_method_action_overload_1(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.action(
+ cluster = client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="start",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_action_overload_1(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -321,12 +321,12 @@ def test_raw_response_action_overload_1(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_action_overload_1(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -335,15 +335,15 @@ def test_streaming_response_action_overload_1(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_action_overload_1(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -352,17 +352,17 @@ def test_path_params_action_overload_1(self, client: Gcore) -> None:
@parametrize
def test_method_action_overload_2(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.action(
+ cluster = client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="stop",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_action_overload_2(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -371,12 +371,12 @@ def test_raw_response_action_overload_2(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_action_overload_2(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -385,15 +385,15 @@ def test_streaming_response_action_overload_2(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_action_overload_2(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -402,17 +402,17 @@ def test_path_params_action_overload_2(self, client: Gcore) -> None:
@parametrize
def test_method_action_overload_3(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.action(
+ cluster = client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="soft_reboot",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_action_overload_3(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -421,12 +421,12 @@ def test_raw_response_action_overload_3(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_action_overload_3(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -435,15 +435,15 @@ def test_streaming_response_action_overload_3(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_action_overload_3(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -452,17 +452,17 @@ def test_path_params_action_overload_3(self, client: Gcore) -> None:
@parametrize
def test_method_action_overload_4(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.action(
+ cluster = client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="hard_reboot",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_action_overload_4(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -471,12 +471,12 @@ def test_raw_response_action_overload_4(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_action_overload_4(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -485,15 +485,15 @@ def test_streaming_response_action_overload_4(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_action_overload_4(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -502,18 +502,18 @@ def test_path_params_action_overload_4(self, client: Gcore) -> None:
@parametrize
def test_method_action_overload_5(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.action(
+ cluster = client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="update_tags",
tags={"foo": "my-tag-value"},
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_action_overload_5(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -523,12 +523,12 @@ def test_raw_response_action_overload_5(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_action_overload_5(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -538,15 +538,15 @@ def test_streaming_response_action_overload_5(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_action_overload_5(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -556,18 +556,18 @@ def test_path_params_action_overload_5(self, client: Gcore) -> None:
@parametrize
def test_method_action_overload_6(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.action(
+ cluster = client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="resize",
servers_count=5,
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_raw_response_action_overload_6(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -577,12 +577,12 @@ def test_raw_response_action_overload_6(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
def test_streaming_response_action_overload_6(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -592,15 +592,15 @@ def test_streaming_response_action_overload_6(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_action_overload_6(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -610,16 +610,16 @@ def test_path_params_action_overload_6(self, client: Gcore) -> None:
@parametrize
def test_method_get(self, client: Gcore) -> None:
- gpu_virtual_cluster = client.cloud.gpu_virtual_clusters.get(
+ cluster = client.cloud.gpu_virtual.clusters.get(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
)
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
def test_raw_response_get(self, client: Gcore) -> None:
- response = client.cloud.gpu_virtual_clusters.with_raw_response.get(
+ response = client.cloud.gpu_virtual.clusters.with_raw_response.get(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -627,12 +627,12 @@ def test_raw_response_get(self, client: Gcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
def test_streaming_response_get(self, client: Gcore) -> None:
- with client.cloud.gpu_virtual_clusters.with_streaming_response.get(
+ with client.cloud.gpu_virtual.clusters.with_streaming_response.get(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -640,29 +640,29 @@ def test_streaming_response_get(self, client: Gcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_get(self, client: Gcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- client.cloud.gpu_virtual_clusters.with_raw_response.get(
+ client.cloud.gpu_virtual.clusters.with_raw_response.get(
cluster_id="",
project_id=1,
region_id=7,
)
-class TestAsyncGPUVirtualClusters:
+class TestAsyncClusters:
parametrize = pytest.mark.parametrize(
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)
@parametrize
async def test_method_create(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.create(
+ cluster = await async_client.cloud.gpu_virtual.clusters.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -681,11 +681,11 @@ async def test_method_create(self, async_client: AsyncGcore) -> None:
],
},
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.create(
+ cluster = await async_client.cloud.gpu_virtual.clusters.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -726,11 +726,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) ->
},
tags={"my-tag": "my-tag-value"},
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.create(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -752,12 +752,12 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.create(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
@@ -779,24 +779,24 @@ async def test_streaming_response_create(self, async_client: AsyncGcore) -> None
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_method_update(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.update(
+ cluster = await async_client.cloud.gpu_virtual.clusters.update(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
name="gpu-cluster-1",
)
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.update(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.update(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -805,12 +805,12 @@ async def test_raw_response_update(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.update(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.update(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -819,15 +819,15 @@ async def test_streaming_response_update(self, async_client: AsyncGcore) -> None
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_update(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.update(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.update(
cluster_id="",
project_id=1,
region_id=7,
@@ -836,60 +836,60 @@ async def test_path_params_update(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.list(
+ cluster = await async_client.cloud.gpu_virtual.clusters.list(
project_id=1,
region_id=7,
)
- assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.list(
+ cluster = await async_client.cloud.gpu_virtual.clusters.list(
project_id=1,
region_id=7,
limit=10,
offset=0,
)
- assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.list(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.list(
project_id=1,
region_id=7,
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.list(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.list(
project_id=1,
region_id=7,
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(AsyncOffsetPage[GPUVirtualCluster], cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_method_delete(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.delete(
+ cluster = await async_client.cloud.gpu_virtual.clusters.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_method_delete_with_all_params(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.delete(
+ cluster = await async_client.cloud.gpu_virtual.clusters.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -900,11 +900,11 @@ async def test_method_delete_with_all_params(self, async_client: AsyncGcore) ->
reserved_fixed_ip_ids=["a29b8e1e-08d3-4cec-91fb-06e81e5f46d5"],
volume_ids=["1333c684-c3da-4b91-ac9e-a92706aa2824"],
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.delete(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -912,12 +912,12 @@ async def test_raw_response_delete(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.delete(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.delete(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -925,15 +925,15 @@ async def test_streaming_response_delete(self, async_client: AsyncGcore) -> None
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.delete(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.delete(
cluster_id="",
project_id=1,
region_id=7,
@@ -941,17 +941,17 @@ async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
@parametrize
async def test_method_action_overload_1(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.action(
+ cluster = await async_client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="start",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_action_overload_1(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -960,12 +960,12 @@ async def test_raw_response_action_overload_1(self, async_client: AsyncGcore) ->
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_action_overload_1(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -974,15 +974,15 @@ async def test_streaming_response_action_overload_1(self, async_client: AsyncGco
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_action_overload_1(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -991,17 +991,17 @@ async def test_path_params_action_overload_1(self, async_client: AsyncGcore) ->
@parametrize
async def test_method_action_overload_2(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.action(
+ cluster = await async_client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="stop",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_action_overload_2(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1010,12 +1010,12 @@ async def test_raw_response_action_overload_2(self, async_client: AsyncGcore) ->
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_action_overload_2(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1024,15 +1024,15 @@ async def test_streaming_response_action_overload_2(self, async_client: AsyncGco
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_action_overload_2(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -1041,17 +1041,17 @@ async def test_path_params_action_overload_2(self, async_client: AsyncGcore) ->
@parametrize
async def test_method_action_overload_3(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.action(
+ cluster = await async_client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="soft_reboot",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_action_overload_3(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1060,12 +1060,12 @@ async def test_raw_response_action_overload_3(self, async_client: AsyncGcore) ->
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_action_overload_3(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1074,15 +1074,15 @@ async def test_streaming_response_action_overload_3(self, async_client: AsyncGco
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_action_overload_3(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -1091,17 +1091,17 @@ async def test_path_params_action_overload_3(self, async_client: AsyncGcore) ->
@parametrize
async def test_method_action_overload_4(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.action(
+ cluster = await async_client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="hard_reboot",
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_action_overload_4(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1110,12 +1110,12 @@ async def test_raw_response_action_overload_4(self, async_client: AsyncGcore) ->
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_action_overload_4(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1124,15 +1124,15 @@ async def test_streaming_response_action_overload_4(self, async_client: AsyncGco
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_action_overload_4(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -1141,18 +1141,18 @@ async def test_path_params_action_overload_4(self, async_client: AsyncGcore) ->
@parametrize
async def test_method_action_overload_5(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.action(
+ cluster = await async_client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="update_tags",
tags={"foo": "my-tag-value"},
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_action_overload_5(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1162,12 +1162,12 @@ async def test_raw_response_action_overload_5(self, async_client: AsyncGcore) ->
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_action_overload_5(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1177,15 +1177,15 @@ async def test_streaming_response_action_overload_5(self, async_client: AsyncGco
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_action_overload_5(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -1195,18 +1195,18 @@ async def test_path_params_action_overload_5(self, async_client: AsyncGcore) ->
@parametrize
async def test_method_action_overload_6(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.action(
+ cluster = await async_client.cloud.gpu_virtual.clusters.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
action="resize",
servers_count=5,
)
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_raw_response_action_overload_6(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1216,12 +1216,12 @@ async def test_raw_response_action_overload_6(self, async_client: AsyncGcore) ->
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
@parametrize
async def test_streaming_response_action_overload_6(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.action(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.action(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1231,15 +1231,15 @@ async def test_streaming_response_action_overload_6(self, async_client: AsyncGco
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(TaskIDList, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(TaskIDList, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_action_overload_6(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.action(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.action(
cluster_id="",
project_id=1,
region_id=7,
@@ -1249,16 +1249,16 @@ async def test_path_params_action_overload_6(self, async_client: AsyncGcore) ->
@parametrize
async def test_method_get(self, async_client: AsyncGcore) -> None:
- gpu_virtual_cluster = await async_client.cloud.gpu_virtual_clusters.get(
+ cluster = await async_client.cloud.gpu_virtual.clusters.get(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
)
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_virtual_clusters.with_raw_response.get(
+ response = await async_client.cloud.gpu_virtual.clusters.with_raw_response.get(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1266,12 +1266,12 @@ async def test_raw_response_get(self, async_client: AsyncGcore) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
@parametrize
async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_virtual_clusters.with_streaming_response.get(
+ async with async_client.cloud.gpu_virtual.clusters.with_streaming_response.get(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
@@ -1279,15 +1279,15 @@ async def test_streaming_response_get(self, async_client: AsyncGcore) -> None:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- gpu_virtual_cluster = await response.parse()
- assert_matches_type(GPUVirtualCluster, gpu_virtual_cluster, path=["response"])
+ cluster = await response.parse()
+ assert_matches_type(GPUVirtualCluster, cluster, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_get(self, async_client: AsyncGcore) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `cluster_id` but received ''"):
- await async_client.cloud.gpu_virtual_clusters.with_raw_response.get(
+ await async_client.cloud.gpu_virtual.clusters.with_raw_response.get(
cluster_id="",
project_id=1,
region_id=7,
From 053ebcfdf462a66c3edc929e052b75d8afd51a20 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:42:21 +0000
Subject: [PATCH 13/14] fix(cloud)!: move methods to
gpu_baremetal_clusters.interfaces.attach()/detach()
---
.stats.yml | 2 +-
api.md | 4 +-
examples/cloud/audit_logs.py | 4 +-
examples/cloud/audit_logs_async.py | 4 +-
scripts/lint | 9 +-
src/gcore/_base_client.py | 10 +-
src/gcore/_client.py | 456 +++--------
src/gcore/resources/__init__.py | 130 ++++
.../gpu_baremetal_clusters/interfaces.py | 628 ++++++++++++++-
.../cloud/gpu_baremetal_clusters/servers.py | 643 +--------------
.../cloud/gpu_baremetal_clusters/__init__.py | 4 +-
...e_params.py => interface_attach_params.py} | 4 +-
...e_params.py => interface_detach_params.py} | 4 +-
.../gpu_baremetal_clusters/test_interfaces.py | 736 +++++++++++++++++-
.../gpu_baremetal_clusters/test_servers.py | 734 -----------------
15 files changed, 1609 insertions(+), 1763 deletions(-)
rename src/gcore/types/cloud/gpu_baremetal_clusters/{server_attach_interface_params.py => interface_attach_params.py} (98%)
rename src/gcore/types/cloud/gpu_baremetal_clusters/{server_detach_interface_params.py => interface_detach_params.py} (76%)
diff --git a/.stats.yml b/.stats.yml
index fc3e8dc4..f80e20ce 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 641
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-2c3abe1f1637f97f6bc750aff6eb77efc45ac2b527376541ac2af6b9626b35af.yml
openapi_spec_hash: ff74a4ccd9ec5ddb1a65963d52e709ba
-config_hash: e76c698a64f32a4f2b33e2099e771d83
+config_hash: 0df262ae146e43627e9daf27e6b3bebf
diff --git a/api.md b/api.md
index bc132d4d..562bb4ed 100644
--- a/api.md
+++ b/api.md
@@ -798,6 +798,8 @@ Methods:
Methods:
- client.cloud.gpu_baremetal_clusters.interfaces.list(cluster_id, \*, project_id, region_id) -> NetworkInterfaceList
+- client.cloud.gpu_baremetal_clusters.interfaces.attach(instance_id, \*, project_id, region_id, \*\*params) -> TaskIDList
+- client.cloud.gpu_baremetal_clusters.interfaces.detach(instance_id, \*, project_id, region_id, \*\*params) -> TaskIDList
### Servers
@@ -815,8 +817,6 @@ Methods:
- client.cloud.gpu_baremetal_clusters.servers.list(cluster_id, \*, project_id, region_id, \*\*params) -> SyncOffsetPage[GPUBaremetalClusterServer]
- client.cloud.gpu_baremetal_clusters.servers.delete(instance_id, \*, project_id, region_id, cluster_id, \*\*params) -> TaskIDList
-- client.cloud.gpu_baremetal_clusters.servers.attach_interface(instance_id, \*, project_id, region_id, \*\*params) -> TaskIDList
-- client.cloud.gpu_baremetal_clusters.servers.detach_interface(instance_id, \*, project_id, region_id, \*\*params) -> TaskIDList
- client.cloud.gpu_baremetal_clusters.servers.get_console(instance_id, \*, project_id, region_id) -> Console
- client.cloud.gpu_baremetal_clusters.servers.powercycle(instance_id, \*, project_id, region_id) -> GPUBaremetalClusterServerV1
- client.cloud.gpu_baremetal_clusters.servers.reboot(instance_id, \*, project_id, region_id) -> GPUBaremetalClusterServerV1
diff --git a/examples/cloud/audit_logs.py b/examples/cloud/audit_logs.py
index 5d9ff505..2dbdd2c9 100644
--- a/examples/cloud/audit_logs.py
+++ b/examples/cloud/audit_logs.py
@@ -21,8 +21,8 @@ def main() -> None:
# Example: list the last 10 user actions of type 'create' in the 'instance' api_group from the last 7 days
from_time = (datetime.now(timezone.utc) - timedelta(days=7)).isoformat()
logs = gcore.cloud.audit_logs.list(
- action_type=["create"],
- api_group=["instance"],
+ # action_type=["create"],
+ # api_group=["instance"],
from_timestamp=from_time,
limit=10,
order_by="desc",
diff --git a/examples/cloud/audit_logs_async.py b/examples/cloud/audit_logs_async.py
index 994bb3b8..8e56fa8d 100644
--- a/examples/cloud/audit_logs_async.py
+++ b/examples/cloud/audit_logs_async.py
@@ -22,8 +22,8 @@ async def main() -> None:
# Example: list the last 10 user actions of type 'create' in the 'instance' api_group from the last 7 days
from_time = (datetime.now(timezone.utc) - timedelta(days=7)).isoformat()
logs = await gcore.cloud.audit_logs.list(
- action_type=["create"],
- api_group=["instance"],
+ # action_type=["create"],
+ # api_group=["instance"],
from_timestamp=from_time,
limit=10,
order_by="desc",
diff --git a/scripts/lint b/scripts/lint
index 1d30512d..3bb2d385 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -4,13 +4,8 @@ set -e
cd "$(dirname "$0")/.."
-if [ "$1" = "--fix" ]; then
- echo "==> Running lints with --fix"
- rye run fix:ruff
-else
- echo "==> Running lints"
- rye run lint
-fi
+echo "==> Running lints"
+rye run lint
echo "==> Making sure it imports"
rye run python -c 'import gcore'
diff --git a/src/gcore/_base_client.py b/src/gcore/_base_client.py
index 56aeddf3..b68aa376 100644
--- a/src/gcore/_base_client.py
+++ b/src/gcore/_base_client.py
@@ -1247,12 +1247,9 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
- files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(
- method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
- )
+ opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
return self.request(cast_to, opts)
def put(
@@ -1770,12 +1767,9 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
- files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(
- method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
- )
+ opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
return await self.request(cast_to, opts)
async def put(
diff --git a/src/gcore/_client.py b/src/gcore/_client.py
index 4bd616d2..d900f571 100644
--- a/src/gcore/_client.py
+++ b/src/gcore/_client.py
@@ -3,7 +3,7 @@
from __future__ import annotations
import os
-from typing import TYPE_CHECKING, Any, Mapping
+from typing import Any, Mapping
from typing_extensions import Self, override
import httpx
@@ -20,7 +20,6 @@
not_given,
)
from ._utils import is_given, get_async_library, maybe_coerce_integer
-from ._compat import cached_property
from ._version import __version__
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import GcoreError, APIStatusError
@@ -29,23 +28,32 @@
SyncAPIClient,
AsyncAPIClient,
)
-
-if TYPE_CHECKING:
- from .resources import cdn, dns, iam, waap, cloud, storage, fastedge, security, streaming
- from .resources.cdn.cdn import CdnResource, AsyncCdnResource
- from .resources.dns.dns import DNSResource, AsyncDNSResource
- from .resources.iam.iam import IamResource, AsyncIamResource
- from .resources.waap.waap import WaapResource, AsyncWaapResource
- from .resources.cloud.cloud import CloudResource, AsyncCloudResource
- from .resources.storage.storage import StorageResource, AsyncStorageResource
- from .resources.fastedge.fastedge import FastedgeResource, AsyncFastedgeResource
- from .resources.security.security import SecurityResource, AsyncSecurityResource
- from .resources.streaming.streaming import StreamingResource, AsyncStreamingResource
+from .resources.cdn import cdn
+from .resources.dns import dns
+from .resources.iam import iam
+from .resources.waap import waap
+from .resources.cloud import cloud
+from .resources.storage import storage
+from .resources.fastedge import fastedge
+from .resources.security import security
+from .resources.streaming import streaming
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gcore", "AsyncGcore", "Client", "AsyncClient"]
class Gcore(SyncAPIClient):
+ cloud: cloud.CloudResource
+ waap: waap.WaapResource
+ iam: iam.IamResource
+ fastedge: fastedge.FastedgeResource
+ streaming: streaming.StreamingResource
+ security: security.SecurityResource
+ dns: dns.DNSResource
+ storage: storage.StorageResource
+ cdn: cdn.CdnResource
+ with_raw_response: GcoreWithRawResponse
+ with_streaming_response: GcoreWithStreamedResponse
+
# client options
api_key: str
cloud_project_id: int | None
@@ -127,67 +135,17 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- @cached_property
- def cloud(self) -> CloudResource:
- from .resources.cloud import CloudResource
-
- return CloudResource(self)
-
- @cached_property
- def waap(self) -> WaapResource:
- from .resources.waap import WaapResource
-
- return WaapResource(self)
-
- @cached_property
- def iam(self) -> IamResource:
- from .resources.iam import IamResource
-
- return IamResource(self)
-
- @cached_property
- def fastedge(self) -> FastedgeResource:
- from .resources.fastedge import FastedgeResource
-
- return FastedgeResource(self)
-
- @cached_property
- def streaming(self) -> StreamingResource:
- from .resources.streaming import StreamingResource
-
- return StreamingResource(self)
-
- @cached_property
- def security(self) -> SecurityResource:
- from .resources.security import SecurityResource
-
- return SecurityResource(self)
-
- @cached_property
- def dns(self) -> DNSResource:
- from .resources.dns import DNSResource
-
- return DNSResource(self)
-
- @cached_property
- def storage(self) -> StorageResource:
- from .resources.storage import StorageResource
-
- return StorageResource(self)
-
- @cached_property
- def cdn(self) -> CdnResource:
- from .resources.cdn import CdnResource
-
- return CdnResource(self)
-
- @cached_property
- def with_raw_response(self) -> GcoreWithRawResponse:
- return GcoreWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> GcoreWithStreamedResponse:
- return GcoreWithStreamedResponse(self)
+ self.cloud = cloud.CloudResource(self)
+ self.waap = waap.WaapResource(self)
+ self.iam = iam.IamResource(self)
+ self.fastedge = fastedge.FastedgeResource(self)
+ self.streaming = streaming.StreamingResource(self)
+ self.security = security.SecurityResource(self)
+ self.dns = dns.DNSResource(self)
+ self.storage = storage.StorageResource(self)
+ self.cdn = cdn.CdnResource(self)
+ self.with_raw_response = GcoreWithRawResponse(self)
+ self.with_streaming_response = GcoreWithStreamedResponse(self)
@property
@override
@@ -321,6 +279,18 @@ def _make_status_error(
class AsyncGcore(AsyncAPIClient):
+ cloud: cloud.AsyncCloudResource
+ waap: waap.AsyncWaapResource
+ iam: iam.AsyncIamResource
+ fastedge: fastedge.AsyncFastedgeResource
+ streaming: streaming.AsyncStreamingResource
+ security: security.AsyncSecurityResource
+ dns: dns.AsyncDNSResource
+ storage: storage.AsyncStorageResource
+ cdn: cdn.AsyncCdnResource
+ with_raw_response: AsyncGcoreWithRawResponse
+ with_streaming_response: AsyncGcoreWithStreamedResponse
+
# client options
api_key: str
cloud_project_id: int | None
@@ -402,67 +372,17 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- @cached_property
- def cloud(self) -> AsyncCloudResource:
- from .resources.cloud import AsyncCloudResource
-
- return AsyncCloudResource(self)
-
- @cached_property
- def waap(self) -> AsyncWaapResource:
- from .resources.waap import AsyncWaapResource
-
- return AsyncWaapResource(self)
-
- @cached_property
- def iam(self) -> AsyncIamResource:
- from .resources.iam import AsyncIamResource
-
- return AsyncIamResource(self)
-
- @cached_property
- def fastedge(self) -> AsyncFastedgeResource:
- from .resources.fastedge import AsyncFastedgeResource
-
- return AsyncFastedgeResource(self)
-
- @cached_property
- def streaming(self) -> AsyncStreamingResource:
- from .resources.streaming import AsyncStreamingResource
-
- return AsyncStreamingResource(self)
-
- @cached_property
- def security(self) -> AsyncSecurityResource:
- from .resources.security import AsyncSecurityResource
-
- return AsyncSecurityResource(self)
-
- @cached_property
- def dns(self) -> AsyncDNSResource:
- from .resources.dns import AsyncDNSResource
-
- return AsyncDNSResource(self)
-
- @cached_property
- def storage(self) -> AsyncStorageResource:
- from .resources.storage import AsyncStorageResource
-
- return AsyncStorageResource(self)
-
- @cached_property
- def cdn(self) -> AsyncCdnResource:
- from .resources.cdn import AsyncCdnResource
-
- return AsyncCdnResource(self)
-
- @cached_property
- def with_raw_response(self) -> AsyncGcoreWithRawResponse:
- return AsyncGcoreWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncGcoreWithStreamedResponse:
- return AsyncGcoreWithStreamedResponse(self)
+ self.cloud = cloud.AsyncCloudResource(self)
+ self.waap = waap.AsyncWaapResource(self)
+ self.iam = iam.AsyncIamResource(self)
+ self.fastedge = fastedge.AsyncFastedgeResource(self)
+ self.streaming = streaming.AsyncStreamingResource(self)
+ self.security = security.AsyncSecurityResource(self)
+ self.dns = dns.AsyncDNSResource(self)
+ self.storage = storage.AsyncStorageResource(self)
+ self.cdn = cdn.AsyncCdnResource(self)
+ self.with_raw_response = AsyncGcoreWithRawResponse(self)
+ self.with_streaming_response = AsyncGcoreWithStreamedResponse(self)
@property
@override
@@ -596,247 +516,55 @@ def _make_status_error(
class GcoreWithRawResponse:
- _client: Gcore
-
def __init__(self, client: Gcore) -> None:
- self._client = client
-
- @cached_property
- def cloud(self) -> cloud.CloudResourceWithRawResponse:
- from .resources.cloud import CloudResourceWithRawResponse
-
- return CloudResourceWithRawResponse(self._client.cloud)
-
- @cached_property
- def waap(self) -> waap.WaapResourceWithRawResponse:
- from .resources.waap import WaapResourceWithRawResponse
-
- return WaapResourceWithRawResponse(self._client.waap)
-
- @cached_property
- def iam(self) -> iam.IamResourceWithRawResponse:
- from .resources.iam import IamResourceWithRawResponse
-
- return IamResourceWithRawResponse(self._client.iam)
-
- @cached_property
- def fastedge(self) -> fastedge.FastedgeResourceWithRawResponse:
- from .resources.fastedge import FastedgeResourceWithRawResponse
-
- return FastedgeResourceWithRawResponse(self._client.fastedge)
-
- @cached_property
- def streaming(self) -> streaming.StreamingResourceWithRawResponse:
- from .resources.streaming import StreamingResourceWithRawResponse
-
- return StreamingResourceWithRawResponse(self._client.streaming)
-
- @cached_property
- def security(self) -> security.SecurityResourceWithRawResponse:
- from .resources.security import SecurityResourceWithRawResponse
-
- return SecurityResourceWithRawResponse(self._client.security)
-
- @cached_property
- def dns(self) -> dns.DNSResourceWithRawResponse:
- from .resources.dns import DNSResourceWithRawResponse
-
- return DNSResourceWithRawResponse(self._client.dns)
-
- @cached_property
- def storage(self) -> storage.StorageResourceWithRawResponse:
- from .resources.storage import StorageResourceWithRawResponse
-
- return StorageResourceWithRawResponse(self._client.storage)
-
- @cached_property
- def cdn(self) -> cdn.CdnResourceWithRawResponse:
- from .resources.cdn import CdnResourceWithRawResponse
-
- return CdnResourceWithRawResponse(self._client.cdn)
+ self.cloud = cloud.CloudResourceWithRawResponse(client.cloud)
+ self.waap = waap.WaapResourceWithRawResponse(client.waap)
+ self.iam = iam.IamResourceWithRawResponse(client.iam)
+ self.fastedge = fastedge.FastedgeResourceWithRawResponse(client.fastedge)
+ self.streaming = streaming.StreamingResourceWithRawResponse(client.streaming)
+ self.security = security.SecurityResourceWithRawResponse(client.security)
+ self.dns = dns.DNSResourceWithRawResponse(client.dns)
+ self.storage = storage.StorageResourceWithRawResponse(client.storage)
+ self.cdn = cdn.CdnResourceWithRawResponse(client.cdn)
class AsyncGcoreWithRawResponse:
- _client: AsyncGcore
-
def __init__(self, client: AsyncGcore) -> None:
- self._client = client
-
- @cached_property
- def cloud(self) -> cloud.AsyncCloudResourceWithRawResponse:
- from .resources.cloud import AsyncCloudResourceWithRawResponse
-
- return AsyncCloudResourceWithRawResponse(self._client.cloud)
-
- @cached_property
- def waap(self) -> waap.AsyncWaapResourceWithRawResponse:
- from .resources.waap import AsyncWaapResourceWithRawResponse
-
- return AsyncWaapResourceWithRawResponse(self._client.waap)
-
- @cached_property
- def iam(self) -> iam.AsyncIamResourceWithRawResponse:
- from .resources.iam import AsyncIamResourceWithRawResponse
-
- return AsyncIamResourceWithRawResponse(self._client.iam)
-
- @cached_property
- def fastedge(self) -> fastedge.AsyncFastedgeResourceWithRawResponse:
- from .resources.fastedge import AsyncFastedgeResourceWithRawResponse
-
- return AsyncFastedgeResourceWithRawResponse(self._client.fastedge)
-
- @cached_property
- def streaming(self) -> streaming.AsyncStreamingResourceWithRawResponse:
- from .resources.streaming import AsyncStreamingResourceWithRawResponse
-
- return AsyncStreamingResourceWithRawResponse(self._client.streaming)
-
- @cached_property
- def security(self) -> security.AsyncSecurityResourceWithRawResponse:
- from .resources.security import AsyncSecurityResourceWithRawResponse
-
- return AsyncSecurityResourceWithRawResponse(self._client.security)
-
- @cached_property
- def dns(self) -> dns.AsyncDNSResourceWithRawResponse:
- from .resources.dns import AsyncDNSResourceWithRawResponse
-
- return AsyncDNSResourceWithRawResponse(self._client.dns)
-
- @cached_property
- def storage(self) -> storage.AsyncStorageResourceWithRawResponse:
- from .resources.storage import AsyncStorageResourceWithRawResponse
-
- return AsyncStorageResourceWithRawResponse(self._client.storage)
-
- @cached_property
- def cdn(self) -> cdn.AsyncCdnResourceWithRawResponse:
- from .resources.cdn import AsyncCdnResourceWithRawResponse
-
- return AsyncCdnResourceWithRawResponse(self._client.cdn)
+ self.cloud = cloud.AsyncCloudResourceWithRawResponse(client.cloud)
+ self.waap = waap.AsyncWaapResourceWithRawResponse(client.waap)
+ self.iam = iam.AsyncIamResourceWithRawResponse(client.iam)
+ self.fastedge = fastedge.AsyncFastedgeResourceWithRawResponse(client.fastedge)
+ self.streaming = streaming.AsyncStreamingResourceWithRawResponse(client.streaming)
+ self.security = security.AsyncSecurityResourceWithRawResponse(client.security)
+ self.dns = dns.AsyncDNSResourceWithRawResponse(client.dns)
+ self.storage = storage.AsyncStorageResourceWithRawResponse(client.storage)
+ self.cdn = cdn.AsyncCdnResourceWithRawResponse(client.cdn)
class GcoreWithStreamedResponse:
- _client: Gcore
-
def __init__(self, client: Gcore) -> None:
- self._client = client
-
- @cached_property
- def cloud(self) -> cloud.CloudResourceWithStreamingResponse:
- from .resources.cloud import CloudResourceWithStreamingResponse
-
- return CloudResourceWithStreamingResponse(self._client.cloud)
-
- @cached_property
- def waap(self) -> waap.WaapResourceWithStreamingResponse:
- from .resources.waap import WaapResourceWithStreamingResponse
-
- return WaapResourceWithStreamingResponse(self._client.waap)
-
- @cached_property
- def iam(self) -> iam.IamResourceWithStreamingResponse:
- from .resources.iam import IamResourceWithStreamingResponse
-
- return IamResourceWithStreamingResponse(self._client.iam)
-
- @cached_property
- def fastedge(self) -> fastedge.FastedgeResourceWithStreamingResponse:
- from .resources.fastedge import FastedgeResourceWithStreamingResponse
-
- return FastedgeResourceWithStreamingResponse(self._client.fastedge)
-
- @cached_property
- def streaming(self) -> streaming.StreamingResourceWithStreamingResponse:
- from .resources.streaming import StreamingResourceWithStreamingResponse
-
- return StreamingResourceWithStreamingResponse(self._client.streaming)
-
- @cached_property
- def security(self) -> security.SecurityResourceWithStreamingResponse:
- from .resources.security import SecurityResourceWithStreamingResponse
-
- return SecurityResourceWithStreamingResponse(self._client.security)
-
- @cached_property
- def dns(self) -> dns.DNSResourceWithStreamingResponse:
- from .resources.dns import DNSResourceWithStreamingResponse
-
- return DNSResourceWithStreamingResponse(self._client.dns)
-
- @cached_property
- def storage(self) -> storage.StorageResourceWithStreamingResponse:
- from .resources.storage import StorageResourceWithStreamingResponse
-
- return StorageResourceWithStreamingResponse(self._client.storage)
-
- @cached_property
- def cdn(self) -> cdn.CdnResourceWithStreamingResponse:
- from .resources.cdn import CdnResourceWithStreamingResponse
-
- return CdnResourceWithStreamingResponse(self._client.cdn)
+ self.cloud = cloud.CloudResourceWithStreamingResponse(client.cloud)
+ self.waap = waap.WaapResourceWithStreamingResponse(client.waap)
+ self.iam = iam.IamResourceWithStreamingResponse(client.iam)
+ self.fastedge = fastedge.FastedgeResourceWithStreamingResponse(client.fastedge)
+ self.streaming = streaming.StreamingResourceWithStreamingResponse(client.streaming)
+ self.security = security.SecurityResourceWithStreamingResponse(client.security)
+ self.dns = dns.DNSResourceWithStreamingResponse(client.dns)
+ self.storage = storage.StorageResourceWithStreamingResponse(client.storage)
+ self.cdn = cdn.CdnResourceWithStreamingResponse(client.cdn)
class AsyncGcoreWithStreamedResponse:
- _client: AsyncGcore
-
def __init__(self, client: AsyncGcore) -> None:
- self._client = client
-
- @cached_property
- def cloud(self) -> cloud.AsyncCloudResourceWithStreamingResponse:
- from .resources.cloud import AsyncCloudResourceWithStreamingResponse
-
- return AsyncCloudResourceWithStreamingResponse(self._client.cloud)
-
- @cached_property
- def waap(self) -> waap.AsyncWaapResourceWithStreamingResponse:
- from .resources.waap import AsyncWaapResourceWithStreamingResponse
-
- return AsyncWaapResourceWithStreamingResponse(self._client.waap)
-
- @cached_property
- def iam(self) -> iam.AsyncIamResourceWithStreamingResponse:
- from .resources.iam import AsyncIamResourceWithStreamingResponse
-
- return AsyncIamResourceWithStreamingResponse(self._client.iam)
-
- @cached_property
- def fastedge(self) -> fastedge.AsyncFastedgeResourceWithStreamingResponse:
- from .resources.fastedge import AsyncFastedgeResourceWithStreamingResponse
-
- return AsyncFastedgeResourceWithStreamingResponse(self._client.fastedge)
-
- @cached_property
- def streaming(self) -> streaming.AsyncStreamingResourceWithStreamingResponse:
- from .resources.streaming import AsyncStreamingResourceWithStreamingResponse
-
- return AsyncStreamingResourceWithStreamingResponse(self._client.streaming)
-
- @cached_property
- def security(self) -> security.AsyncSecurityResourceWithStreamingResponse:
- from .resources.security import AsyncSecurityResourceWithStreamingResponse
-
- return AsyncSecurityResourceWithStreamingResponse(self._client.security)
-
- @cached_property
- def dns(self) -> dns.AsyncDNSResourceWithStreamingResponse:
- from .resources.dns import AsyncDNSResourceWithStreamingResponse
-
- return AsyncDNSResourceWithStreamingResponse(self._client.dns)
-
- @cached_property
- def storage(self) -> storage.AsyncStorageResourceWithStreamingResponse:
- from .resources.storage import AsyncStorageResourceWithStreamingResponse
-
- return AsyncStorageResourceWithStreamingResponse(self._client.storage)
-
- @cached_property
- def cdn(self) -> cdn.AsyncCdnResourceWithStreamingResponse:
- from .resources.cdn import AsyncCdnResourceWithStreamingResponse
-
- return AsyncCdnResourceWithStreamingResponse(self._client.cdn)
+ self.cloud = cloud.AsyncCloudResourceWithStreamingResponse(client.cloud)
+ self.waap = waap.AsyncWaapResourceWithStreamingResponse(client.waap)
+ self.iam = iam.AsyncIamResourceWithStreamingResponse(client.iam)
+ self.fastedge = fastedge.AsyncFastedgeResourceWithStreamingResponse(client.fastedge)
+ self.streaming = streaming.AsyncStreamingResourceWithStreamingResponse(client.streaming)
+ self.security = security.AsyncSecurityResourceWithStreamingResponse(client.security)
+ self.dns = dns.AsyncDNSResourceWithStreamingResponse(client.dns)
+ self.storage = storage.AsyncStorageResourceWithStreamingResponse(client.storage)
+ self.cdn = cdn.AsyncCdnResourceWithStreamingResponse(client.cdn)
Client = Gcore
diff --git a/src/gcore/resources/__init__.py b/src/gcore/resources/__init__.py
index fd8019a9..c8aaa6a7 100644
--- a/src/gcore/resources/__init__.py
+++ b/src/gcore/resources/__init__.py
@@ -1 +1,131 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .cdn import (
+ CdnResource,
+ AsyncCdnResource,
+ CdnResourceWithRawResponse,
+ AsyncCdnResourceWithRawResponse,
+ CdnResourceWithStreamingResponse,
+ AsyncCdnResourceWithStreamingResponse,
+)
+from .dns import (
+ DNSResource,
+ AsyncDNSResource,
+ DNSResourceWithRawResponse,
+ AsyncDNSResourceWithRawResponse,
+ DNSResourceWithStreamingResponse,
+ AsyncDNSResourceWithStreamingResponse,
+)
+from .iam import (
+ IamResource,
+ AsyncIamResource,
+ IamResourceWithRawResponse,
+ AsyncIamResourceWithRawResponse,
+ IamResourceWithStreamingResponse,
+ AsyncIamResourceWithStreamingResponse,
+)
+from .waap import (
+ WaapResource,
+ AsyncWaapResource,
+ WaapResourceWithRawResponse,
+ AsyncWaapResourceWithRawResponse,
+ WaapResourceWithStreamingResponse,
+ AsyncWaapResourceWithStreamingResponse,
+)
+from .cloud import (
+ CloudResource,
+ AsyncCloudResource,
+ CloudResourceWithRawResponse,
+ AsyncCloudResourceWithRawResponse,
+ CloudResourceWithStreamingResponse,
+ AsyncCloudResourceWithStreamingResponse,
+)
+from .storage import (
+ StorageResource,
+ AsyncStorageResource,
+ StorageResourceWithRawResponse,
+ AsyncStorageResourceWithRawResponse,
+ StorageResourceWithStreamingResponse,
+ AsyncStorageResourceWithStreamingResponse,
+)
+from .fastedge import (
+ FastedgeResource,
+ AsyncFastedgeResource,
+ FastedgeResourceWithRawResponse,
+ AsyncFastedgeResourceWithRawResponse,
+ FastedgeResourceWithStreamingResponse,
+ AsyncFastedgeResourceWithStreamingResponse,
+)
+from .security import (
+ SecurityResource,
+ AsyncSecurityResource,
+ SecurityResourceWithRawResponse,
+ AsyncSecurityResourceWithRawResponse,
+ SecurityResourceWithStreamingResponse,
+ AsyncSecurityResourceWithStreamingResponse,
+)
+from .streaming import (
+ StreamingResource,
+ AsyncStreamingResource,
+ StreamingResourceWithRawResponse,
+ AsyncStreamingResourceWithRawResponse,
+ StreamingResourceWithStreamingResponse,
+ AsyncStreamingResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "CloudResource",
+ "AsyncCloudResource",
+ "CloudResourceWithRawResponse",
+ "AsyncCloudResourceWithRawResponse",
+ "CloudResourceWithStreamingResponse",
+ "AsyncCloudResourceWithStreamingResponse",
+ "WaapResource",
+ "AsyncWaapResource",
+ "WaapResourceWithRawResponse",
+ "AsyncWaapResourceWithRawResponse",
+ "WaapResourceWithStreamingResponse",
+ "AsyncWaapResourceWithStreamingResponse",
+ "IamResource",
+ "AsyncIamResource",
+ "IamResourceWithRawResponse",
+ "AsyncIamResourceWithRawResponse",
+ "IamResourceWithStreamingResponse",
+ "AsyncIamResourceWithStreamingResponse",
+ "FastedgeResource",
+ "AsyncFastedgeResource",
+ "FastedgeResourceWithRawResponse",
+ "AsyncFastedgeResourceWithRawResponse",
+ "FastedgeResourceWithStreamingResponse",
+ "AsyncFastedgeResourceWithStreamingResponse",
+ "StreamingResource",
+ "AsyncStreamingResource",
+ "StreamingResourceWithRawResponse",
+ "AsyncStreamingResourceWithRawResponse",
+ "StreamingResourceWithStreamingResponse",
+ "AsyncStreamingResourceWithStreamingResponse",
+ "SecurityResource",
+ "AsyncSecurityResource",
+ "SecurityResourceWithRawResponse",
+ "AsyncSecurityResourceWithRawResponse",
+ "SecurityResourceWithStreamingResponse",
+ "AsyncSecurityResourceWithStreamingResponse",
+ "DNSResource",
+ "AsyncDNSResource",
+ "DNSResourceWithRawResponse",
+ "AsyncDNSResourceWithRawResponse",
+ "DNSResourceWithStreamingResponse",
+ "AsyncDNSResourceWithStreamingResponse",
+ "StorageResource",
+ "AsyncStorageResource",
+ "StorageResourceWithRawResponse",
+ "AsyncStorageResourceWithRawResponse",
+ "StorageResourceWithStreamingResponse",
+ "AsyncStorageResourceWithStreamingResponse",
+ "CdnResource",
+ "AsyncCdnResource",
+ "CdnResourceWithRawResponse",
+ "AsyncCdnResourceWithRawResponse",
+ "CdnResourceWithStreamingResponse",
+ "AsyncCdnResourceWithStreamingResponse",
+]
diff --git a/src/gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py b/src/gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py
index 63371d8e..f7c10022 100644
--- a/src/gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py
+++ b/src/gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py
@@ -2,9 +2,13 @@
from __future__ import annotations
+from typing import Iterable
+from typing_extensions import Literal, overload
+
import httpx
-from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._utils import maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -14,6 +18,8 @@
async_to_streamed_response_wrapper,
)
from ...._base_client import make_request_options
+from ....types.cloud.task_id_list import TaskIDList
+from ....types.cloud.gpu_baremetal_clusters import interface_attach_params, interface_detach_params
from ....types.cloud.network_interface_list import NetworkInterfaceList
__all__ = ["InterfacesResource", "AsyncInterfacesResource"]
@@ -78,6 +84,304 @@ def list(
cast_to=NetworkInterfaceList,
)
+ @overload
+ def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
+ | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be 'external'. Union tag
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ subnet_id: str,
+ ddos_profile: interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup] | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ subnet_id: Port will get an IP address from this subnet
+
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be 'subnet'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ network_id: str,
+ ddos_profile: interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup] | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ network_id: Port will get an IP address in this network subnet
+
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be '`any_subnet`'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ port_id: str,
+ ddos_profile: interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup] | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ port_id: Port ID
+
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be '`reserved_fixed_ip`'. Union tag
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
+ | interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile
+ | interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile
+ | interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
+ | Omit = omit,
+ interface_name: str | Omit = omit,
+ ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
+ | Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
+ | Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
+ | Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
+ | Omit = omit,
+ type: str | Omit = omit,
+ subnet_id: str | Omit = omit,
+ network_id: str | Omit = omit,
+ port_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not instance_id:
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
+ return self._post(
+ f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/attach_interface",
+ body=maybe_transform(
+ {
+ "ddos_profile": ddos_profile,
+ "interface_name": interface_name,
+ "ip_family": ip_family,
+ "port_group": port_group,
+ "security_groups": security_groups,
+ "type": type,
+ "subnet_id": subnet_id,
+ "network_id": network_id,
+ "port_id": port_id,
+ },
+ interface_attach_params.InterfaceAttachParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TaskIDList,
+ )
+
+ def detach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ ip_address: str,
+ port_id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Detach interface from bare metal GPU cluster server
+
+ Args:
+ ip_address: IP address
+
+ port_id: ID of the port
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not instance_id:
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
+ return self._post(
+ f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/detach_interface",
+ body=maybe_transform(
+ {
+ "ip_address": ip_address,
+ "port_id": port_id,
+ },
+ interface_detach_params.InterfaceDetachParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TaskIDList,
+ )
+
class AsyncInterfacesResource(AsyncAPIResource):
@cached_property
@@ -138,6 +442,304 @@ async def list(
cast_to=NetworkInterfaceList,
)
+ @overload
+ async def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
+ | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be 'external'. Union tag
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ subnet_id: str,
+ ddos_profile: interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup] | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ subnet_id: Port will get an IP address from this subnet
+
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be 'subnet'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ network_id: str,
+ ddos_profile: interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup] | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ network_id: Port will get an IP address in this network subnet
+
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be '`any_subnet`'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ port_id: str,
+ ddos_profile: interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | Omit = omit,
+ interface_name: str | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup] | Omit = omit,
+ type: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Attach interface to bare metal GPU cluster server
+
+ Args:
+ port_id: Port ID
+
+ ddos_profile: Advanced DDoS protection.
+
+ interface_name: Interface name
+
+ port_group: Each group will be added to the separate trunk.
+
+ security_groups: List of security group IDs
+
+ type: Must be '`reserved_fixed_ip`'. Union tag
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ async def attach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
+ | interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile
+ | interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile
+ | interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
+ | Omit = omit,
+ interface_name: str | Omit = omit,
+ ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
+ port_group: int | Omit = omit,
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
+ | Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
+ | Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
+ | Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
+ | Omit = omit,
+ type: str | Omit = omit,
+ subnet_id: str | Omit = omit,
+ network_id: str | Omit = omit,
+ port_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not instance_id:
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
+ return await self._post(
+ f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/attach_interface",
+ body=await async_maybe_transform(
+ {
+ "ddos_profile": ddos_profile,
+ "interface_name": interface_name,
+ "ip_family": ip_family,
+ "port_group": port_group,
+ "security_groups": security_groups,
+ "type": type,
+ "subnet_id": subnet_id,
+ "network_id": network_id,
+ "port_id": port_id,
+ },
+ interface_attach_params.InterfaceAttachParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TaskIDList,
+ )
+
+ async def detach(
+ self,
+ instance_id: str,
+ *,
+ project_id: int | None = None,
+ region_id: int | None = None,
+ ip_address: str,
+ port_id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TaskIDList:
+ """
+ Detach interface from bare metal GPU cluster server
+
+ Args:
+ ip_address: IP address
+
+ port_id: ID of the port
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if project_id is None:
+ project_id = self._client._get_cloud_project_id_path_param()
+ if region_id is None:
+ region_id = self._client._get_cloud_region_id_path_param()
+ if not instance_id:
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
+ return await self._post(
+ f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/detach_interface",
+ body=await async_maybe_transform(
+ {
+ "ip_address": ip_address,
+ "port_id": port_id,
+ },
+ interface_detach_params.InterfaceDetachParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TaskIDList,
+ )
+
class InterfacesResourceWithRawResponse:
def __init__(self, interfaces: InterfacesResource) -> None:
@@ -146,6 +748,12 @@ def __init__(self, interfaces: InterfacesResource) -> None:
self.list = to_raw_response_wrapper(
interfaces.list,
)
+ self.attach = to_raw_response_wrapper(
+ interfaces.attach,
+ )
+ self.detach = to_raw_response_wrapper(
+ interfaces.detach,
+ )
class AsyncInterfacesResourceWithRawResponse:
@@ -155,6 +763,12 @@ def __init__(self, interfaces: AsyncInterfacesResource) -> None:
self.list = async_to_raw_response_wrapper(
interfaces.list,
)
+ self.attach = async_to_raw_response_wrapper(
+ interfaces.attach,
+ )
+ self.detach = async_to_raw_response_wrapper(
+ interfaces.detach,
+ )
class InterfacesResourceWithStreamingResponse:
@@ -164,6 +778,12 @@ def __init__(self, interfaces: InterfacesResource) -> None:
self.list = to_streamed_response_wrapper(
interfaces.list,
)
+ self.attach = to_streamed_response_wrapper(
+ interfaces.attach,
+ )
+ self.detach = to_streamed_response_wrapper(
+ interfaces.detach,
+ )
class AsyncInterfacesResourceWithStreamingResponse:
@@ -173,3 +793,9 @@ def __init__(self, interfaces: AsyncInterfacesResource) -> None:
self.list = async_to_streamed_response_wrapper(
interfaces.list,
)
+ self.attach = async_to_streamed_response_wrapper(
+ interfaces.attach,
+ )
+ self.detach = async_to_streamed_response_wrapper(
+ interfaces.detach,
+ )
diff --git a/src/gcore/resources/cloud/gpu_baremetal_clusters/servers.py b/src/gcore/resources/cloud/gpu_baremetal_clusters/servers.py
index 0394a1b1..044c15a6 100644
--- a/src/gcore/resources/cloud/gpu_baremetal_clusters/servers.py
+++ b/src/gcore/resources/cloud/gpu_baremetal_clusters/servers.py
@@ -2,13 +2,13 @@
from __future__ import annotations
-from typing import Union, Iterable
+from typing import Union
from datetime import datetime
-from typing_extensions import Literal, overload
+from typing_extensions import Literal
import httpx
-from ...._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ...._utils import maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -22,12 +22,7 @@
from ...._base_client import AsyncPaginator, make_request_options
from ....types.cloud.console import Console
from ....types.cloud.task_id_list import TaskIDList
-from ....types.cloud.gpu_baremetal_clusters import (
- server_list_params,
- server_delete_params,
- server_attach_interface_params,
- server_detach_interface_params,
-)
+from ....types.cloud.gpu_baremetal_clusters import server_list_params, server_delete_params
from ....types.cloud.gpu_baremetal_clusters.gpu_baremetal_cluster_server import GPUBaremetalClusterServer
from ....types.cloud.gpu_baremetal_clusters.gpu_baremetal_cluster_server_v1 import GPUBaremetalClusterServerV1
@@ -220,6 +215,7 @@ def delete(
cast_to=TaskIDList,
)
+
def delete_and_poll(
self,
instance_id: str,
@@ -235,7 +231,7 @@ def delete_and_poll(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
"""
Delete a bare metal GPU server from cluster and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
@@ -262,306 +258,6 @@ def delete_and_poll(
polling_timeout_seconds=polling_timeout_seconds,
)
- @overload
- def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be 'external'. Union tag
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @overload
- def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- subnet_id: str,
- ddos_profile: server_attach_interface_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- subnet_id: Port will get an IP address from this subnet
-
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be 'subnet'
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @overload
- def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- network_id: str,
- ddos_profile: server_attach_interface_params.NewInterfaceAnySubnetSchemaDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceAnySubnetSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- network_id: Port will get an IP address in this network subnet
-
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be '`any_subnet`'
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @overload
- def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- port_id: str,
- ddos_profile: server_attach_interface_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- port_id: Port ID
-
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be '`reserved_fixed_ip`'. Union tag
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
- | server_attach_interface_params.NewInterfaceSpecificSubnetSchemaDDOSProfile
- | server_attach_interface_params.NewInterfaceAnySubnetSchemaDDOSProfile
- | server_attach_interface_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
- | Omit = omit,
- interface_name: str | Omit = omit,
- ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
- | Iterable[server_attach_interface_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
- | Iterable[server_attach_interface_params.NewInterfaceAnySubnetSchemaSecurityGroup]
- | Iterable[server_attach_interface_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- subnet_id: str | Omit = omit,
- network_id: str | Omit = omit,
- port_id: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not instance_id:
- raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
- return self._post(
- f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/attach_interface",
- body=maybe_transform(
- {
- "ddos_profile": ddos_profile,
- "interface_name": interface_name,
- "ip_family": ip_family,
- "port_group": port_group,
- "security_groups": security_groups,
- "type": type,
- "subnet_id": subnet_id,
- "network_id": network_id,
- "port_id": port_id,
- },
- server_attach_interface_params.ServerAttachInterfaceParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=TaskIDList,
- )
-
- def detach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- ip_address: str,
- port_id: str,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Detach interface from bare metal GPU cluster server
-
- Args:
- ip_address: IP address
-
- port_id: ID of the port
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not instance_id:
- raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
- return self._post(
- f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/detach_interface",
- body=maybe_transform(
- {
- "ip_address": ip_address,
- "port_id": port_id,
- },
- server_detach_interface_params.ServerDetachInterfaceParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=TaskIDList,
- )
def get_console(
self,
@@ -869,6 +565,7 @@ async def delete(
cast_to=TaskIDList,
)
+
async def delete_and_poll(
self,
instance_id: str,
@@ -884,7 +581,7 @@ async def delete_and_poll(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
"""
Delete a bare metal GPU server from cluster and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
@@ -911,306 +608,6 @@ async def delete_and_poll(
polling_timeout_seconds=polling_timeout_seconds,
)
- @overload
- async def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be 'external'. Union tag
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @overload
- async def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- subnet_id: str,
- ddos_profile: server_attach_interface_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- subnet_id: Port will get an IP address from this subnet
-
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be 'subnet'
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @overload
- async def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- network_id: str,
- ddos_profile: server_attach_interface_params.NewInterfaceAnySubnetSchemaDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceAnySubnetSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- network_id: Port will get an IP address in this network subnet
-
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be '`any_subnet`'
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @overload
- async def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- port_id: str,
- ddos_profile: server_attach_interface_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | Omit = omit,
- interface_name: str | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Attach interface to bare metal GPU cluster server
-
- Args:
- port_id: Port ID
-
- ddos_profile: Advanced DDoS protection.
-
- interface_name: Interface name
-
- port_group: Each group will be added to the separate trunk.
-
- security_groups: List of security group IDs
-
- type: Must be '`reserved_fixed_ip`'. Union tag
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- async def attach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- ddos_profile: server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
- | server_attach_interface_params.NewInterfaceSpecificSubnetSchemaDDOSProfile
- | server_attach_interface_params.NewInterfaceAnySubnetSchemaDDOSProfile
- | server_attach_interface_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
- | Omit = omit,
- interface_name: str | Omit = omit,
- ip_family: Literal["dual", "ipv4", "ipv6"] | Omit = omit,
- port_group: int | Omit = omit,
- security_groups: Iterable[server_attach_interface_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
- | Iterable[server_attach_interface_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
- | Iterable[server_attach_interface_params.NewInterfaceAnySubnetSchemaSecurityGroup]
- | Iterable[server_attach_interface_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
- | Omit = omit,
- type: str | Omit = omit,
- subnet_id: str | Omit = omit,
- network_id: str | Omit = omit,
- port_id: str | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not instance_id:
- raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
- return await self._post(
- f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/attach_interface",
- body=await async_maybe_transform(
- {
- "ddos_profile": ddos_profile,
- "interface_name": interface_name,
- "ip_family": ip_family,
- "port_group": port_group,
- "security_groups": security_groups,
- "type": type,
- "subnet_id": subnet_id,
- "network_id": network_id,
- "port_id": port_id,
- },
- server_attach_interface_params.ServerAttachInterfaceParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=TaskIDList,
- )
-
- async def detach_interface(
- self,
- instance_id: str,
- *,
- project_id: int | None = None,
- region_id: int | None = None,
- ip_address: str,
- port_id: str,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TaskIDList:
- """
- Detach interface from bare metal GPU cluster server
-
- Args:
- ip_address: IP address
-
- port_id: ID of the port
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if project_id is None:
- project_id = self._client._get_cloud_project_id_path_param()
- if region_id is None:
- region_id = self._client._get_cloud_region_id_path_param()
- if not instance_id:
- raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
- return await self._post(
- f"/cloud/v1/ai/clusters/{project_id}/{region_id}/{instance_id}/detach_interface",
- body=await async_maybe_transform(
- {
- "ip_address": ip_address,
- "port_id": port_id,
- },
- server_detach_interface_params.ServerDetachInterfaceParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=TaskIDList,
- )
async def get_console(
self,
@@ -1340,12 +737,6 @@ def __init__(self, servers: ServersResource) -> None:
self.delete = to_raw_response_wrapper(
servers.delete,
)
- self.attach_interface = to_raw_response_wrapper(
- servers.attach_interface,
- )
- self.detach_interface = to_raw_response_wrapper(
- servers.detach_interface,
- )
self.get_console = to_raw_response_wrapper(
servers.get_console,
)
@@ -1370,12 +761,6 @@ def __init__(self, servers: AsyncServersResource) -> None:
self.delete = async_to_raw_response_wrapper(
servers.delete,
)
- self.attach_interface = async_to_raw_response_wrapper(
- servers.attach_interface,
- )
- self.detach_interface = async_to_raw_response_wrapper(
- servers.detach_interface,
- )
self.get_console = async_to_raw_response_wrapper(
servers.get_console,
)
@@ -1400,12 +785,6 @@ def __init__(self, servers: ServersResource) -> None:
self.delete = to_streamed_response_wrapper(
servers.delete,
)
- self.attach_interface = to_streamed_response_wrapper(
- servers.attach_interface,
- )
- self.detach_interface = to_streamed_response_wrapper(
- servers.detach_interface,
- )
self.get_console = to_streamed_response_wrapper(
servers.get_console,
)
@@ -1430,12 +809,6 @@ def __init__(self, servers: AsyncServersResource) -> None:
self.delete = async_to_streamed_response_wrapper(
servers.delete,
)
- self.attach_interface = async_to_streamed_response_wrapper(
- servers.attach_interface,
- )
- self.detach_interface = async_to_streamed_response_wrapper(
- servers.detach_interface,
- )
self.get_console = async_to_streamed_response_wrapper(
servers.get_console,
)
diff --git a/src/gcore/types/cloud/gpu_baremetal_clusters/__init__.py b/src/gcore/types/cloud/gpu_baremetal_clusters/__init__.py
index 30aeddac..7929f325 100644
--- a/src/gcore/types/cloud/gpu_baremetal_clusters/__init__.py
+++ b/src/gcore/types/cloud/gpu_baremetal_clusters/__init__.py
@@ -7,9 +7,9 @@
from .image_upload_params import ImageUploadParams as ImageUploadParams
from .gpu_baremetal_flavor import GPUBaremetalFlavor as GPUBaremetalFlavor
from .server_delete_params import ServerDeleteParams as ServerDeleteParams
+from .interface_attach_params import InterfaceAttachParams as InterfaceAttachParams
+from .interface_detach_params import InterfaceDetachParams as InterfaceDetachParams
from .gpu_baremetal_flavor_list import GPUBaremetalFlavorList as GPUBaremetalFlavorList
from .gpu_baremetal_cluster_server import GPUBaremetalClusterServer as GPUBaremetalClusterServer
-from .server_attach_interface_params import ServerAttachInterfaceParams as ServerAttachInterfaceParams
-from .server_detach_interface_params import ServerDetachInterfaceParams as ServerDetachInterfaceParams
from .gpu_baremetal_cluster_server_v1 import GPUBaremetalClusterServerV1 as GPUBaremetalClusterServerV1
from .gpu_baremetal_cluster_server_v1_list import GPUBaremetalClusterServerV1List as GPUBaremetalClusterServerV1List
diff --git a/src/gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py b/src/gcore/types/cloud/gpu_baremetal_clusters/interface_attach_params.py
similarity index 98%
rename from src/gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py
rename to src/gcore/types/cloud/gpu_baremetal_clusters/interface_attach_params.py
index 98bf36af..43ff9ee3 100644
--- a/src/gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py
+++ b/src/gcore/types/cloud/gpu_baremetal_clusters/interface_attach_params.py
@@ -6,7 +6,7 @@
from typing_extensions import Literal, Required, TypeAlias, TypedDict
__all__ = [
- "ServerAttachInterfaceParams",
+ "InterfaceAttachParams",
"NewInterfaceExternalExtendSchemaWithDDOS",
"NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile",
"NewInterfaceExternalExtendSchemaWithDdosddosProfileField",
@@ -261,7 +261,7 @@ class NewInterfaceReservedFixedIPSchemaSecurityGroup(TypedDict, total=False):
"""Resource ID"""
-ServerAttachInterfaceParams: TypeAlias = Union[
+InterfaceAttachParams: TypeAlias = Union[
NewInterfaceExternalExtendSchemaWithDDOS,
NewInterfaceSpecificSubnetSchema,
NewInterfaceAnySubnetSchema,
diff --git a/src/gcore/types/cloud/gpu_baremetal_clusters/server_detach_interface_params.py b/src/gcore/types/cloud/gpu_baremetal_clusters/interface_detach_params.py
similarity index 76%
rename from src/gcore/types/cloud/gpu_baremetal_clusters/server_detach_interface_params.py
rename to src/gcore/types/cloud/gpu_baremetal_clusters/interface_detach_params.py
index 4c9cacc3..5f092a84 100644
--- a/src/gcore/types/cloud/gpu_baremetal_clusters/server_detach_interface_params.py
+++ b/src/gcore/types/cloud/gpu_baremetal_clusters/interface_detach_params.py
@@ -4,10 +4,10 @@
from typing_extensions import Required, TypedDict
-__all__ = ["ServerDetachInterfaceParams"]
+__all__ = ["InterfaceDetachParams"]
-class ServerDetachInterfaceParams(TypedDict, total=False):
+class InterfaceDetachParams(TypedDict, total=False):
project_id: int
region_id: int
diff --git a/tests/api_resources/cloud/gpu_baremetal_clusters/test_interfaces.py b/tests/api_resources/cloud/gpu_baremetal_clusters/test_interfaces.py
index ec77e011..0afb78c8 100644
--- a/tests/api_resources/cloud/gpu_baremetal_clusters/test_interfaces.py
+++ b/tests/api_resources/cloud/gpu_baremetal_clusters/test_interfaces.py
@@ -9,7 +9,7 @@
from gcore import Gcore, AsyncGcore
from tests.utils import assert_matches_type
-from gcore.types.cloud import NetworkInterfaceList
+from gcore.types.cloud import TaskIDList, NetworkInterfaceList
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -63,6 +63,373 @@ def test_path_params_list(self, client: Gcore) -> None:
region_id=0,
)
+ @parametrize
+ def test_method_attach_overload_1(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_method_attach_with_all_params_overload_1(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="interface_name",
+ ip_family="dual",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="external",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_raw_response_attach_overload_1(self, client: Gcore) -> None:
+ response = client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_streaming_response_attach_overload_1(self, client: Gcore) -> None:
+ with client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_attach_overload_1(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ )
+
+ @parametrize
+ def test_method_attach_overload_2(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_method_attach_with_all_params_overload_2(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="my-subnet-interface",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="subnet",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_raw_response_attach_overload_2(self, client: Gcore) -> None:
+ response = client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_streaming_response_attach_overload_2(self, client: Gcore) -> None:
+ with client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_attach_overload_2(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ @parametrize
+ def test_method_attach_overload_3(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_method_attach_with_all_params_overload_3(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="my-any-subnet-interface",
+ ip_family="dual",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="any_subnet",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_raw_response_attach_overload_3(self, client: Gcore) -> None:
+ response = client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_streaming_response_attach_overload_3(self, client: Gcore) -> None:
+ with client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_attach_overload_3(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ @parametrize
+ def test_method_attach_overload_4(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_method_attach_with_all_params_overload_4(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="my-rfip-interface",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="reserved_fixed_ip",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_raw_response_attach_overload_4(self, client: Gcore) -> None:
+ response = client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_streaming_response_attach_overload_4(self, client: Gcore) -> None:
+ with client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_attach_overload_4(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ )
+
+ @parametrize
+ def test_method_detach(self, client: Gcore) -> None:
+ interface = client.cloud.gpu_baremetal_clusters.interfaces.detach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_raw_response_detach(self, client: Gcore) -> None:
+ response = client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.detach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ def test_streaming_response_detach(self, client: Gcore) -> None:
+ with client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.detach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_detach(self, client: Gcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.detach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ )
+
class TestAsyncInterfaces:
parametrize = pytest.mark.parametrize(
@@ -114,3 +481,370 @@ async def test_path_params_list(self, async_client: AsyncGcore) -> None:
project_id=0,
region_id=0,
)
+
+ @parametrize
+ async def test_method_attach_overload_1(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_method_attach_with_all_params_overload_1(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="interface_name",
+ ip_family="dual",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="external",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_raw_response_attach_overload_1(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_attach_overload_1(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_attach_overload_1(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ )
+
+ @parametrize
+ async def test_method_attach_overload_2(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_method_attach_with_all_params_overload_2(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="my-subnet-interface",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="subnet",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_raw_response_attach_overload_2(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_attach_overload_2(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_attach_overload_2(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ @parametrize
+ async def test_method_attach_overload_3(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_method_attach_with_all_params_overload_3(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="my-any-subnet-interface",
+ ip_family="dual",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="any_subnet",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_raw_response_attach_overload_3(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_attach_overload_3(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_attach_overload_3(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
+ )
+
+ @parametrize
+ async def test_method_attach_overload_4(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_method_attach_with_all_params_overload_4(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ ddos_profile={
+ "profile_template": 29,
+ "fields": [
+ {
+ "base_field": 10,
+ "field_name": "field_name",
+ "field_value": [45046, 45047],
+ "value": None,
+ }
+ ],
+ "profile_template_name": "profile_template_name",
+ },
+ interface_name="my-rfip-interface",
+ port_group=0,
+ security_groups=[
+ {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
+ {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
+ ],
+ type="reserved_fixed_ip",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_raw_response_attach_overload_4(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_attach_overload_4(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.attach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_attach_overload_4(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.attach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ port_id="59905c8e-2619-420a-b046-536096473370",
+ )
+
+ @parametrize
+ async def test_method_detach(self, async_client: AsyncGcore) -> None:
+ interface = await async_client.cloud.gpu_baremetal_clusters.interfaces.detach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ )
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_raw_response_detach(self, async_client: AsyncGcore) -> None:
+ response = await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.detach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_detach(self, async_client: AsyncGcore) -> None:
+ async with async_client.cloud.gpu_baremetal_clusters.interfaces.with_streaming_response.detach(
+ instance_id="instance_id",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ interface = await response.parse()
+ assert_matches_type(TaskIDList, interface, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_detach(self, async_client: AsyncGcore) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
+ await async_client.cloud.gpu_baremetal_clusters.interfaces.with_raw_response.detach(
+ instance_id="",
+ project_id=0,
+ region_id=0,
+ ip_address="192.168.123.20",
+ port_id="351b0dd7-ca09-431c-be53-935db3785067",
+ )
diff --git a/tests/api_resources/cloud/gpu_baremetal_clusters/test_servers.py b/tests/api_resources/cloud/gpu_baremetal_clusters/test_servers.py
index 204a8ffb..e3631089 100644
--- a/tests/api_resources/cloud/gpu_baremetal_clusters/test_servers.py
+++ b/tests/api_resources/cloud/gpu_baremetal_clusters/test_servers.py
@@ -156,373 +156,6 @@ def test_path_params_delete(self, client: Gcore) -> None:
cluster_id="cluster_id",
)
- @parametrize
- def test_method_attach_interface_overload_1(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_method_attach_interface_with_all_params_overload_1(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="interface_name",
- ip_family="dual",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="external",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_raw_response_attach_interface_overload_1(self, client: Gcore) -> None:
- response = client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_streaming_response_attach_interface_overload_1(self, client: Gcore) -> None:
- with client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_attach_interface_overload_1(self, client: Gcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- )
-
- @parametrize
- def test_method_attach_interface_overload_2(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_method_attach_interface_with_all_params_overload_2(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="my-subnet-interface",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="subnet",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_raw_response_attach_interface_overload_2(self, client: Gcore) -> None:
- response = client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_streaming_response_attach_interface_overload_2(self, client: Gcore) -> None:
- with client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_attach_interface_overload_2(self, client: Gcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- @parametrize
- def test_method_attach_interface_overload_3(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_method_attach_interface_with_all_params_overload_3(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="my-any-subnet-interface",
- ip_family="dual",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="any_subnet",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_raw_response_attach_interface_overload_3(self, client: Gcore) -> None:
- response = client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_streaming_response_attach_interface_overload_3(self, client: Gcore) -> None:
- with client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_attach_interface_overload_3(self, client: Gcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- @parametrize
- def test_method_attach_interface_overload_4(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_method_attach_interface_with_all_params_overload_4(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="my-rfip-interface",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="reserved_fixed_ip",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_raw_response_attach_interface_overload_4(self, client: Gcore) -> None:
- response = client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_streaming_response_attach_interface_overload_4(self, client: Gcore) -> None:
- with client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_attach_interface_overload_4(self, client: Gcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- )
-
- @parametrize
- def test_method_detach_interface(self, client: Gcore) -> None:
- server = client.cloud.gpu_baremetal_clusters.servers.detach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_raw_response_detach_interface(self, client: Gcore) -> None:
- response = client.cloud.gpu_baremetal_clusters.servers.with_raw_response.detach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- def test_streaming_response_detach_interface(self, client: Gcore) -> None:
- with client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.detach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_detach_interface(self, client: Gcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- client.cloud.gpu_baremetal_clusters.servers.with_raw_response.detach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- )
-
@parametrize
def test_method_get_console(self, client: Gcore) -> None:
server = client.cloud.gpu_baremetal_clusters.servers.get_console(
@@ -800,373 +433,6 @@ async def test_path_params_delete(self, async_client: AsyncGcore) -> None:
cluster_id="cluster_id",
)
- @parametrize
- async def test_method_attach_interface_overload_1(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_method_attach_interface_with_all_params_overload_1(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="interface_name",
- ip_family="dual",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="external",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_raw_response_attach_interface_overload_1(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_streaming_response_attach_interface_overload_1(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_attach_interface_overload_1(self, async_client: AsyncGcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- )
-
- @parametrize
- async def test_method_attach_interface_overload_2(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_method_attach_interface_with_all_params_overload_2(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="my-subnet-interface",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="subnet",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_raw_response_attach_interface_overload_2(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_streaming_response_attach_interface_overload_2(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_attach_interface_overload_2(self, async_client: AsyncGcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- subnet_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- @parametrize
- async def test_method_attach_interface_overload_3(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_method_attach_interface_with_all_params_overload_3(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="my-any-subnet-interface",
- ip_family="dual",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="any_subnet",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_raw_response_attach_interface_overload_3(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_streaming_response_attach_interface_overload_3(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_attach_interface_overload_3(self, async_client: AsyncGcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- network_id="e3c6ee77-48cb-416b-b204-11b492cc776e3",
- )
-
- @parametrize
- async def test_method_attach_interface_overload_4(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_method_attach_interface_with_all_params_overload_4(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- ddos_profile={
- "profile_template": 29,
- "fields": [
- {
- "base_field": 10,
- "field_name": "field_name",
- "field_value": [45046, 45047],
- "value": None,
- }
- ],
- "profile_template_name": "profile_template_name",
- },
- interface_name="my-rfip-interface",
- port_group=0,
- security_groups=[
- {"id": "4536dba1-93b1-492e-b3df-270b6b9f3650"},
- {"id": "cee2ca1f-507a-4a31-b714-f6c1ffb4bdfa"},
- ],
- type="reserved_fixed_ip",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_raw_response_attach_interface_overload_4(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_streaming_response_attach_interface_overload_4(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.attach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_attach_interface_overload_4(self, async_client: AsyncGcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.attach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- port_id="59905c8e-2619-420a-b046-536096473370",
- )
-
- @parametrize
- async def test_method_detach_interface(self, async_client: AsyncGcore) -> None:
- server = await async_client.cloud.gpu_baremetal_clusters.servers.detach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- )
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_raw_response_detach_interface(self, async_client: AsyncGcore) -> None:
- response = await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.detach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- @parametrize
- async def test_streaming_response_detach_interface(self, async_client: AsyncGcore) -> None:
- async with async_client.cloud.gpu_baremetal_clusters.servers.with_streaming_response.detach_interface(
- instance_id="instance_id",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- server = await response.parse()
- assert_matches_type(TaskIDList, server, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_detach_interface(self, async_client: AsyncGcore) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `instance_id` but received ''"):
- await async_client.cloud.gpu_baremetal_clusters.servers.with_raw_response.detach_interface(
- instance_id="",
- project_id=0,
- region_id=0,
- ip_address="192.168.123.20",
- port_id="351b0dd7-ca09-431c-be53-935db3785067",
- )
-
@parametrize
async def test_method_get_console(self, async_client: AsyncGcore) -> None:
server = await async_client.cloud.gpu_baremetal_clusters.servers.get_console(
From 665b53757d1676e4ae66153eb121ba8f7bf67ce8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:42:41 +0000
Subject: [PATCH 14/14] release: 0.26.0
---
.release-please-manifest.json | 2 +-
CHANGELOG.md | 30 ++++++++++++++++++++++++++++++
pyproject.toml | 2 +-
src/gcore/_version.py | 2 +-
4 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a36746b8..caf5ca3f 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.25.0"
+ ".": "0.26.0"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d954d7ed..129d52ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,35 @@
# Changelog
+## 0.26.0 (2025-12-23)
+
+Full Changelog: [v0.25.0...v0.26.0](https://github.com/G-Core/gcore-python/compare/v0.25.0...v0.26.0)
+
+### ⚠ BREAKING CHANGES
+
+* **cloud:** move methods to gpu_baremetal_clusters.interfaces.attach()/detach()
+* **cloud:** restructure to be gpu_virtual.clusters
+
+### Features
+
+* **api:** aggregated API specs update ([3a272e8](https://github.com/G-Core/gcore-python/commit/3a272e8b9a0399be48094ce82cc9127e59a2867a))
+* **api:** aggregated API specs update ([789277a](https://github.com/G-Core/gcore-python/commit/789277a61a3ead490d9b8b0f439e0e21100036ba))
+* **cloud:** add k8s cluster pools check quotas method ([326786c](https://github.com/G-Core/gcore-python/commit/326786cd4d499fffe760f308326bbd79003e4856))
+
+
+### Bug Fixes
+
+* **cloud:** move methods to gpu_baremetal_clusters.interfaces.attach()/detach() ([053ebcf](https://github.com/G-Core/gcore-python/commit/053ebcfdf462a66c3edc929e052b75d8afd51a20))
+* **cloud:** restructure to be gpu_virtual.clusters ([36b7b63](https://github.com/G-Core/gcore-python/commit/36b7b63d98a20c3927069bb396154b068304f321))
+* **examples:** make code consistent with comment ([85a0331](https://github.com/G-Core/gcore-python/commit/85a03310d31fa3ac6b74897b8754a19bd905df75))
+* use async_to_httpx_files in patch method ([88c4050](https://github.com/G-Core/gcore-python/commit/88c4050f59d8a55796ab553a60b1e55aaadc81ca))
+
+
+### Chores
+
+* **internal:** add missing files argument to base client ([7d81efb](https://github.com/G-Core/gcore-python/commit/7d81efb323f72cdcaed3faa59a4fc5182f0fedab))
+* **internal:** codegen related update ([3c38f42](https://github.com/G-Core/gcore-python/commit/3c38f4280bc1b57f987ff984c7504c4781d74ab8))
+* speedup initial import ([ff1db23](https://github.com/G-Core/gcore-python/commit/ff1db23e58ffc5e118bd1fed3585ffc0cd04855e))
+
## 0.25.0 (2025-12-12)
Full Changelog: [v0.24.0...v0.25.0](https://github.com/G-Core/gcore-python/compare/v0.24.0...v0.25.0)
diff --git a/pyproject.toml b/pyproject.toml
index c810ecea..6d4eae5e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "gcore"
-version = "0.25.0"
+version = "0.26.0"
description = "The official Python library for the gcore API"
dynamic = ["readme"]
license = "Apache-2.0"
diff --git a/src/gcore/_version.py b/src/gcore/_version.py
index 7771dae8..3749030a 100644
--- a/src/gcore/_version.py
+++ b/src/gcore/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "gcore"
-__version__ = "0.25.0" # x-release-please-version
+__version__ = "0.26.0" # x-release-please-version