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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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 087a20e04c2bc895e91d74cd6ed3dc28e81cc3ac 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:40 +0000
Subject: [PATCH 11/11] release: 0.26.0
---
.release-please-manifest.json | 2 +-
CHANGELOG.md | 22 ++++++++++++++++++++++
pyproject.toml | 2 +-
src/gcore/_version.py | 2 +-
4 files changed, 25 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..348faa90 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,27 @@
# Changelog
+## 0.26.0 (2025-12-18)
+
+Full Changelog: [v0.25.0...v0.26.0](https://github.com/G-Core/gcore-python/compare/v0.25.0...v0.26.0)
+
+### 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
+
+* 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