Skip to main content

AsyncIO Client for Lancium

Project description

Build Status Verification codecov License: MIT Black

aiolancium

aiolancium is a simplistic python REST client for the Lancium Compute REST API utilizing asyncio. The client itself has been developed against the Lancium Compute REST API documentation.

Installation

aiolancium can be installed via PyPi using

pip install aiolancium

How to use aiolancium

from aiolancium.auth import Authenticator
from aiolancium.client import LanciumClient

# Authenticate yourself against the API and refresh your token if necessary
auth = Authenticator(api_key="<your_api_key>")

# Initialise the actual client
client = LanciumClient(api_url="https://portal.lancium.com/api/v1/", auth=auth)

# List details about the `lancium/ubuntu` container
await client.images.list_image("lancium/ubuntu")

# Create your hellow world first job.
job = {"job": {"name": "GridKa Test Job",
                   "qos": "high",
                   "image": "lancium/ubuntu",
                   "command_line": 'echo "Hello World"',
                   "max_run_time": 600}}

await client.jobs.create_job(**job)

# Show all your jobs and their status in Lancium compute
jobs = await client.jobs.show_jobs()

# Delete all your jobs in Lancium compute
for job in jobs["jobs"]:
    await client.jobs.delete_job(id=job["id"])

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

aiolancium-0.1.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

aiolancium-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file aiolancium-0.1.0.tar.gz.

File metadata

  • Download URL: aiolancium-0.1.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Darwin/21.6.0

File hashes

Hashes for aiolancium-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8e36da5573fb2effdc88e819a72af78f847af0efb5b6f65b65460dde76258857
MD5 9c067993d3987ccadc22ae0c0f80f741
BLAKE2b-256 9aa64569b272c62dd40a241002c1a068fb4a1c7f19c304d75e77d0dba385dd0c

See more details on using hashes here.

File details

Details for the file aiolancium-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aiolancium-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Darwin/21.6.0

File hashes

Hashes for aiolancium-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ee0e56d642ddd31580ce9fef3b8b7dba3617bd5a30ead5a9aeb9bec88a435d2
MD5 7d6a46772b321b2088d26c890e19e316
BLAKE2b-256 0a11b327742797d36401eba3780a9f907da67b876b6e883b8eeeeaabec1ac16c

See more details on using hashes here.

Supported by

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