Bizarre Hector
exemple
curl -s -u admin:admin https://awx.flemzouille.com:7443/api/v2/hosts/ | jq
affiche la liste des hotes
pour demander un token :
curl -ku admin:admin -H "Content-Type: application/json" -X POST -d '{"description":"Tower CLI", "application":null, "scope":"write"}' https://awx.flemzouille.com:7443/api/v2/users/1/personal_tokens/ | jq -r .token
retourne un token que l'on peut utiliser comme ca sans donc passer le user/mdp
curl -k -H "Authorization: Bearer uJXvHDXopF8uDbLEhrozNg9oPi1FFQ" -H "Content-Type: application/json" '{}' https://awx.flemzouille.com:7443/api/v2/hosts/ | jq
autre exemple
sans parametre : GET et on a toute la liste
curl -k -H "Authorization: Bearer uJXvHDXopF8uDbLEhrozNg9oPi1FFQ" -H "Content-Type: application/json" -X GET https://awx.flemzouille.com:7443/api/v2/inventories/ | jq
avec des parametres :un post et -d {json}
curl -k -H "Authorization: Bearer uJXvHDXopF8uDbLEhrozNg9oPi1FFQ" -H "Content-Type: application/json" -X POST -d '{"name": "localhost","organization": 1}' https://awx.flemzouille.com:7443/api/v2/inventories/ | jq
No comments:
Post a Comment