From a72887896c335c1d7ef212675931e7e6489c1b2f Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Wed, 26 Jun 2024 22:36:46 +0200 Subject: [PATCH] chore(awx): start notes about api --- knowledge base/awx.md | 9 +++++++++ snippets/awx.sh | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 snippets/awx.sh diff --git a/knowledge base/awx.md b/knowledge base/awx.md index c9f6818..93c4fc2 100644 --- a/knowledge base/awx.md +++ b/knowledge base/awx.md @@ -4,6 +4,7 @@ 1. [Removal](#removal) 1. [Testing](#testing) 1. [Create a demo instance](#create-a-demo-instance) +1. [API](#api) 1. [Further readings](#further-readings) 1. [Sources](#sources) @@ -513,6 +514,10 @@ $ minikube kubectl -- delete -f <(minikube kubectl -- kustomize --enable-helm) +## API + +Refer [AWX API Reference] and [How to use AWX REST API to execute jobs]. + ## Further readings - [Website] @@ -532,6 +537,8 @@ $ minikube kubectl -- delete -f <(minikube kubectl -- kustomize --enable-helm) - [Helm install on existing cluster] - [Iterating on the installer without deploying the operator] - [Installer role's defaults] +- [AWX API Reference] +- [How to use AWX REST API to execute jobs] +[awx api reference]: https://ansible.readthedocs.io/projects/awx/en/latest/rest_api/ [awx's documentation]: https://ansible.readthedocs.io/projects/awx/en/latest/ [awx's repository]: https://github.com/ansible/awx/ [basic install]: https://ansible.readthedocs.io/projects/awx-operator/en/latest/installation/basic-install.html @@ -557,3 +565,4 @@ $ minikube kubectl -- delete -f <(minikube kubectl -- kustomize --enable-helm) [arm64 image pulled shows amd64 as its arch]: https://github.com/brancz/kube-rbac-proxy/issues/79#issuecomment-826557647 +[how to use awx rest api to execute jobs]: https://www.dbi-services.com/blog/how-to-use-awx-rest-api-to-execute-jobs/ diff --git a/snippets/awx.sh b/snippets/awx.sh new file mode 100644 index 0000000..10c3440 --- /dev/null +++ b/snippets/awx.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +# List all available endpoints +curl -fs 'https://awx.company.com/api/v2/' | jq '.' - + +# list all jobs +curl -fs --user 'admin:password' 'https://awx.company.com/api/v2/job_templates/' | jq '.' - +curl -fs 'https://awx.company.com/api/v2/job_templates/' | jq '.' -