diff options
Diffstat (limited to 'jjb/common/include-agl-get-cost.sh')
-rw-r--r-- | jjb/common/include-agl-get-cost.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jjb/common/include-agl-get-cost.sh b/jjb/common/include-agl-get-cost.sh new file mode 100644 index 00000000..d9ca9725 --- /dev/null +++ b/jjb/common/include-agl-get-cost.sh @@ -0,0 +1,17 @@ +echo "########## Job cost (estimate) ############" + +set +e +#set -x +# Retrieve the current uptime (in seconds) +uptime=$(awk '{print $1}' /proc/uptime) +# Convert to integer by truncating fractional part' and round up by one +((uptime=${uptime%\.*}+1)) +instance_type=$(curl -s http://169.254.169.254/latest/meta-data/instance-type | sed -e "s#-iops##g") +#echo "INFO: Retrieving Pricing Info for: $instance_type" +url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime" +#echo "url=$url" +json_block=$(curl -s "$url") +echo "$json_block" + +set -e +echo "########## Job cost (estimate) ############" |