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.22.0"
".": "0.23.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: 633
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-61246c736228a6c005ecc784c08b6339b9afff6b3ea7225ef6bad7112e158355.yml
openapi_spec_hash: 2dfeaccd1623885572ec0f968f8f50c0
config_hash: ed81680ad8f1babe06844ab73e7148d1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-415b3e1ff98241ebe58f65df0e6ee1381f07ced3d6e9af8bbf9ff8ba25ad655d.yml
openapi_spec_hash: cbcb8f94fedaa853d6fa4763016ce6e0
config_hash: c71c5fd84e30d315500ae54ec3a83b71
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 0.23.0 (2025-12-01)

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

### ⚠ BREAKING CHANGES

* **cloud:** change *_and_poll signature types to correspond to regular methods

### Features

* **api:** aggregated API specs update ([66af572](https://github.com/G-Core/gcore-python/commit/66af57201d06fc54c6b79a59690982bcc107fbfa))
* **api:** aggregated API specs update ([8e6e84f](https://github.com/G-Core/gcore-python/commit/8e6e84f26b4dfc56558641e3996529f7552a7b9f))


### Bug Fixes

* **cloud:** change *_and_poll signature types to correspond to regular methods ([d58e9b4](https://github.com/G-Core/gcore-python/commit/d58e9b48d2aa104beef736c57b6170886bea6072))
* ensure streams are always closed ([e2716cb](https://github.com/G-Core/gcore-python/commit/e2716cbc3b7de2b3fe7eef68fa1c07dcf4014385))


### Chores

* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([7703d53](https://github.com/G-Core/gcore-python/commit/7703d534a550a9465212e391aeeef906cf589dd0))

## 0.22.0 (2025-11-25)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/G-Core/gcore-python/compare/v0.21.0...v0.22.0)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gcore"
version = "0.22.0"
version = "0.23.0"
description = "The official Python library for the gcore API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -46,7 +46,7 @@ managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"pyright==1.1.399",
"mypy",
"mypy==1.17",
"respx",
"pytest",
"pytest-asyncio",
Expand Down
4 changes: 3 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ mdurl==0.1.2
multidict==6.4.4
# via aiohttp
# via yarl
mypy==1.14.1
mypy==1.17.0
mypy-extensions==1.0.0
# via mypy
nodeenv==1.8.0
Expand All @@ -84,6 +84,8 @@ nox==2023.4.22
packaging==23.2
# via nox
# via pytest
pathspec==0.12.1
# via mypy
platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
Expand Down
8 changes: 4 additions & 4 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.11.9
pydantic==2.12.5
# via gcore
pydantic-core==2.33.2
pydantic-core==2.41.5
# via pydantic
sniffio==1.3.0
# via anyio
# via gcore
typing-extensions==4.12.2
typing-extensions==4.15.0
# via anyio
# via gcore
# via multidict
# via pydantic
# via pydantic-core
# via typing-inspection
typing-inspection==0.4.1
typing-inspection==0.4.2
# via pydantic
yarl==1.20.0
# via aiohttp
22 changes: 12 additions & 10 deletions src/gcore/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]:
process_data = self._client._process_response_data
iterator = self._iter_events()

for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# As we might not fully consume the response stream, we need to close it explicitly
response.close()
try:
for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
finally:
# Ensure the response is closed even if the consumer doesn't read all data
response.close()

def __enter__(self) -> Self:
return self
Expand Down Expand Up @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]:
process_data = self._client._process_response_data
iterator = self._iter_events()

async for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# As we might not fully consume the response stream, we need to close it explicitly
await response.aclose()
try:
async for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
finally:
# Ensure the response is closed even if the consumer doesn't read all data
await response.aclose()

async def __aenter__(self) -> Self:
return self
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.22.0" # x-release-please-version
__version__ = "0.23.0" # x-release-please-version
8 changes: 4 additions & 4 deletions src/gcore/resources/cloud/baremetal/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create(
region_id: int | None = None,
flavor: str,
interfaces: Iterable[server_create_params.Interface],
app_config: Optional[object] | Omit = omit,
app_config: Optional[Dict[str, object]] | Omit = omit,
apptemplate_id: str | Omit = omit,
ddos_profile: server_create_params.DDOSProfile | Omit = omit,
image_id: str | Omit = omit,
Expand Down Expand Up @@ -404,7 +404,7 @@ def create_and_poll(
region_id: int | None = None,
flavor: str,
interfaces: Iterable[server_create_params.Interface],
app_config: Optional[object] | Omit = omit,
app_config: Optional[Dict[str, object]] | Omit = omit,
apptemplate_id: str | Omit = omit,
ddos_profile: server_create_params.DDOSProfile | Omit = omit,
image_id: str | Omit = omit,
Expand Down Expand Up @@ -546,7 +546,7 @@ async def create(
region_id: int | None = None,
flavor: str,
interfaces: Iterable[server_create_params.Interface],
app_config: Optional[object] | Omit = omit,
app_config: Optional[Dict[str, object]] | Omit = omit,
apptemplate_id: str | Omit = omit,
ddos_profile: server_create_params.DDOSProfile | Omit = omit,
image_id: str | Omit = omit,
Expand Down Expand Up @@ -896,7 +896,7 @@ async def create_and_poll(
region_id: int | None = None,
flavor: str,
interfaces: Iterable[server_create_params.Interface],
app_config: Optional[object] | Omit = omit,
app_config: Optional[Dict[str, object]] | Omit = omit,
apptemplate_id: str | Omit = omit,
ddos_profile: server_create_params.DDOSProfile | Omit = omit,
image_id: str | Omit = omit,
Expand Down
4 changes: 2 additions & 2 deletions src/gcore/resources/cloud/billing_reservations.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def list(
configurations and associated pricing.

Args:
metric_name: Name from billing features for specific resource
metric_name: Metric name for the resource (e.g., 'bm1-hf-`medium_min`')

order_by: Order by field and direction.

Expand Down Expand Up @@ -138,7 +138,7 @@ async def list(
configurations and associated pricing.

Args:
metric_name: Name from billing features for specific resource
metric_name: Metric name for the resource (e.g., 'bm1-hf-`medium_min`')

order_by: Order by field and direction.

Expand Down
8 changes: 4 additions & 4 deletions src/gcore/resources/cloud/instances/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def create(
interfaces: Iterable[instance_create_params.Interface],
volumes: Iterable[instance_create_params.Volume],
allow_app_ports: bool | Omit = omit,
configuration: Optional[object] | Omit = omit,
configuration: Optional[Dict[str, object]] | Omit = omit,
name: str | Omit = omit,
name_template: str | Omit = omit,
password: str | Omit = omit,
Expand Down Expand Up @@ -272,7 +272,7 @@ def create_and_poll(
interfaces: Iterable[instance_create_params.Interface],
volumes: Iterable[instance_create_params.Volume],
allow_app_ports: bool | Omit = omit,
configuration: Optional[object] | Omit = omit,
configuration: Optional[Dict[str, object]] | Omit = omit,
name: str | Omit = omit,
name_template: str | Omit = omit,
password: str | Omit = omit,
Expand Down Expand Up @@ -1542,7 +1542,7 @@ async def create(
interfaces: Iterable[instance_create_params.Interface],
volumes: Iterable[instance_create_params.Volume],
allow_app_ports: bool | Omit = omit,
configuration: Optional[object] | Omit = omit,
configuration: Optional[Dict[str, object]] | Omit = omit,
name: str | Omit = omit,
name_template: str | Omit = omit,
password: str | Omit = omit,
Expand Down Expand Up @@ -1696,7 +1696,7 @@ async def create_and_poll(
interfaces: Iterable[instance_create_params.Interface],
volumes: Iterable[instance_create_params.Volume],
allow_app_ports: bool | Omit = omit,
configuration: Optional[object] | Omit = omit,
configuration: Optional[Dict[str, object]] | Omit = omit,
name: str | Omit = omit,
name_template: str | Omit = omit,
password: str | Omit = omit,
Expand Down
32 changes: 24 additions & 8 deletions src/gcore/resources/cloud/security_groups/security_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def create(
Create a new security group with the specified configuration.

Args:
project_id: Project ID

region_id: Region ID

security_group: Security group

instances: List of instances
Expand Down Expand Up @@ -212,13 +216,17 @@ def list(
List all security groups in the specified project and region.

Args:
limit: Limit the number of returned security groups
project_id: Project ID

region_id: Region ID

limit: Limit of items on a single page

offset: Offset value is used to exclude the first set of records from the result
offset: Offset in results list

tag_key: Filter by tag keys.
tag_key: Optional. Filter by tag keys.

tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
tag_key_value: Optional. Filter by tag key-value pairs. Must be a valid JSON string.

extra_headers: Send extra headers

Expand Down Expand Up @@ -457,6 +465,10 @@ async def create(
Create a new security group with the specified configuration.

Args:
project_id: Project ID

region_id: Region ID

security_group: Security group

instances: List of instances
Expand Down Expand Up @@ -589,13 +601,17 @@ def list(
List all security groups in the specified project and region.

Args:
limit: Limit the number of returned security groups
project_id: Project ID

region_id: Region ID

limit: Limit of items on a single page

offset: Offset value is used to exclude the first set of records from the result
offset: Offset in results list

tag_key: Filter by tag keys.
tag_key: Optional. Filter by tag keys.

tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
tag_key_value: Optional. Filter by tag key-value pairs. Must be a valid JSON string.

extra_headers: Send extra headers

Expand Down
6 changes: 3 additions & 3 deletions src/gcore/types/cloud/audit_log_entry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing import Dict, List, Optional
from datetime import datetime
from typing_extensions import Literal

Expand Down Expand Up @@ -81,7 +81,7 @@ class Resource(BaseModel):
]
"""Resource type"""

resource_body: Optional[object] = None
resource_body: Optional[Dict[str, object]] = None
"""Free-form object, resource body."""

search_field: Optional[str] = None
Expand Down Expand Up @@ -115,7 +115,7 @@ class AuditLogEntry(BaseModel):
User action log was successfully received by its subscriber in case there is one
"""

action_data: Optional[object] = None
action_data: Optional[Dict[str, object]] = None
"""Additional information about the action"""

action_type: Literal[
Expand Down
2 changes: 1 addition & 1 deletion src/gcore/types/cloud/baremetal/server_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ServerCreateParams(TypedDict, total=False):
You can create one or more interfaces - private, public, or both.
"""

app_config: Optional[object]
app_config: Optional[Dict[str, object]]
"""
Parameters for the application template if creating the instance from an
`apptemplate`.
Expand Down
6 changes: 0 additions & 6 deletions src/gcore/types/cloud/baremetal_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,3 @@ class BaremetalFlavor(BaseModel):

price_status: Optional[Literal["error", "hide", "show"]] = None
"""Price status for the UI"""

reserved_in_stock: Optional[int] = None
"""Count of reserved but not used nodes.

If a client don't have reservations for the flavor, it's None.
"""
2 changes: 1 addition & 1 deletion src/gcore/types/cloud/billing_reservation_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class BillingReservationListParams(TypedDict, total=False):
metric_name: str
"""Name from billing features for specific resource"""
"""Metric name for the resource (e.g., 'bm1-hf-`medium_min`')"""

order_by: Literal["active_from.asc", "active_from.desc", "active_to.asc", "active_to.desc"]
"""Order by field and direction."""
Expand Down
2 changes: 1 addition & 1 deletion src/gcore/types/cloud/instance_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class InstanceCreateParams(TypedDict, total=False):
marketplace application template.
"""

configuration: Optional[object]
configuration: Optional[Dict[str, object]]
"""
Parameters for the application template if creating the instance from an
`apptemplate`.
Expand Down
4 changes: 2 additions & 2 deletions src/gcore/types/cloud/load_balancer_flavor_detail.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Union, Optional
from typing import Dict, Union, Optional
from typing_extensions import Literal, TypeAlias

from ..._models import BaseModel
from .flavor_hardware_description import FlavorHardwareDescription

__all__ = ["LoadBalancerFlavorDetail", "HardwareDescription"]

HardwareDescription: TypeAlias = Union[FlavorHardwareDescription, object]
HardwareDescription: TypeAlias = Union[FlavorHardwareDescription, Dict[str, object]]


class LoadBalancerFlavorDetail(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions src/gcore/types/cloud/load_balancer_listener_detail.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing import Dict, List, Optional

from ..._models import BaseModel
from .provisioning_status import ProvisioningStatus
Expand Down Expand Up @@ -32,7 +32,7 @@ class LoadBalancerListenerDetail(BaseModel):
creator_task_id: Optional[str] = None
"""Task that created this entity"""

insert_headers: object
insert_headers: Dict[str, object]
"""Dictionary of additional header insertion into HTTP headers.

Only used with HTTP and `TERMINATED_HTTPS` protocols.
Expand Down
Loading
Loading