Skip to main content

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.actions import delete
from pyawx.models.jobs import JobTemplate

client = Client("https://awx.mycompany.com", username="me", password="password")

job_template = client.get_data(JobTemplate)[0]

delete(job_template)
client.add(job_template)
client.commit()

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

pyawx-client-0.1.1.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyawx_client-0.1.1-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file pyawx-client-0.1.1.tar.gz.

File metadata

  • Download URL: pyawx-client-0.1.1.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for pyawx-client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 45e1d80135fb22eacd2e0c92bf2288490b443fb2d119e55f20f527e6bfc43d9b
MD5 5a2815d75bffcde10e241badbd48d453
BLAKE2b-256 86c3ef16526fe6b52aa640e22a63941a08c537df1ac11654fae85b8ce5d95448

See more details on using hashes here.

File details

Details for the file pyawx_client-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyawx_client-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for pyawx_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27cc1107fff2038e7755941885c8b3b7c360b6de33ec905c7dc120af3a1e3a78
MD5 d2c7de9c3687c4de57f1457001f295c5
BLAKE2b-256 d955e62f79792d9a6905dc6a57fb32c32ca58da51bac54bafee386c2f93f2d20

See more details on using hashes here.

Supported by

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