Openstack rest api -- create token

1.使用RestClient获取openstack token

POST http://ip:5000/v2.0/tokens
Header:
Content-Type:applicatoin/json
Accept:application/json

Body:
String Body

{
"auth":{
"passwordCredentials":{
"username":"admin",
"password":"secrete"
},
"tenantName":"admin"
}
}

2.获取instance信息

GET  http://ip:8774/v2/8fd3da375dc2418caa668db87cc20822/servers
Header:
X-Auth-Token:a4a1da32ad3046a885caa4ca8fabf878
Auth:
username:admin
pass:secrete

你可能感兴趣的:(openstack)