Skip to main content

An api client library for MAAS.io

Project description

Table of Contents

  1. Quickstart
    1. Installing
    2. Using
  2. Why?
  3. How?

Quickstart

Installing

You can install using pip.

pip install maas-api

Using

You can use the api client the same way you would use the CLI.

from maas_api import Client

client = Client("http://192.0.2.10:/MAAS", api_key="your:api:key")

# allocate a machine
machine = client.machines.allocate()
# start deploy
client.machine.deploy(system_id=machine["system_id"])
# release the machine
client.machine.release(system_id=machine["system_id"])

Why?

The official MAAS api client library python-libmaas did not receive any new functionality that is available with MAAS. There is however a CLI written in python. This allows all the functionality to be used.

How?

By using the same technique as the official CLI. By using the API description available at /MAAS/api/2.0/describe. This allows us to expose the full API exposed by the MAAS server and to keep functional parity with the CLI.

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

maas-api-0.1.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

maas_api-0.1.1-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page