Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.14.0"
".": "0.15.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 612
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-d59e09eb6882032973e42339edbc5170a0d695dcb127e28e29109f1a1f088afd.yml
openapi_spec_hash: 8768c88e22bbe1d3042539be56ea8469
config_hash: 11eb703eee66609eba76695b18f8cb4a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-0c766e6ecf7e97b4bad1f4ee664a81ab3f3c76e655993623084f9cf9517097cd.yml
openapi_spec_hash: 1a1ec9ecc3cdf29e91d4dd75570af164
config_hash: e660d386571b7b7f97e632d15f98719f
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.15.0 (2025-10-02)

Full Changelog: [v0.14.0...v0.15.0](https://github.com/G-Core/gcore-python/compare/v0.14.0...v0.15.0)

### Features

* **api:** Add missing reserved_fixed_ips update method ([b7b8db0](https://github.com/G-Core/gcore-python/commit/b7b8db03bd75a4889601a6da2fd5aa2e8004a141))
* **api:** aggregated API specs update ([8c59ffa](https://github.com/G-Core/gcore-python/commit/8c59ffa34fe9d77a585d53b9243fb0ec752de5c4))
* **api:** aggregated API specs update ([6281066](https://github.com/G-Core/gcore-python/commit/6281066df4e5cc479f7f53f731e4ecd59f41e7a4))
* **api:** aggregated API specs update ([0a2f63b](https://github.com/G-Core/gcore-python/commit/0a2f63b1a5dd2dfc26cfa9b3e5ad4e4e997e4988))


### Bug Fixes

* **examples:** remove unnecessary None checks in quota examples ([#97](https://github.com/G-Core/gcore-python/issues/97)) ([ff71c83](https://github.com/G-Core/gcore-python/commit/ff71c83bb97e5fabf25efc32e0e2f6b60addbe64))

## 0.14.0 (2025-09-30)

Full Changelog: [v0.13.0...v0.14.0](https://github.com/G-Core/gcore-python/compare/v0.13.0...v0.14.0)
Expand Down
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ from gcore.types.cloud import ReservedFixedIP
Methods:

- <code title="post /cloud/v1/reserved_fixed_ips/{project_id}/{region_id}">client.cloud.reserved_fixed_ips.<a href="./src/gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py">create</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/reserved_fixed_ip_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="patch /cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}">client.cloud.reserved_fixed_ips.<a href="./src/gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py">update</a>(port_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/reserved_fixed_ip_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/reserved_fixed_ip.py">ReservedFixedIP</a></code>
- <code title="get /cloud/v1/reserved_fixed_ips/{project_id}/{region_id}">client.cloud.reserved_fixed_ips.<a href="./src/gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/reserved_fixed_ip_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/reserved_fixed_ip.py">SyncOffsetPage[ReservedFixedIP]</a></code>
- <code title="delete /cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}">client.cloud.reserved_fixed_ips.<a href="./src/gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py">delete</a>(port_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="get /cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}">client.cloud.reserved_fixed_ips.<a href="./src/gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py">get</a>(port_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/reserved_fixed_ip.py">ReservedFixedIP</a></code>
Expand Down Expand Up @@ -344,7 +345,7 @@ Methods:
- <code title="post /cloud/v1/subnets/{project_id}/{region_id}">client.cloud.networks.subnets.<a href="./src/gcore/resources/cloud/networks/subnets.py">create</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/networks/subnet_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="patch /cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}">client.cloud.networks.subnets.<a href="./src/gcore/resources/cloud/networks/subnets.py">update</a>(subnet_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/networks/subnet_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/subnet.py">Subnet</a></code>
- <code title="get /cloud/v1/subnets/{project_id}/{region_id}">client.cloud.networks.subnets.<a href="./src/gcore/resources/cloud/networks/subnets.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/networks/subnet_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/subnet.py">SyncOffsetPage[Subnet]</a></code>
- <code title="delete /cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}">client.cloud.networks.subnets.<a href="./src/gcore/resources/cloud/networks/subnets.py">delete</a>(subnet_id, \*, project_id, region_id) -> None</code>
- <code title="delete /cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}">client.cloud.networks.subnets.<a href="./src/gcore/resources/cloud/networks/subnets.py">delete</a>(subnet_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="get /cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}">client.cloud.networks.subnets.<a href="./src/gcore/resources/cloud/networks/subnets.py">get</a>(subnet_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/subnet.py">Subnet</a></code>

### Routers
Expand Down
2 changes: 0 additions & 2 deletions examples/cloud/quotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def main() -> None:

# Get client ID from IAM account overview
gcore_client_id = gcore.iam.get_account_overview().id
if gcore_client_id is None:
raise ValueError("Client ID is None for this account")

get_all_quotas(client=gcore)
get_regional_quotas(client=gcore, client_id=gcore_client_id)
Expand Down
2 changes: 0 additions & 2 deletions examples/cloud/quotas_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ async def main() -> None:
# Get client ID from IAM account overview
account_overview = await gcore.iam.get_account_overview()
gcore_client_id = account_overview.id
if gcore_client_id is None:
raise ValueError("Client ID is None for this account")

await get_all_quotas(client=gcore)
await get_regional_quotas(client=gcore, client_id=gcore_client_id)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gcore"
version = "0.14.0"
version = "0.15.0"
description = "The official Python library for the gcore API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/gcore/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "gcore"
__version__ = "0.14.0" # x-release-please-version
__version__ = "0.15.0" # x-release-please-version
12 changes: 5 additions & 7 deletions src/gcore/resources/cloud/networks/subnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import httpx

from ...._types import NOT_GIVEN, Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
from ...._types import NOT_GIVEN, 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
Expand Down Expand Up @@ -413,7 +413,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
) -> TaskIDList:
"""
Delete subnet

Expand All @@ -438,15 +438,14 @@ def delete(
region_id = self._client._get_cloud_region_id_path_param()
if not subnet_id:
raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._delete(
f"/cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}"
if self._client._base_url_overridden
else f"https://api.gcore.com//cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
cast_to=TaskIDList,
)

def get(
Expand Down Expand Up @@ -881,7 +880,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
) -> TaskIDList:
"""
Delete subnet

Expand All @@ -906,15 +905,14 @@ async def delete(
region_id = self._client._get_cloud_region_id_path_param()
if not subnet_id:
raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._delete(
f"/cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}"
if self._client._base_url_overridden
else f"https://api.gcore.com//cloud/v1/subnets/{project_id}/{region_id}/{subnet_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
cast_to=TaskIDList,
)

async def get(
Expand Down
111 changes: 110 additions & 1 deletion src/gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
async_to_streamed_response_wrapper,
)
from ....pagination import SyncOffsetPage, AsyncOffsetPage
from ....types.cloud import InterfaceIPFamily, reserved_fixed_ip_list_params, reserved_fixed_ip_create_params
from ....types.cloud import (
InterfaceIPFamily,
reserved_fixed_ip_list_params,
reserved_fixed_ip_create_params,
reserved_fixed_ip_update_params,
)
from ...._base_client import AsyncPaginator, make_request_options
from ....types.cloud.task_id_list import TaskIDList
from ....types.cloud.reserved_fixed_ip import ReservedFixedIP
Expand Down Expand Up @@ -295,6 +300,51 @@ def create(
cast_to=TaskIDList,
)

def update(
self,
port_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
is_vip: bool,
# 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,
) -> ReservedFixedIP:
"""
Update the VIP status of a reserved fixed IP.

Args:
is_vip: If reserved fixed IP should be a VIP

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 port_id:
raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}")
return self._patch(
f"/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}"
if self._client._base_url_overridden
else f"https://api.gcore.com//cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}",
body=maybe_transform({"is_vip": is_vip}, reserved_fixed_ip_update_params.ReservedFixedIPUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=ReservedFixedIP,
)

def list(
self,
*,
Expand Down Expand Up @@ -1016,6 +1066,53 @@ async def create(
cast_to=TaskIDList,
)

async def update(
self,
port_id: str,
*,
project_id: int | None = None,
region_id: int | None = None,
is_vip: bool,
# 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,
) -> ReservedFixedIP:
"""
Update the VIP status of a reserved fixed IP.

Args:
is_vip: If reserved fixed IP should be a VIP

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 port_id:
raise ValueError(f"Expected a non-empty value for `port_id` but received {port_id!r}")
return await self._patch(
f"/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}"
if self._client._base_url_overridden
else f"https://api.gcore.com//cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}",
body=await async_maybe_transform(
{"is_vip": is_vip}, reserved_fixed_ip_update_params.ReservedFixedIPUpdateParams
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=ReservedFixedIP,
)

def list(
self,
*,
Expand Down Expand Up @@ -1484,6 +1581,9 @@ def __init__(self, reserved_fixed_ips: ReservedFixedIPsResource) -> None:
self.create = to_raw_response_wrapper(
reserved_fixed_ips.create,
)
self.update = to_raw_response_wrapper(
reserved_fixed_ips.update,
)
self.list = to_raw_response_wrapper(
reserved_fixed_ips.list,
)
Expand Down Expand Up @@ -1512,6 +1612,9 @@ def __init__(self, reserved_fixed_ips: AsyncReservedFixedIPsResource) -> None:
self.create = async_to_raw_response_wrapper(
reserved_fixed_ips.create,
)
self.update = async_to_raw_response_wrapper(
reserved_fixed_ips.update,
)
self.list = async_to_raw_response_wrapper(
reserved_fixed_ips.list,
)
Expand Down Expand Up @@ -1540,6 +1643,9 @@ def __init__(self, reserved_fixed_ips: ReservedFixedIPsResource) -> None:
self.create = to_streamed_response_wrapper(
reserved_fixed_ips.create,
)
self.update = to_streamed_response_wrapper(
reserved_fixed_ips.update,
)
self.list = to_streamed_response_wrapper(
reserved_fixed_ips.list,
)
Expand Down Expand Up @@ -1568,6 +1674,9 @@ def __init__(self, reserved_fixed_ips: AsyncReservedFixedIPsResource) -> None:
self.create = async_to_streamed_response_wrapper(
reserved_fixed_ips.create,
)
self.update = async_to_streamed_response_wrapper(
reserved_fixed_ips.update,
)
self.list = async_to_streamed_response_wrapper(
reserved_fixed_ips.list,
)
Expand Down
6 changes: 4 additions & 2 deletions src/gcore/resources/iam/api_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

from typing import Optional

import httpx

from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
Expand Down Expand Up @@ -48,7 +50,7 @@ def create(
client_id: int,
*,
client_user: api_token_create_params.ClientUser,
exp_date: str,
exp_date: Optional[str],
name: str,
description: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -269,7 +271,7 @@ async def create(
client_id: int,
*,
client_user: api_token_create_params.ClientUser,
exp_date: str,
exp_date: Optional[str],
name: str,
description: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
20 changes: 20 additions & 0 deletions src/gcore/types/cdn/cdn_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,26 @@ class OptionsQueryStringForwarding(BaseModel):
of the streaming session.
"""

forward_except_keys: Optional[List[str]] = None
"""
The `forward_except_keys` field provides a mechanism to exclude specific
parameters from being forwarded from playlist files to media chunk files. By
listing certain keys in this field, you can ensure that these parameters are
omitted during the forwarding process. This is particularly useful for
preventing sensitive or irrelevant information from being included in requests
for media chunks, thereby enhancing security and optimizing performance.
"""

forward_only_keys: Optional[List[str]] = None
"""
The `forward_only_keys` field allows for granular control over which specific
parameters are forwarded from playlist files to media chunk files. By specifying
certain keys, only those parameters will be propagated, ensuring that only
relevant information is passed along. This is particularly useful for security
and performance optimization, as it prevents unnecessary or sensitive data from
being included in requests for media chunks.
"""


class OptionsRedirectHTTPToHTTPS(BaseModel):
enabled: bool
Expand Down
20 changes: 20 additions & 0 deletions src/gcore/types/cdn/resource_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,26 @@ class OptionsQueryStringForwarding(TypedDict, total=False):
of the streaming session.
"""

forward_except_keys: SequenceNotStr[str]
"""
The `forward_except_keys` field provides a mechanism to exclude specific
parameters from being forwarded from playlist files to media chunk files. By
listing certain keys in this field, you can ensure that these parameters are
omitted during the forwarding process. This is particularly useful for
preventing sensitive or irrelevant information from being included in requests
for media chunks, thereby enhancing security and optimizing performance.
"""

forward_only_keys: SequenceNotStr[str]
"""
The `forward_only_keys` field allows for granular control over which specific
parameters are forwarded from playlist files to media chunk files. By specifying
certain keys, only those parameters will be propagated, ensuring that only
relevant information is passed along. This is particularly useful for security
and performance optimization, as it prevents unnecessary or sensitive data from
being included in requests for media chunks.
"""


class OptionsRedirectHTTPToHTTPS(TypedDict, total=False):
enabled: Required[bool]
Expand Down
Loading