Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
26b81bd
feat(api): aggregated API specs update
stainless-app[bot] Jun 17, 2025
f60c2f4
codegen metadata
stainless-app[bot] Jun 17, 2025
fbe3508
chore: format
deferred Jun 17, 2025
a42b974
feat(cloud): add reserved fixed ips examples
algis-dumbris Jun 17, 2025
9010134
feat(cloud): add floating IPs examples
algis-dumbris Jun 17, 2025
5c4f2a5
feat(cloud): add security groups examples
algis-dumbris Jun 17, 2025
85766ca
fix(waap): remove duplicate method for acct overview
stainless-app[bot] Jun 17, 2025
57ddcba
feat(cloud): add volumes examples
algis-dumbris Jun 17, 2025
6634a74
fix(cloud): update tags type for gpu baremetal clusters and images, i…
pedrodeoliveira Jun 17, 2025
c73f5d1
feat(cloud): add load balancers examples (#50)
algis-dumbris Jun 17, 2025
7c3a568
chore(cloud): reorder example functions
deferred Jun 17, 2025
6ba343d
chore(readme): update badges
stainless-app[bot] Jun 18, 2025
3d88ae5
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 18, 2025
5f32d6f
feat(cloud): add networks examples
algis-dumbris Jun 18, 2025
3534bea
fix(cloud): linting on load balancer examples
pedrodeoliveira Jun 18, 2025
1f4c28f
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 19, 2025
c86820e
feat(api): aggregated API specs update
stainless-app[bot] Jun 19, 2025
8b5d094
feat(api): aggregated API specs update
stainless-app[bot] Jun 20, 2025
a983aee
feat(client): add support for aiohttp
stainless-app[bot] Jun 20, 2025
2f728bc
codegen metadata
stainless-app[bot] Jun 23, 2025
1da4aa3
feat(api): update via SDK Studio
stainless-app[bot] Jun 23, 2025
a942886
feat(api): aggregated API specs update
stainless-app[bot] Jun 23, 2025
272ce51
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
96a27dd
feat(api): update via SDK Studio
stainless-app[bot] Jun 24, 2025
054c374
chore(internal): updates
stainless-app[bot] Jun 24, 2025
d4b4f22
feat(api): aggregated API specs update
stainless-app[bot] Jun 23, 2025
4b45142
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
2377589
chore(internal): updates
stainless-app[bot] Jun 24, 2025
e7014a0
Merge remote-tracking branch 'origin/next' into next
stainless-app[bot] Jun 25, 2025
dd87a63
feat(api): aggregated API specs update
stainless-app[bot] Jun 25, 2025
5d70914
codegen metadata
stainless-app[bot] Jun 25, 2025
aba1f63
feat(cloud): add routers examples
algis-dumbris Jun 25, 2025
9374261
codegen metadata
stainless-app[bot] Jun 26, 2025
a38f100
feat(cloud): add instances examples
algis-dumbris Jun 26, 2025
ecc8d91
feat(images): add instance images examples
algis-dumbris Jun 26, 2025
0bf3b18
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
7df32ec
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
b8d8b92
fix(ci): correct conditional
stainless-app[bot] Jun 30, 2025
656485a
codegen metadata
stainless-app[bot] Jun 30, 2025
0441c52
chore(cloud): reorder
deferred Jun 30, 2025
e26746f
chore(cloud): streamline envs in examples
deferred Jun 30, 2025
dc8eca4
codegen metadata
stainless-app[bot] Jul 1, 2025
32446c4
chore(cloud): unify examples format
deferred Jul 1, 2025
24b00fe
refactor!: remove list suitable and list for resize from instance fla…
stainless-app[bot] Jul 1, 2025
2626938
refactor(cloud)!: remove list suitable from bm flavors
stainless-app[bot] Jul 1, 2025
960a44b
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
e781ff5
codegen metadata
stainless-app[bot] Jul 2, 2025
7395880
feat(api): aggregated API specs update
stainless-app[bot] Jul 2, 2025
8dd7ccb
chore(cloud): skip load balancer test statuses
pedrodeoliveira Jul 3, 2025
1507ac3
feat(iam): add IAM
stainless-app[bot] Jul 4, 2025
daf66fc
release: 0.4.0
stainless-app[bot] Jul 4, 2025
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
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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
steps:
- uses: actions/checkout@v4

Expand All @@ -34,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/gcore-python'
build:
if: github.repository == 'stainless-sdks/gcore-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand All @@ -62,6 +77,7 @@ jobs:
timeout-minutes: 10
name: test
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
steps:
- uses: actions/checkout@v4

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.3.0"
".": "0.4.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: 302
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-b5883594159ef5544fde3856674f72adc1000c03aaf48ec8b7ba7ca9b128c66d.yml
openapi_spec_hash: beacedf1517348ed0158b7d9f530fc62
config_hash: 62229a7a78ca1c79cb7cf61752a8df7e
configured_endpoints: 309
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-a3eb777ed002489583f1ec680d7ac5638c4bf54a843d381a1c1ad5d1c9f5e967.yml
openapi_spec_hash: 3e4993495b21ba44b2969cc41cdb1221
config_hash: 708e4dbf0025978d06dedb02b94647a3
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
# Changelog

## 0.4.0 (2025-07-04)

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

### ⚠ BREAKING CHANGES

* **cloud:** remove list suitable from bm flavors
* remove list suitable and list for resize from instance flavors

### Features

* **api:** aggregated API specs update ([7395880](https://github.com/G-Core/gcore-python/commit/7395880c1291632db977714b43de1ab7061c23ed))
* **api:** aggregated API specs update ([dd87a63](https://github.com/G-Core/gcore-python/commit/dd87a630497b9dd478330bb190920da41fc6b6da))
* **api:** aggregated API specs update ([d4b4f22](https://github.com/G-Core/gcore-python/commit/d4b4f221489c1047b8e92752a1da014f1af59af9))
* **api:** aggregated API specs update ([a942886](https://github.com/G-Core/gcore-python/commit/a9428867b76afd4e3e0adb5892c007c3b8922fca))
* **api:** aggregated API specs update ([8b5d094](https://github.com/G-Core/gcore-python/commit/8b5d094f732e0c5f236f8bfc32fe069a6fd412ed))
* **api:** aggregated API specs update ([c86820e](https://github.com/G-Core/gcore-python/commit/c86820e1ca68185902d8e5e3cb911fca6d4dc10b))
* **api:** aggregated API specs update ([26b81bd](https://github.com/G-Core/gcore-python/commit/26b81bdeb1d84c2bc72a34e046db8fb1b1e5fcd1))
* **api:** update via SDK Studio ([96a27dd](https://github.com/G-Core/gcore-python/commit/96a27dd845f5fe9128b111171feb6c065f0c2916))
* **api:** update via SDK Studio ([1da4aa3](https://github.com/G-Core/gcore-python/commit/1da4aa370b1e633b002e1be99b7c5f3cf785ebc7))
* **client:** add support for aiohttp ([a983aee](https://github.com/G-Core/gcore-python/commit/a983aee8dd4ddf7d111f4798c89cfd3f341568d4))
* **cloud:** add floating IPs examples ([9010134](https://github.com/G-Core/gcore-python/commit/90101344d7fdf1ba0c8f55bc290ffe7839cb6af0))
* **cloud:** add instances examples ([a38f100](https://github.com/G-Core/gcore-python/commit/a38f10024534ab8c65ff72e96f49100bfaeb17a1))
* **cloud:** add load balancers examples ([#50](https://github.com/G-Core/gcore-python/issues/50)) ([c73f5d1](https://github.com/G-Core/gcore-python/commit/c73f5d1b84dbd2c96c9383100a93c89c8cf5e498))
* **cloud:** add networks examples ([5f32d6f](https://github.com/G-Core/gcore-python/commit/5f32d6f75aec5a7ff33729c65984f8b171910f8b))
* **cloud:** add reserved fixed ips examples ([a42b974](https://github.com/G-Core/gcore-python/commit/a42b974dde0d61edd9efa8f5929c0cbd967eebf8))
* **cloud:** add routers examples ([aba1f63](https://github.com/G-Core/gcore-python/commit/aba1f6343d40a6c6181929923b80a31d0bae332c))
* **cloud:** add security groups examples ([5c4f2a5](https://github.com/G-Core/gcore-python/commit/5c4f2a57603a5940c13220770e363c1e597ec48d))
* **cloud:** add volumes examples ([57ddcba](https://github.com/G-Core/gcore-python/commit/57ddcba83e1664b765c1c16e9ee314f6af74c38b))
* **iam:** add IAM ([1507ac3](https://github.com/G-Core/gcore-python/commit/1507ac37f5d588a999880cf5f51c94293f65b039))
* **images:** add instance images examples ([ecc8d91](https://github.com/G-Core/gcore-python/commit/ecc8d91c94df8c09ab4aeb5f89c966f03924caed))


### Bug Fixes

* **ci:** correct conditional ([b8d8b92](https://github.com/G-Core/gcore-python/commit/b8d8b9275a3c0d0864cfbd0d396a68cfd07c0b7b))
* **ci:** release-doctor — report correct token name ([0bf3b18](https://github.com/G-Core/gcore-python/commit/0bf3b1850e85aa8d9b635dcee9aeaf416f35df6c))
* **cloud:** linting on load balancer examples ([3534bea](https://github.com/G-Core/gcore-python/commit/3534beaed71a9fb5fe61df6a8b9aa76b9c3913c8))
* **cloud:** update tags type for gpu baremetal clusters and images, instances, load balancers ([6634a74](https://github.com/G-Core/gcore-python/commit/6634a74d3106f25476bd6bce98d12249f07dd8a6))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([3d88ae5](https://github.com/G-Core/gcore-python/commit/3d88ae5a7df41b7e9e88d0520a9586c1240da54c))
* **waap:** remove duplicate method for acct overview ([85766ca](https://github.com/G-Core/gcore-python/commit/85766ca7a1a3848cf6e252a55d7cc7ef384a4f94))


### Chores

* **ci:** change upload type ([960a44b](https://github.com/G-Core/gcore-python/commit/960a44ba2f255ad2bf8f571de381b06e5f1fffbd))
* **ci:** only run for pushes and fork pull requests ([7df32ec](https://github.com/G-Core/gcore-python/commit/7df32eca9f58a777487a2d00e2bfd41ccdd6a518))
* **cloud:** reorder ([0441c52](https://github.com/G-Core/gcore-python/commit/0441c52c6407e2ae427b70fdd22881bde8ea8191))
* **cloud:** reorder example functions ([7c3a568](https://github.com/G-Core/gcore-python/commit/7c3a5683c8482ca7398e6863c77fdae350b3e711))
* **cloud:** skip load balancer test statuses ([8dd7ccb](https://github.com/G-Core/gcore-python/commit/8dd7ccb677a41455d0c3ee6407e21271485669aa))
* **cloud:** streamline envs in examples ([e26746f](https://github.com/G-Core/gcore-python/commit/e26746fd50a2fee2157c88244b737352f07dd55c))
* **cloud:** unify examples format ([32446c4](https://github.com/G-Core/gcore-python/commit/32446c4e9bb385f68b0a24637f731ff93ee0eb5a))
* format ([fbe3508](https://github.com/G-Core/gcore-python/commit/fbe3508482950455f4ccd02b6941bb0273b2fdf6))
* **internal:** updates ([2377589](https://github.com/G-Core/gcore-python/commit/237758929ed119a1780c5a0cf9d60c72f6c70b8a))
* **internal:** updates ([054c374](https://github.com/G-Core/gcore-python/commit/054c374d0b02ec85d6702ecfded1362e827cf655))
* **readme:** update badges ([6ba343d](https://github.com/G-Core/gcore-python/commit/6ba343d802d353c4df42e4e7f6cc4f693fe9734a))
* **tests:** skip some failing tests on the latest python versions ([4b45142](https://github.com/G-Core/gcore-python/commit/4b45142d7fe138a5f0a030bdd27f9de26df533b9))
* **tests:** skip some failing tests on the latest python versions ([272ce51](https://github.com/G-Core/gcore-python/commit/272ce51ed26d568e181dee26205448d35184e015))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([1f4c28f](https://github.com/G-Core/gcore-python/commit/1f4c28f252df42a703a60ed2901391167296ecc7))


### Refactors

* **cloud:** remove list suitable from bm flavors ([2626938](https://github.com/G-Core/gcore-python/commit/262693876592601fa5a07dd088033037c7eae9b6))
* remove list suitable and list for resize from instance flavors ([24b00fe](https://github.com/G-Core/gcore-python/commit/24b00fec390f141457c98334b302dab5a8b1d480))

## 0.3.0 (2025-06-17)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/G-Core/gcore-python/compare/v0.2.0...v0.3.0)
Expand Down
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gcore Python API library

[![PyPI version](https://img.shields.io/pypi/v/gcore.svg)](https://pypi.org/project/gcore/)
[![PyPI version](<https://img.shields.io/pypi/v/gcore.svg?label=pypi%20(stable)>)](https://pypi.org/project/gcore/)

The Gcore Python library provides convenient access to the Gcore REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -68,6 +68,40 @@ asyncio.run(main())

Functionality between the synchronous and asynchronous clients is otherwise identical.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install gcore[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from gcore import DefaultAioHttpClient
from gcore import AsyncGcore


async def main() -> None:
async with AsyncGcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
project = await client.cloud.projects.create(
name="New Project",
)
print(project.id)


asyncio.run(main())
```

## Using types

Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
Expand Down Expand Up @@ -252,7 +286,7 @@ client.with_options(max_retries=5).cloud.projects.create(
### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from gcore import Gcore
Expand Down
Loading
Loading