Last active
November 9, 2019 10:38
-
-
Save foursixnine/b0d37109c71671303e5a874f7fdd9556 to your computer and use it in GitHub Desktop.
Restart a job in an openQA instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
MICROTIME=$(date +%s); | |
APIKEY="APIKEY" | |
APISECRET="APISECRET" | |
APIROUTE='/api/v1/jobs/1748061/restart' # Beware if your URL has extra characters | |
# See https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/UserAgent.pm#L78 | |
HMAC=$(echo -n "$APIROUTE$MICROTIME" | openssl dgst -sha1 -mac hmac -macopt key:$APISECRET | awk '{ print $2}'); | |
curl -v \ | |
-X POST \ | |
-D /dev/stderr \ | |
-H "Accept: application/json" \ | |
-H "X-API-Microtime: $MICROTIME" \ | |
-H "X-API-Key: $APIKEY"\ | |
-H "X-API-Hash: $HMAC"\ | |
http://phobos.suse.de/$APIROUTE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@binary-sequence