Skip to main content

Asynchronous client library for LXD REST API

Project description

Latest Version Build Status Coverage Status

asyncLXD is an asyncio-based client library for the the LXD REST API.

It provides an high level API to interact with resources on LXD servers, such as containers, images, networks, profiles and storage.

LXD servers are accessible through the asynclxd.remote.Remote class, which exposes server details and configuration, as well as access to resource collections.

Collections (such as containers, images, profiles, networks, …) allow creating and fetching resources, which can be modified, updated or deleted.

For example:

from pprint import pprint

from asynclxd import lxc

# get all remotes defined in the client config
remotes = lxc.get_remotes()
async with remotes['local'] as remote:
    # fetch all images and print their details
    resp = await remote.images.read()
    for image in resp:
        resp = await image.read()
        pprint(resp.metadata)
        # image details have been read, now they're also cached (same
        # output as above)
        pprint(image.details())

    # fetch a single container by name
    container = await remote.containers.get('c')
    pprint(container.details())
    # rename it
    await container.rename('new-c')
    # change some details
    await container.update({'description': 'foo'})
    # and now delete it
    await container.delete()

Project details


Release history Release notifications

Download files

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

Files for asynclxd, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size asynclxd-0.0.1.tar.gz (27.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page