记录一些常用的 OpenStack client 命令,以备后查。

Keystone

获取 token

curl -X POST http://192.168.1.100:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "ceilometer", "password":"<ceilometer-pwd>"}, "tenantName":"service"}}' -H "Content-type: application/json"

Neutron

获取 port

curl -g -i -X GET http://192.168.1.100:9696/v2.0/ports.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: <token-key>"

Ceilometer

获取 ceilometer sample

curl -g -i -X 'GET' 'http://192.168.1.100:8777/v2/samples?limit=1' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'X-Auth-Token: <token-key>'

完毕。