Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIRECTOR REST API :
- CREATE THIS SCRIPT :
- ##Script with 3 arguments to talk to REST API of Director
- director-curl.sh
- #!/bin/bash
- METHOD=$1
- URL="$2"
- BODY="$3"
- USERNAME="demo"
- PASSWORD="***"
- test -z "$PASSWORD" || USERNAME="$USERNAME:$PASSWORD"
- test -z "$BODY" && curl -u "$USERNAME" \
- -i http://monitoring.in.ama.bzh/icingaweb2/$URL \
- -H 'Accept: application/json' \
- -X $METHOD
- test -z "$BODY" || curl -u "$USERNAME" \
- -i http://monitoring.in.ama.bzh/icingaweb2/$URL \
- -H 'Accept: application/json' \
- -X $METHOD \
- -d "$BODY"
- echo
- HERE IS AN EXAMPLE
- ./director-curl.sh GET director/host?name=ocs.in.localdomain
- ./director-curl.sh POST director/host '{"object_name": "host2", "... }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement