python library for lxd
Project description
# pylxd [](https://travis-ci.org/lxc/pylxd)
A Python library for interacting with the LXD REST API.
## Getting started with pylxd
If you're running on Ubuntu Wily or greater:
sudo apt-get install python-pylxd lxd
otherwise you can track LXD development on other Ubuntu releases:
sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master && sudo apt-get update
sudo apt-get install lxd
and install pylxd using pip:
pip install pylxd
## First steps
Once you have pylxd installed, you're ready to start interacting with LXD:
```python
import uuid
from pylxd import api
# Let's pick a random name, avoiding clashes
CONTAINER_NAME = str(uuid.uuid1())
lxd = api.API()
try:
lxd.container_defined(CONTAINER_NAME)
except Exception as e:
print("Container does not exist: %s" % e)
config = {'name': CONTAINER_NAME,
'source': {'type': 'none'}}
lxd.container_init(config)
if lxd.container_defined(CONTAINER_NAME):
print("Container is running")
else:
print("Whoops - please report a bug!")
containers = lxd.container_list()
for x in containers:
lxd.container_destroy(x)
```
## Bug reports
Bug reports can be filed at https://github.com/lxc/pylxd/issues/new
## Support and discussions
We use the LXC mailing-lists for developer and user discussions, you can
find and subscribe to those at: https://lists.linuxcontainers.org
If you prefer live discussions, some of us also hang out in
[#lxcontainers](http://webchat.freenode.net/?channels=#lxcontainers) on irc.freenode.net.
A Python library for interacting with the LXD REST API.
## Getting started with pylxd
If you're running on Ubuntu Wily or greater:
sudo apt-get install python-pylxd lxd
otherwise you can track LXD development on other Ubuntu releases:
sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master && sudo apt-get update
sudo apt-get install lxd
and install pylxd using pip:
pip install pylxd
## First steps
Once you have pylxd installed, you're ready to start interacting with LXD:
```python
import uuid
from pylxd import api
# Let's pick a random name, avoiding clashes
CONTAINER_NAME = str(uuid.uuid1())
lxd = api.API()
try:
lxd.container_defined(CONTAINER_NAME)
except Exception as e:
print("Container does not exist: %s" % e)
config = {'name': CONTAINER_NAME,
'source': {'type': 'none'}}
lxd.container_init(config)
if lxd.container_defined(CONTAINER_NAME):
print("Container is running")
else:
print("Whoops - please report a bug!")
containers = lxd.container_list()
for x in containers:
lxd.container_destroy(x)
```
## Bug reports
Bug reports can be filed at https://github.com/lxc/pylxd/issues/new
## Support and discussions
We use the LXC mailing-lists for developer and user discussions, you can
find and subscribe to those at: https://lists.linuxcontainers.org
If you prefer live discussions, some of us also hang out in
[#lxcontainers](http://webchat.freenode.net/?channels=#lxcontainers) on irc.freenode.net.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylxd-2.0.0.tar.gz
(35.5 kB
view details)
File details
Details for the file pylxd-2.0.0.tar.gz
.
File metadata
- Download URL: pylxd-2.0.0.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4afa732440c83591a2100e0297d33f77bd6df4fd4133cd1a005bcb39ff44bba4
|
|
MD5 |
b40c85f5963360f6b4f553f9d7c6e287
|
|
BLAKE2b-256 |
5f196826b20f27592dde55c5a796f3c57cfbc646676cc5a781c52e75d8fbbba1
|