Python API to access Ansible AWX/Tower v2 API
Project description
pyawx-client
A python library for interacting with Ansible AWX instances
Installation
You can install from pypi using pip
bash pip install pyawx-client
Usage
AWX provides an API v2 for interacting with it. Most of the API is supported but keep in mind this is in alpha and not everything will be built yet
The Client object sort of works in the idea of SQLAlchemy... at least for now.
Also, please be aware that models, or the python API could change since this project is still in Apha.
Get a list of Jobs
from pyawx import Client
from pyawx.models.jobs import Job
client = Client("https://awx.mycompany.com", username="me", password="password")
jobs = client.get_data(Job)
Create a job template
from pyawx import Client
from pyawx.models.jobs import JobTemplate
client = Client("https://awx.mycompany.com", username="me", password="password")
new_job = JobTemplate(name="My Job", description="Do some stuff", project=1)
client.add(new_job)
client.commit()
Delete a job template
from pyawx import Client
from pyawx.models.jobs import JobTemplate
client = Client("https://awx.mycompany.com", username="me", password="password")
job_template = client.get_data(JobTemplate)[0]
client.delete(job_template)
client.commit()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyawx-client-0.2.0.tar.gz
(36.7 kB
view hashes)
Built Distribution
Close
Hashes for pyawx_client-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53458ed919a9be5af4db63d73d405a7ada267f4f259bdfcebd9d32e31b5878c4 |
|
MD5 | 457039803697ccb4a0b7931cd50f2355 |
|
BLAKE2b-256 | 7c7819f3affe9aefd9b56a7753391635eff616d698a389d6b24ac2a71206c5b3 |