blob: 70920b91086aea6778000b4cfc9cd15b20818495 [file] [log] [blame]
Alex Savatieievec703692019-06-07 15:33:31 -05001#!/bin/bash
2if [[ -z ${token+x} ]]; then
3 export token=$(openstack token issue -c id -f value)
4 echo "# Exported token: ${token}"
5fi
6if [[ -z ${project_id+x} ]]; then
7 export project_id=$(openstack project list -c ID -c Name -f value | grep ${OS_PROJECT_NAME} | cut -d' ' -f1)
8 echo "# Exported project_id: ${project_id}"
9fi
10poke_uri=$(echo ${1/project_id/$project_id})
11echo "# Input uri is ${1}"
12echo "[$(date +'%H:%M:%S')] -> '${poke_uri}'"
13curl -sH "X-Auth-Token: ${token}" ${poke_uri} | python -m json.tool