Python MaaS and Juju toolkit
Project description
pyjamaas
Python Juju and MaaS toolkit.
Features
pyjamaas
simplifies interaction with MaaS and Juju when working with a large number of heterogenous machines. It heavily utilizes the MaaS tags mechanism.
Features:
pyjamaas tags
: Easily create, delete and update multiple tags for multiple machinespyjamaas clone
: Easily clone configuration to multiple machines, using tagspyjamaas machine
: Utility commands for retrieving machine information
Also see examples
Installation
$ pip install pyjamaas
Configuration
pyjamaas
needs MaaS credentials. You can use environment variables:
$ export MAAS_API_URL=https://maas.server.name:5240/MAAS/api/2.0
$ export MAAS_API_KEY=AAAAAAAAAAAAAA:BBBBBBBBBBBBBBB:CCCCCCCCCCCCCCC
Or create a pyjamaas.conf
file (see sample):
[maas]
api_url = https://maas.server.name:5240/MAAS/api/2.0
api_key = AAAAAAAAAAAAAA:BBBBBBBBBBBBBBB:CCCCCCCCCCCCCCC
$ pyjamaas <command> --config-file pyjamaas.conf
pyjamaas
will automatically look for config files in a few standard directories, e.g. /etc/pyjamaas.conf
, /etc/pyjamaas/pyjamaas.conf
, ~/.pyjamaas/pyjamaas.conf
).
Print loaded configuration with pyjamaas config
. If a required option is missing, an error message is printed:
$ pyjamaas config
value required for option api_key in group [maas]
Usage
For a list of available commands:
$ pyjamaas --help
Most pyjamaas
commands have the format pyjamaas <command> <args> --match <filter>
. The <filter>
can be used to select machines based on system_id
, hostname
, or tags
. The examples below should be clear enough:
# Match a single machine using hostname
$ pyjamaas machine list --match '{hostname: host1}'
# Match multiple machines by hostname
$ pyjamaas machine list --match '{hostname: [host1, host2]}'
# Match multiple machines by system id
$ pyjamaas machine list --match '{system_id: [system1, system2]}'
# Match machines using tags (multiple tags imply AND)
$ pyjamaas machine list --match '{tags: [tag1, tag2]}'
Auto completion
Enable auto-completion with:
$ . <(pyjamaas complete)
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
Built Distribution
File details
Details for the file pyjamaas-0.6.tar.gz
.
File metadata
- Download URL: pyjamaas-0.6.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e4fb861bc8d3516f3186bf55ac9531d802a17c4dd5cfcae0912c76d03a6ccf7 |
|
MD5 | 07869ed946bb151e12b51b6efc4f5222 |
|
BLAKE2b-256 | 2f0a9298b89da77b57dee50a9534e71ad55f3e23a77ea832f3d7f06aa5fa9b90 |
File details
Details for the file pyjamaas-0.6-py3-none-any.whl
.
File metadata
- Download URL: pyjamaas-0.6-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5cf5d01e2638006b7165f87c3f0916b5a14a19f8b346f077cc1440ec3917741 |
|
MD5 | cbb399fff42f6da59be5f2ee213f35b4 |
|
BLAKE2b-256 | eaa6d702057647fce48510e29ffb5e9831c781d8acce5d49590baef2c59ecf50 |