Alex Savatieiev | ec70369 | 2019-06-07 15:33:31 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | if [[ -z ${token+x} ]]; then |
| 3 | export token=$(openstack token issue -c id -f value) |
| 4 | echo "# Exported token: ${token}" |
| 5 | fi |
| 6 | if [[ -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}" |
| 9 | fi |
| 10 | poke_uri=$(echo ${1/project_id/$project_id}) |
| 11 | echo "# Input uri is ${1}" |
| 12 | echo "[$(date +'%H:%M:%S')] -> '${poke_uri}'" |
| 13 | curl -sH "X-Auth-Token: ${token}" ${poke_uri} | python -m json.tool |