Gary Wu | a867833 | 2017-10-19 12:39:19 -0700 | [diff] [blame] | 1 | #!/bin/sh |
2 | # Get floating IP assigned to a server name | ||||
3 | |||||
4 | PORT_ID=$(openstack server show -f json $1 | python -c 'import sys, json; print json.load(sys.stdin)["wrs-if:nics"][0]["nic1"]["port_id"]') | ||||
5 | FLOATING_IP=$(openstack floating ip list -f json --port $PORT_ID | python -c 'import sys, json; print json.load(sys.stdin)[0]["Floating IP Address"]') | ||||
6 | echo $FLOATING_IP |