A RESTful API built on Flask to GET
Ansible objects.
This assumes Ansible is running on the host. Refer to the Ansible documentation for more details.
Flask can be ran off a virtual environment. In fact, this is the recommended approach.
-
/api/version
Print API version.
-
/api/methods
Print available API methods.
-
/api/hosts
List hosts and groups in the inventory.
-
/api/groups
List groups in the inventory.
-
/api/listgroups/<host>
List groups based on host.
-
/api/listhosts/<group>
List hosts based on group.
-
/api/<module>/<pattern>
Request allowed module to perform action on host pattern.
-
/api/modules
List all allowed modules.
-
/api/uptime/<pattern>
Get uptime of specified host pattern.
-
/api/is/<status>
List servers according to status
-
setup
Gather useful variables about remote hosts. Returns JSON dict.
-
ping
A trivial test module. Returns
pong
on successful contact.