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


Download files

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

Source Distribution

asynclxd-0.0.1.tar.gz (27.6 kB view hashes)

Uploaded Source

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