maas-api-0.1.1
توضیحات
An api client library for MAAS.io
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | maas-api-0.1.1 |
| نام | maas-api |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jelle Helsen |
| ایمیل نویسنده | jelle.helsen@hcode.be |
| آدرس صفحه اصلی | https://github.com/jellehelsen/maas-api |
| آدرس اینترنتی | https://pypi.org/project/maas-api/ |
| مجوز | - |
# Table of Contents
1. [Quickstart](#orgc1e985f)
1. [Installing](#org8a0e592)
2. [Using](#org155b2b6)
2. [Why?](#org5d3a245)
3. [How?](#orgfb84d69)
<a id="orgc1e985f"></a>
# Quickstart
<a id="org8a0e592"></a>
## Installing
You can install using pip.
pip install maas-api
<a id="org155b2b6"></a>
## 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"])
<a id="org5d3a245"></a>
# Why?
The official MAAS api client library [python-libmaas](https://pypi.org/project/python-libmaas/) did not receive any new
functionality that is available with MAAS.
There is however a [CLI](https://github.com/maas/maas/tree/master/src) written in python. This allows all the functionality to
be used.
<a id="orgfb84d69"></a>
# How?
By using the same technique as the official CLI. By using the API description
available at [/MAAS/api/2.0/describe](file:///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.
نیازمندی
| مقدار | نام |
|---|---|
| >=2.26,<3.0 | requests |
| >=1.3,<2.0 | requests-oauthlib |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9,<4.0 | Python |
نحوه نصب
نصب پکیج whl maas-api-0.1.1:
pip install maas-api-0.1.1.whl
نصب پکیج tar.gz maas-api-0.1.1:
pip install maas-api-0.1.1.tar.gz