Skip to main content

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 machines
  • pyjamaas clone: Easily clone configuration to multiple machines, using tags
  • pyjamaas 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)

Metadata

Release files for pyjamaas 0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyjamaas 0.6
File Size Uploaded Provenance Actions
pyjamaas-0.6.tar.gz 8.8 kB Without provenance Details for pyjamaas-0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyjamaas 0.6
File Interpreter ABI Platform Actions
pyjamaas-0.6-py3-none-any.whl Python 3 none any Details for pyjamaas-0.6-py3-none-any.whl

Total release size: 38.1 kB

Release files / pyjamaas-0.6.tar.gz

Download URL pyjamaas-0.6.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8e4fb861bc8d3516f3186bf55ac9531d802a17c4dd5cfcae0912c76d03a6ccf7
BLAKE2b-256 checksum
How to use checksums
2f0a9298b89da77b57dee50a9534e71ad55f3e23a77ea832f3d7f06aa5fa9b90
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pyjamaas-0.6-py3-none-any.whl

Download URL pyjamaas-0.6-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5cf5d01e2638006b7165f87c3f0916b5a14a19f8b346f077cc1440ec3917741
BLAKE2b-256 checksum
How to use checksums
eaa6d702057647fce48510e29ffb5e9831c781d8acce5d49590baef2c59ecf50
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for pyjamaas 0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page