Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertodonato/asynclxd
Asynchronous client library for the LXD API
https://github.com/albertodonato/asynclxd
async asyncio lxd rest-api
Last synced: 6 days ago
JSON representation
Asynchronous client library for the LXD API
- Host: GitHub
- URL: https://github.com/albertodonato/asynclxd
- Owner: albertodonato
- License: lgpl-3.0
- Created: 2018-03-24T11:25:02.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-05-09T09:24:56.000Z (over 3 years ago)
- Last Synced: 2024-11-08T02:19:06.802Z (11 days ago)
- Topics: async, asyncio, lxd, rest-api
- Language: Python
- Homepage:
- Size: 159 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
======================================================
asyncLXD - Asynchronous client library for the LXD API
======================================================|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:
.. code:: python
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().. _LXD: https://linuxcontainers.org/lxd/
.. |Latest Version| image:: https://img.shields.io/pypi/v/asynclxd.svg
:alt: Latest Version
:target: https://pypi.python.org/pypi/asynclxd
.. |Build Status| image:: https://github.com/albertodonato/asynclxd/workflows/CI/badge.svg
:alt: Build Status
:target: https://github.com/albertodonato/asynclxd/actions?query=workflow%3ACI
.. |Coverage Status| image:: https://img.shields.io/codecov/c/github/albertodonato/asynclxd/main.svg
:alt: Coverage Status
:target: https://codecov.io/gh/albertodonato/asynclxd
.. |Documentation| image:: https://readthedocs.org/projects/asynclxd/badge/?version=stable
:alt: Documentation
:target: https://asynclxd.readthedocs.io/en/stable/?badge=stable