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/).

Pure httpx — no Django dependency. 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.0.tar.gz (22.2 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.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: intelion_cloud-0.2.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for intelion_cloud-0.2.0.tar.gz
Algorithm Hash digest
SHA256 58b1e27c7d09b6e42a659a686964902e820ddd785391d7c5c2f9afa7c492d5bd
MD5 070889213445a545078f8f8519d181c2
BLAKE2b-256 82b7f43e8144addd7b4ddfe6d9b8fc1598bcdf7b4ad7eacaf1eb659bfeb54d20

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for intelion_cloud-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a88a5c9c8db452cecffef8bbde1b19477bc7936abe597de336703ee0bab6e751
MD5 2648d9be9f2807b5e1612b463ea44240
BLAKE2b-256 fa53eaf28b20f7a03002222384e529e37256daaedd910efe166f2a9f319aaabd

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