Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/gcore-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

Expand All @@ -38,7 +38,7 @@ jobs:
run: ./scripts/lint

build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
Expand Down
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.39.0"
".": "0.40.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: 655
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-c4c09a01a5791ea1d7c33e3c7ae09130b461848a881644003c4f0d7aaabef8b6.yml
openapi_spec_hash: 01f8b65e87e0dd05dec110fa43c4553f
config_hash: 85e457318a30eaef6f8360fe795eec52
configured_endpoints: 658
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-979c8dcf6f85145ede67f446fa50785ed5847281a8dc67b5b85dc146bf2782a3.yml
openapi_spec_hash: c5ae6893846eda4838239c4711465c7e
config_hash: adcd166301758ddd61a653444255d48c
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.40.0 (2026-03-30)

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

### ⚠ BREAKING CHANGES

* **api:** storage resource restructured — methods moved from storage.* to storage.object_storages.* and storage.sftp_storages.*, credentials.recreate replaced by access_keys CRUD, bucket subresources (cors, lifecycle, policy) removed in favor of buckets.update, link_ssh_key/unlink_ssh_key removed in favor of ssh_keys resource.

### Features

* **api:** aggregated API specs update ([d45ea8c](https://github.com/G-Core/gcore-python/commit/d45ea8c11bf7bd8c583df0261721e2e9c5424984))
* **api:** aggregated API specs update ([473a08b](https://github.com/G-Core/gcore-python/commit/473a08b6bd90d7f7b134060b389a622b1659a13d))
* **api:** aggregated API specs update ([07228a2](https://github.com/G-Core/gcore-python/commit/07228a2d29b1fb8f4c2b1a41c0369f944ba503ed))
* **api:** feat(storage)!: migrate storage endpoints from v1-v3 to v4 ([ee3dd69](https://github.com/G-Core/gcore-python/commit/ee3dd69632d57395fcc1fce3b954ff20765df9f1))
* **cdn:** enable terraform support for cdn_rule_template ([e6e4283](https://github.com/G-Core/gcore-python/commit/e6e428388751914c243d937c152cd28ea19d8320))
* **cloud:** enable Terraform data source for inference flavors ([aa3b08d](https://github.com/G-Core/gcore-python/commit/aa3b08d8777b307b79982eaa55dd98a0c61cda6d))
* **examples:** update storage examples for v4 API ([422c9c9](https://github.com/G-Core/gcore-python/commit/422c9c97a6afb8ae226af315ff8870440712de4e))
* **fastedge:** enable fastedge_template for Terraform ([5e9dab6](https://github.com/G-Core/gcore-python/commit/5e9dab60da36beb8438b295fabbef4e2ad2e220e))
* **internal:** implement indices array format for query and form serialization ([270614e](https://github.com/G-Core/gcore-python/commit/270614e31a2d6bb7cc31d4182b1f4544e0f3ec5a))


### Chores

* **ci:** skip lint on metadata-only changes ([5277f95](https://github.com/G-Core/gcore-python/commit/5277f95a3de9c67fa39dc5e611d8315a624bae45))
* **tests:** bump steady to v0.19.6 ([ba47f6b](https://github.com/G-Core/gcore-python/commit/ba47f6be3548421482c401a94c2f8ea481ffcb0d))
* **tests:** bump steady to v0.19.7 ([7767e13](https://github.com/G-Core/gcore-python/commit/7767e1315ca81c246fa32663455731f9191a5d12))
* **tests:** skip tests failing due to OpenAPI spec issues ([0e83fd1](https://github.com/G-Core/gcore-python/commit/0e83fd19bb738c95d4f563257d2d29bba560c26e))

## 0.39.0 (2026-03-23)

Full Changelog: [v0.38.0...v0.39.0](https://github.com/G-Core/gcore-python/compare/v0.38.0...v0.39.0)
Expand Down
41 changes: 16 additions & 25 deletions examples/storage/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,50 @@ def main() -> None:
storage_id = create_storage(client=gcore)
list_storages(client=gcore)
get_storage(client=gcore, storage_id=storage_id)
update_storage(client=gcore, storage_id=storage_id)
delete_storage(client=gcore, storage_id=storage_id)


def create_storage(*, client: Gcore) -> int:
print("\n=== CREATE STORAGE ===")
name = f"example-s3-storage-{int(time.time())}"
storage = client.storage.create( # pyright: ignore[reportDeprecated]
name = f"s3-basic-{int(time.time())}"
storage = client.storage.object_storages.create(
name=name,
type="s3_compatible",
location="s-ed1",
location_name="s-ed1",
)
print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
print(f"Created Storage: ID={storage.id}, Name={storage.name}, Location={storage.location_name}")
print(f"Storage address: {storage.address}")
print(f"S3 Access Key: {storage.credentials.s3.access_key}") # type: ignore[union-attr]
print(f"S3 Secret Key: {storage.credentials.s3.secret_key}") # type: ignore[union-attr]

# Display S3 credentials
if storage.access_keys:
print(f"S3 Access Key: {storage.access_keys[0].access_key}")
print(f"S3 Secret Key: {storage.access_keys[0].secret_key}")

print("======================")
return storage.id


def list_storages(*, client: Gcore) -> None:
print("\n=== LIST STORAGES ===")
storages = client.storage.list() # pyright: ignore[reportDeprecated]
for count, storage in enumerate(storages, 1):
for count, storage in enumerate(client.storage.object_storages.list(), 1):
print(
f" {count}. Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
f" {count}. Storage: ID={storage.id}, Name={storage.name}, Location={storage.location_name}, Status={storage.provisioning_status}"
)
print("=====================")


def get_storage(*, client: Gcore, storage_id: int) -> None:
print("\n=== GET STORAGE ===")
storage = client.storage.get(storage_id=storage_id) # pyright: ignore[reportDeprecated]
storage = client.storage.object_storages.get(storage_id=storage_id)
print(
f"Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
f"Storage: ID={storage.id}, Name={storage.name}, Location={storage.location_name}, Status={storage.provisioning_status}"
)
print(f"Address: {storage.address}, Created: {storage.created_at}, Can Restore: {storage.can_restore}")
print(f"Address: {storage.address}, Created: {storage.created_at}")
print("===================")


def update_storage(*, client: Gcore, storage_id: int) -> None:
print("\n=== UPDATE STORAGE ===")
storage = client.storage.update( # pyright: ignore[reportDeprecated]
storage_id=storage_id,
expires="30 days",
)
print(f"Updated Storage: ID={storage.id}, Expires: {storage.expires}")
print("======================")


def delete_storage(*, client: Gcore, storage_id: int) -> None:
print("\n=== DELETE STORAGE ===")
client.storage.delete(storage_id=storage_id) # pyright: ignore[reportDeprecated]
client.storage.object_storages.delete(storage_id=storage_id)
print(f"Storage {storage_id} deleted successfully")
print("======================")

Expand Down
41 changes: 16 additions & 25 deletions examples/storage/basic_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,52 @@ async def main() -> None:
storage_id = await create_storage(client=gcore)
await list_storages(client=gcore)
await get_storage(client=gcore, storage_id=storage_id)
await update_storage(client=gcore, storage_id=storage_id)
await delete_storage(client=gcore, storage_id=storage_id)


async def create_storage(*, client: AsyncGcore) -> int:
print("\n=== CREATE STORAGE ===")
name = f"example-s3-storage-{int(time.time())}"
storage = await client.storage.create( # pyright: ignore[reportDeprecated]
name = f"s3-basic-{int(time.time())}"
storage = await client.storage.object_storages.create(
name=name,
type="s3_compatible",
location="s-ed1",
location_name="s-ed1",
)
print(f"Created Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}")
print(f"Created Storage: ID={storage.id}, Name={storage.name}, Location={storage.location_name}")
print(f"Storage address: {storage.address}")
print(f"S3 Access Key: {storage.credentials.s3.access_key}") # type: ignore[union-attr]
print(f"S3 Secret Key: {storage.credentials.s3.secret_key}") # type: ignore[union-attr]

# Display S3 credentials
if storage.access_keys:
print(f"S3 Access Key: {storage.access_keys[0].access_key}")
print(f"S3 Secret Key: {storage.access_keys[0].secret_key}")

print("======================")
return storage.id


async def list_storages(*, client: AsyncGcore) -> None:
print("\n=== LIST STORAGES ===")
storages = client.storage.list() # pyright: ignore[reportDeprecated]
count = 1
async for storage in storages:
async for storage in client.storage.object_storages.list():
print(
f" {count}. Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
f" {count}. Storage: ID={storage.id}, Name={storage.name}, Location={storage.location_name}, Status={storage.provisioning_status}"
)
count += 1
print("=====================")


async def get_storage(*, client: AsyncGcore, storage_id: int) -> None:
print("\n=== GET STORAGE ===")
storage = await client.storage.get(storage_id=storage_id) # pyright: ignore[reportDeprecated]
storage = await client.storage.object_storages.get(storage_id=storage_id)
print(
f"Storage: ID={storage.id}, Name={storage.name}, Type={storage.type}, Location={storage.location}, Status={storage.provisioning_status}"
f"Storage: ID={storage.id}, Name={storage.name}, Location={storage.location_name}, Status={storage.provisioning_status}"
)
print(f"Address: {storage.address}, Created: {storage.created_at}, Can Restore: {storage.can_restore}")
print(f"Address: {storage.address}, Created: {storage.created_at}")
print("===================")


async def update_storage(*, client: AsyncGcore, storage_id: int) -> None:
print("\n=== UPDATE STORAGE ===")
storage = await client.storage.update( # pyright: ignore[reportDeprecated]
storage_id=storage_id,
expires="30 days",
)
print(f"Updated Storage: ID={storage.id}, Expires: {storage.expires}")
print("======================")


async def delete_storage(*, client: AsyncGcore, storage_id: int) -> None:
print("\n=== DELETE STORAGE ===")
await client.storage.delete(storage_id=storage_id) # pyright: ignore[reportDeprecated]
await client.storage.object_storages.delete(storage_id=storage_id)
print(f"Storage {storage_id} deleted successfully")
print("======================")

Expand Down
Loading
Loading