#!/bin/bash [ -z "${GLORIA_URL}" -o -z "${GLORIA_TOKEN}" ] && return 1 curl_push () { local data=$1 curl -s -H "Accept: application/json" -H "Content-Type:application/json" -X PUT --data $data "${GLORIA_URL}" >/dev/null } push_prepared () { data='{ pilot_token : '${GLORIA_TOKEN}', pilot_status : prepared }' curl_push $data } push_connect () { data='{ pilot_token : '${GLORIA_TOKEN}', pilot_status : vmready, access_info : { socket: '${VM_ACCESS_SOCKET}', username: '${VM_ACCESS_USERNAME}', password: '${VM_ACCESS_PASSWORD}' } }' curl_push $data } push_failed () { msg=$1 data='{ pilot_token : '${GLORIA_TOKEN}', pilot_status : failed, error_string : "'$msg'" }' curl_push $data } push_finished () { data='{ pilot_token : '${GLORIA_TOKEN}', pilot_status : finished }' curl_push $data }