An example of connecting to your local LXD daemon.
Last active
June 7, 2018 19:16
-
-
Save AdamIsrael/02f07ff622b93faf0c1d9904ccdd0bba to your computer and use it in GitHub Desktop.
pylxd testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from pylxd import Client | |
import os | |
# Use the cert generated the first time `lxc list` is run. | |
crt = os.path.expanduser('~/.config/lxc/client.crt') | |
key = os.path.expanduser('~/.config/lxc/client.key') | |
client = Client( | |
endpoint="https://127.0.0.1:8443", | |
cert=(crt, key), | |
verify=False, | |
) | |
containers = client.containers.all() | |
print(containers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lxd version: 3.1