Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2f8fb0a
feat(api): aggregated API specs update
stainless-app[bot] Apr 6, 2026
7beaf49
feat(api): aggregated API specs update
stainless-app[bot] Apr 6, 2026
fce124a
refactor(cloud): split instance and baremetal image models
stainless-app[bot] Apr 7, 2026
7e924f8
fix(examples): update baremetal image examples to use BaremetalImage …
pedrodeoliveira Apr 7, 2026
de11047
fix(dns): update network-mappings get_by_name to new endpoint path
stainless-app[bot] Apr 7, 2026
c95a0b8
feat(api): fix(cdn): harmonize pagination across CDN list endpoints
stainless-app[bot] Apr 7, 2026
0971eaa
fix(client): preserve hardcoded query params when merging with user p…
stainless-app[bot] Apr 7, 2026
01be2f5
feat(api): aggregated API specs update
stainless-app[bot] Apr 8, 2026
eda0539
feat(api): aggregated API specs update
stainless-app[bot] Apr 8, 2026
4b99901
fix(cloud): align polling methods with underlying base method
pedrodeoliveira Apr 10, 2026
16f4262
fix: ensure file data are only sent as 1 parameter
stainless-app[bot] Apr 10, 2026
fa05d93
docs: update examples
stainless-app[bot] Apr 10, 2026
adc8f40
feat(cloud): add delete_and_poll and examples for GPU baremetal clusters
pedrodeoliveira Apr 14, 2026
1ed9b85
feat(cloud): add polling methods and examples for GPU virtual clusters
pedrodeoliveira Apr 14, 2026
51ad9c9
feat(api): aggregated API specs update
stainless-app[bot] Apr 15, 2026
0110236
feat(api): aggregated API specs update
stainless-app[bot] Apr 15, 2026
284df4c
feat(api): aggregated API specs update
stainless-app[bot] Apr 16, 2026
1bf3513
chore(cloud)!: remove deprecated cloud.inference.deployments.get_api_key
stainless-app[bot] Apr 17, 2026
64436a5
release: 0.42.0
stainless-app[bot] Apr 17, 2026
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.41.0"
".": "0.42.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 658
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-e7708c017357421a39e6de2f7141415c93951bbc835742909b0d9d6f0825a318.yml
openapi_spec_hash: 2abb653b57137b808c182cb1e778a429
config_hash: ab6b5443d52ca04e4e0e12def131f8e6
configured_endpoints: 657
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-e8141952a77a5faabf98feca4f964baaef5b84aa66d785c8b35357e48928df9c.yml
openapi_spec_hash: a5ff6021de586dafea9df886214ceb2c
config_hash: 0b9fe3822aef92ebe43ad609b931bfc8
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Changelog

## 0.42.0 (2026-04-17)

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

### ⚠ BREAKING CHANGES

* **cloud:** remove deprecated cloud.inference.deployments.get_api_key

### Features

* **api:** aggregated API specs update ([284df4c](https://github.com/G-Core/gcore-python/commit/284df4cedcfac4b86c746c963fc69b5af183d014))
* **api:** aggregated API specs update ([0110236](https://github.com/G-Core/gcore-python/commit/0110236e7efb9269398475d2500e078c599037f6))
* **api:** aggregated API specs update ([51ad9c9](https://github.com/G-Core/gcore-python/commit/51ad9c97608b81a0358c3c8e06b3321cb331a06b))
* **api:** aggregated API specs update ([eda0539](https://github.com/G-Core/gcore-python/commit/eda0539c7bac06e3451703469aabf50fb5290467))
* **api:** aggregated API specs update ([01be2f5](https://github.com/G-Core/gcore-python/commit/01be2f5ba1c94daeff5e61a4672b9ff8b0bac7cc))
* **api:** aggregated API specs update ([7beaf49](https://github.com/G-Core/gcore-python/commit/7beaf49ae0cd289d6a60a79de18ed722a9cbf088))
* **api:** aggregated API specs update ([2f8fb0a](https://github.com/G-Core/gcore-python/commit/2f8fb0a0a1493b19a84a8d4fcb863ddfc2f66db8))
* **api:** fix(cdn): harmonize pagination across CDN list endpoints ([c95a0b8](https://github.com/G-Core/gcore-python/commit/c95a0b8b047bb8f7370934fe35576648163e3a3e))
* **cloud:** add delete_and_poll and examples for GPU baremetal clusters ([adc8f40](https://github.com/G-Core/gcore-python/commit/adc8f408f925862f13e19ac30c96684f40395aca))
* **cloud:** add polling methods and examples for GPU virtual clusters ([1ed9b85](https://github.com/G-Core/gcore-python/commit/1ed9b85b772bd52971503e21a7e484af6812f5b4))


### Bug Fixes

* **client:** preserve hardcoded query params when merging with user params ([0971eaa](https://github.com/G-Core/gcore-python/commit/0971eaa023789ebaf5baeae39f4977cba3cbab1d))
* **cloud:** align polling methods with underlying base method ([4b99901](https://github.com/G-Core/gcore-python/commit/4b999011b48a859a6f95649246ac3a5ba67ff62e))
* **dns:** update network-mappings get_by_name to new endpoint path ([de11047](https://github.com/G-Core/gcore-python/commit/de110478944f7c9dc61ac3481dba876912e05ff6))
* ensure file data are only sent as 1 parameter ([16f4262](https://github.com/G-Core/gcore-python/commit/16f4262f6ca89edcefe0315c13963e2d84f945c2))
* **examples:** update baremetal image examples to use BaremetalImage type ([7e924f8](https://github.com/G-Core/gcore-python/commit/7e924f830c234be00e8c6cb940fe59ff4629a626))


### Chores

* **cloud:** remove deprecated cloud.inference.deployments.get_api_key ([1bf3513](https://github.com/G-Core/gcore-python/commit/1bf3513b19eda2cd35230947dd36a1b09f66e419))


### Documentation

* update examples ([fa05d93](https://github.com/G-Core/gcore-python/commit/fa05d9370764f706015b7628abd3ba0f12f880d7))


### Refactors

* **cloud:** split instance and baremetal image models ([fce124a](https://github.com/G-Core/gcore-python/commit/fce124a98b3eb6cec5bbcb46e60e424b4c6da298))

## 0.41.0 (2026-04-03)

Full Changelog: [v0.40.0...v0.41.0](https://github.com/G-Core/gcore-python/compare/v0.40.0...v0.41.0)
Expand Down
12 changes: 6 additions & 6 deletions examples/cloud/baremetal.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List

from gcore import Gcore
from gcore.types.cloud.image import Image
from gcore.types.cloud.baremetal_flavor import BaremetalFlavor
from gcore.types.cloud.baremetal.baremetal_image import BaremetalImage
from gcore.types.cloud.baremetal.server_create_params import (
InterfaceCreateBareMetalExternalInterfaceSerializer,
)
Expand Down Expand Up @@ -80,7 +80,7 @@ def list_flavors(*, client: Gcore) -> List[BaremetalFlavor]:
return flavors.results


def list_images(*, client: Gcore) -> List[Image]:
def list_images(*, client: Gcore) -> List[BaremetalImage]:
print("\n=== LIST BAREMETAL IMAGES ===")
images = client.cloud.baremetal.images.list()
_print_image_details(images.results)
Expand Down Expand Up @@ -108,7 +108,7 @@ def _print_flavor_details(flavors: List[BaremetalFlavor]) -> None:
print(f" ... and {len(flavors) - display_count} more flavors")


def _print_image_details(images: List[Image]) -> None:
def _print_image_details(images: List[BaremetalImage]) -> None:
display_count = 3
if len(images) < display_count:
display_count = len(images)
Expand All @@ -133,15 +133,15 @@ def _get_smallest_flavor(flavors: List[BaremetalFlavor]) -> str:
return smallest_flavor.flavor_id


def _get_ubuntu_image(images: List[Image]) -> str:
def _get_ubuntu_image(images: List[BaremetalImage]) -> str:
return _get_os_image(images, "ubuntu")


def _get_debian_image(images: List[Image]) -> str:
def _get_debian_image(images: List[BaremetalImage]) -> str:
return _get_os_image(images, "debian")


def _get_os_image(images: List[Image], os_name: str) -> str:
def _get_os_image(images: List[BaremetalImage], os_name: str) -> str:
os_images = [img for img in images if os_name.lower() in img.name.lower()]
if not os_images:
linux_images = [img for img in images if img.os_type.lower() == "linux"]
Expand Down
12 changes: 6 additions & 6 deletions examples/cloud/baremetal_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from typing import List

from gcore import AsyncGcore
from gcore.types.cloud.image import Image
from gcore.types.cloud.baremetal_flavor import BaremetalFlavor
from gcore.types.cloud.baremetal.baremetal_image import BaremetalImage
from gcore.types.cloud.baremetal.server_create_params import (
InterfaceCreateBareMetalExternalInterfaceSerializer,
)
Expand Down Expand Up @@ -83,7 +83,7 @@ async def list_flavors(*, client: AsyncGcore) -> List[BaremetalFlavor]:
return flavors.results


async def list_images(*, client: AsyncGcore) -> List[Image]:
async def list_images(*, client: AsyncGcore) -> List[BaremetalImage]:
print("\n=== LIST BAREMETAL IMAGES ===")
images = await client.cloud.baremetal.images.list()
_print_image_details(images.results)
Expand Down Expand Up @@ -111,7 +111,7 @@ def _print_flavor_details(flavors: List[BaremetalFlavor]) -> None:
print(f" ... and {len(flavors) - display_count} more flavors")


def _print_image_details(images: List[Image]) -> None:
def _print_image_details(images: List[BaremetalImage]) -> None:
display_count = 3
if len(images) < display_count:
display_count = len(images)
Expand All @@ -136,15 +136,15 @@ def _get_smallest_flavor(flavors: List[BaremetalFlavor]) -> str:
return smallest_flavor.flavor_id


def _get_ubuntu_image(images: List[Image]) -> str:
def _get_ubuntu_image(images: List[BaremetalImage]) -> str:
return _get_os_image(images, "ubuntu")


def _get_debian_image(images: List[Image]) -> str:
def _get_debian_image(images: List[BaremetalImage]) -> str:
return _get_os_image(images, "debian")


def _get_os_image(images: List[Image], os_name: str) -> str:
def _get_os_image(images: List[BaremetalImage], os_name: str) -> str:
os_images = [img for img in images if os_name.lower() in img.name.lower()]
if not os_images:
linux_images = [img for img in images if img.os_type.lower() == "linux"]
Expand Down
190 changes: 190 additions & 0 deletions examples/cloud/gpu_baremetal_clusters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
from typing import List

from gcore import Gcore
from gcore.types.cloud.gpu_image import GPUImage
from gcore.types.cloud.network_interface import NetworkInterface
from gcore.types.cloud.gpu_baremetal.cluster_create_params import (
ServersSettings,
ServersSettingsInterfaceExternalInterfaceInputSerializer,
)
from gcore.types.cloud.gpu_baremetal.gpu_baremetal_cluster import GPUBaremetalCluster
from gcore.types.cloud.gpu_baremetal.clusters.gpu_baremetal_flavor import GPUBaremetalFlavor


def main() -> None:
# TODO set API key before running
# api_key = os.environ["GCORE_API_KEY"]
# TODO set cloud project ID before running
# cloud_project_id = os.environ["GCORE_CLOUD_PROJECT_ID"]
# TODO set cloud region ID before running
# cloud_region_id = os.environ["GCORE_CLOUD_REGION_ID"]

gcore = Gcore(
# No need to explicitly pass to Gcore constructor if using environment variables
# api_key=api_key,
# cloud_project_id=cloud_project_id,
# cloud_region_id=cloud_region_id,
)

# Flavors
flavors = list_flavors(client=gcore)

# Images
images = list_images(client=gcore)

# Clusters
flavor_name = _get_first_available_flavor(flavors)
image_id = _get_first_image(images)
cluster = create_cluster(client=gcore, flavor=flavor_name, image_id=image_id)
get_cluster(client=gcore, cluster_id=cluster.id)
list_clusters(client=gcore)
update_cluster(client=gcore, cluster_id=cluster.id)

# Interfaces
list_interfaces(client=gcore, cluster_id=cluster.id)

# Servers
list_servers(client=gcore, cluster_id=cluster.id)

# Delete
delete_cluster(client=gcore, cluster_id=cluster.id)


def create_cluster(*, client: Gcore, flavor: str, image_id: str) -> GPUBaremetalCluster:
print("\n=== CREATE GPU BAREMETAL CLUSTER ===")
cluster = client.cloud.gpu_baremetal.clusters.create_and_poll(
name="gcore-python-example-gpu-baremetal",
flavor=flavor,
image_id=image_id,
servers_count=1,
servers_settings=ServersSettings(
interfaces=[
ServersSettingsInterfaceExternalInterfaceInputSerializer(type="external"),
],
),
tags={"name": "gcore-python-example"},
)
print(f"Created cluster: ID={cluster.id}, name={cluster.name}, status={cluster.status}")
print("========================")
return cluster


def get_cluster(*, client: Gcore, cluster_id: str) -> GPUBaremetalCluster:
print("\n=== GET GPU BAREMETAL CLUSTER ===")
cluster = client.cloud.gpu_baremetal.clusters.get(cluster_id=cluster_id)
print(f"Cluster: ID={cluster.id}, name={cluster.name}, status={cluster.status}")
print("========================")
return cluster


def list_clusters(*, client: Gcore) -> None:
print("\n=== LIST GPU BAREMETAL CLUSTERS ===")
clusters = client.cloud.gpu_baremetal.clusters.list()
for count, cluster in enumerate(clusters, 1):
print(f" {count}. Cluster: ID={cluster.id}, name={cluster.name}, status={cluster.status}")
print("========================")


def update_cluster(*, client: Gcore, cluster_id: str) -> None:
print("\n=== UPDATE GPU BAREMETAL CLUSTER ===")
cluster = client.cloud.gpu_baremetal.clusters.update(
cluster_id=cluster_id, name="gcore-python-example-gpu-baremetal-updated"
)
print(f"Updated cluster: ID={cluster.id}, name={cluster.name}")
print("========================")


def delete_cluster(*, client: Gcore, cluster_id: str) -> None:
print("\n=== DELETE GPU BAREMETAL CLUSTER ===")
client.cloud.gpu_baremetal.clusters.delete_and_poll(
cluster_id=cluster_id,
all_floating_ips=True,
)
print(f"Deleted cluster: ID={cluster_id}")
print("========================")


def list_interfaces(*, client: Gcore, cluster_id: str) -> List[NetworkInterface]:
print("\n=== LIST GPU BAREMETAL CLUSTER INTERFACES ===")
interfaces = client.cloud.gpu_baremetal.clusters.interfaces.list(cluster_id=cluster_id)
for count, interface in enumerate(interfaces.results, 1):
print(f" {count}. Interface: PortID={interface.port_id}, NetworkID={interface.network_id}")
print("========================")
return interfaces.results


def list_servers(*, client: Gcore, cluster_id: str) -> None:
print("\n=== LIST GPU BAREMETAL CLUSTER SERVERS ===")
servers = client.cloud.gpu_baremetal.clusters.servers.list(cluster_id=cluster_id)
for count, server in enumerate(servers.results, 1):
print(f" {count}. Server: ID={server.id}, name={server.name}, status={server.status}")
print("========================")


def list_flavors(*, client: Gcore) -> List[GPUBaremetalFlavor]:
print("\n=== LIST GPU BAREMETAL FLAVORS ===")
flavors = client.cloud.gpu_baremetal.clusters.flavors.list()
_print_flavor_details(flavors.results)
print("========================")
return flavors.results


def list_images(*, client: Gcore) -> List[GPUImage]:
print("\n=== LIST GPU BAREMETAL IMAGES ===")
images = client.cloud.gpu_baremetal.clusters.images.list()
_print_image_details(images.results)
print("========================")
return images.results


def _print_flavor_details(flavors: List[GPUBaremetalFlavor]) -> None:
display_count = 3
if len(flavors) < display_count:
display_count = len(flavors)

for i in range(display_count):
flavor = flavors[i]
print(f" {i + 1}. Flavor: name={flavor.name}")
print(f" Capacity: {flavor.capacity}")
status = "AVAILABLE"
if flavor.disabled:
status = "DISABLED"
print(f" Status: {status}")
print()

if len(flavors) > display_count:
print(f" ... and {len(flavors) - display_count} more flavors")


def _print_image_details(images: List[GPUImage]) -> None:
display_count = 3
if len(images) < display_count:
display_count = len(images)

for i in range(display_count):
img = images[i]
print(f" {i + 1}. Image ID: {img.id}, name: {img.name}, OS type: {img.os_type}, status: {img.status}")

if len(images) > display_count:
print(f" ... and {len(images) - display_count} more images")


def _get_first_available_flavor(flavors: List[GPUBaremetalFlavor]) -> str:
available_flavors = [f for f in flavors if not f.disabled and f.capacity > 0]
if not available_flavors:
raise ValueError("No available flavors with capacity found")
selected = available_flavors[0]
print(f"Selected flavor: {selected.name} (Capacity: {selected.capacity})")
return selected.name


def _get_first_image(images: List[GPUImage]) -> str:
if not images:
raise ValueError("No images found")
selected = images[0]
print(f"Selected image: {selected.name} (ID: {selected.id})")
return selected.id


if __name__ == "__main__":
main()
Loading
Loading