Aruba ClearPass : enregistrer un équipement par l'API REST
Automatisez l'enregistrement des imprimantes dans ClearPass (https://cppm.acme.test/api) avec le client API ops-automation (flux client credentials).
- Écrivez
~/travail/oauth.json:{"grant_type": "client_credentials", "client_id": "ops-automation", "client_secret": "Lab-Secr3t-2026"}et protégez-le :chmod 600 oauth.json - Jeton :
curl -sk -X POST https://cppm.acme.test/api/oauth -H "Content-Type: application/json" -d @oauth.json(depuis~/travail) → durée de validité en secondes →answer duree <n> - Écrivez
~/travail/endpoint.json:mac_address=00-1b-63-84-45-e6,status=Known,description=Imprimante RDC - Création :
curl -sk -X POST https://cppm.acme.test/api/endpoint -H "Authorization: Bearer <jeton>" -H "Content-Type: application/json" -d @endpoint.json - Vérification :
curl -sk https://cppm.acme.test/api/endpoint/mac-address/001b638445e6 -H "Authorization: Bearer <jeton>"→ identifiant attribué →answer id <n>
Contenu Premium
Ce contenu est inclus dans l'offre Premium. Le titre et le résumé restent visibles pour vous aider à choisir.
Tâches
- Fichier d'identifiants protégé
- Jeton obtenu
- Imprimante enregistrée et vérifiée