Alex Savatieiev | 8cabb34 | 2020-08-25 09:09:25 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ol1 is short for openstack list with 1 param. Also grep and cut |
| 3 | # "ol1 network public" will list all networks, grep by name public and return IDs |
| 4 | function olcID1() { echo $(openstack $1 list $2 -c ID -f value | wc -l); } |
| 5 | # same as ol1 but with 2 initial commands before list |
| 6 | function olcID2() { echo $(openstack $1 $2 list $3 -c ID -f value | wc -l); } |
| 7 | function olc2() { echo $(openstack $1 $2 list $4 -c $3 -f value | wc -l); } |
| 8 | |
| 9 | echo "### Cloud totals" |
| 10 | printf "Projects:\t%s\n" $(olcID1 project) |
| 11 | printf "Users:\t\t%s\n" $(olcID1 user) |
| 12 | printf "Flavors:\t%s\n" $(olcID1 flavor) |
| 13 | printf "Zones:\t\t%s\n" $(openstack availability zone list -c "Zone Name" -f value | sort | uniq | wc -l) |
| 14 | printf "Servers:\t%s\n" $(olcID1 server --all) |
| 15 | printf "Networks:\t%s\n" $(olcID1 network) |
| 16 | printf "Subnets:\t%s\n" $(olcID1 subnet) |
| 17 | printf "Ports:\t\t%s\n" $(olcID1 port) |
| 18 | printf "Volumes:\t%s\n" $(olcID1 volume --all) |
| 19 | printf "Snapshots:\t%s\n" $(olcID2 volume snapshot --all) |
| 20 | printf "Images:\t\t%s\n" $(olcID1 image) |
| 21 | |