OpenStack - API

Moki Lv6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cat <<BLOB > token-request.json
{
"auth": {
"scope": {
"system": {
"all": true
}
},
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"domain": {
"id": "default"
},
"name": "admin",
"password": "qwertyuiop1234567890"
}
}
}
}
}
BLOB

export TOKEN="$(curl -si -d @token-request.json -H "Content-type: application/json" http://172.17.1.16:5000/v3/auth/tokens | awk '/x-subject-token/ {print $2}' | tr -d '[:space:]')"
echo "[$TOKEN]"

curl -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" http://172.17.1.16:5000/v3/domains | jq
curl -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" http://172.17.1.16:5000/v3/users | jq
curl -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" http://172.17.1.16:8774/v3/servers | jq
On this page
OpenStack - API