Skip to main content

Python client for the Intelion Cloud API

Project description

Intelion Cloud Python Client

PyPI Python License

Official Python SDK for the Intelion Cloud GPU cloud API (/api/v2/).

Sync and async clients, typed dataclass models, automatic pagination, retries with exponential backoff.

Install

pip install intelion-cloud

Requires Python 3.9+.

Quickstart

from intelion_cloud import IntelionCloud

client = IntelionCloud(token="your_api_token")

# List your cloud servers
for server in client.cloud_servers.list():
    print(server.id, server.name, server.status)

# Start / stop a server
client.cloud_servers.start(server_id=42)
client.cloud_servers.stop(server_id=42)

# Create a new server
new_server = client.cloud_servers.create(
    name="my-h100-box",
    flavor_id=1,          # FlavorConfig PK
    ssd_count=100,        # network disk size, GB (min 30)
    os_id=1,              # OperationalSystemImage PK
    price_plan=0,         # 0 = hourly, 1 = monthly, ...
)

client.close()

Async client

import asyncio
from intelion_cloud import AsyncIntelionCloud

async def main():
    async with AsyncIntelionCloud(token="your_api_token") as client:
        me = await client.users.me()
        print(me.username, me.current_balance_rub_cents)

asyncio.run(main())

Context manager

with IntelionCloud(token="...") as client:
    servers = client.cloud_servers.list()

Available resources

Resource Methods
client.cloud_servers list(), get(), create(), update(), start(), stop(), reboot(), delete(), get_status(), get_password(), clone(), migrate()
client.flavors list()
client.os_images list(flavor_id=, gpu_id=)
client.users me(), get(), update()

Authentication

Get your API token from the Intelion Cloud dashboard. The client sends it as Authorization: Token {token}.

Error handling

from intelion_cloud import (
    AuthenticationError, NotFoundError, ConflictError,
    RateLimitError, ValidationError, ServerError,
)

try:
    server = client.cloud_servers.get(999)
except NotFoundError:
    print("Server not found")
except AuthenticationError:
    print("Invalid token")
except ValidationError as e:
    print("Field errors:", e.field_errors)

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intelion_cloud-0.2.1.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intelion_cloud-0.2.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file intelion_cloud-0.2.1.tar.gz.

File metadata

  • Download URL: intelion_cloud-0.2.1.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intelion_cloud-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6d3e72010d056dedaf5b6cfa9044c0de52ee5dae4d085c7345f936e969ce73e7
MD5 34e8352416f35304535366745debe970
BLAKE2b-256 a2f0b85704bc14f859ae8f07ee985c1595757833fe0f4c0d92c028173678803f

See more details on using hashes here.

File details

Details for the file intelion_cloud-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: intelion_cloud-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intelion_cloud-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f49b9f1453423d25d5d1fc03c4807ca7601a2f1f03e976e1cc2837fe1aadb08
MD5 e4a8be69fedd2a9a0f812cf5d8ce9b2e
BLAKE2b-256 6d82ec29ebd2e7a074ac596302e46d5b7ce2f1ce3c19cdce0c9a92583a822742

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page