-
Notifications
You must be signed in to change notification settings - Fork 0
Openstack:VMs from cURL
lbonanomi edited this page Mar 22, 2019
·
2 revisions
First principles, simplest tools.
From https://openstack.whatever_domain.com/horizon/project/access_and_security/ get the "Compute" endpoint
- Fetch a token
curl -i -H 'Content-Type: application/json' -d '{
"auth": {
"identity": {
"methods": [ "password" ],
"password": {
"user": {
"name": "lbonanomi",
"domain": { "name": "Default" },
"password": "LULZ_NO_PASSWORDS" }
}
},
"scope": {
"project": {
"name":"$TENANCY_NAME",
"domain": {
"id": "default"
}
}
}
}
}' https://openstack.$DOMAIN.com:5000/v3/auth/tokens | awk '/X-Subject-Token/ { print $NF }'
- Get 'Flavor' list
curl -s -H 'X-Auth-Token: $FETCHED_TOKEN' https://$COMPUTE_ENDPOINT/flavors | python -m json.tool
- Get ISO
curl -H 'Content-Type: application/json' -H 'X-Auth-Token: $FETCHED_TOKEN' https://$COMPUTE_ENDPOINT/images | python -m json.tool
- Boot
curl -s -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $FETCHED_TOKEN' -d '{ "server" : { "flavorRef" : "$FLAVOR", "name" : "NAME OF THE SERVER", "key_name": "$KEYNAME" , "accessIPv4": "1.2.3.4", "accessIPv6": "80fe::", "imageRef": "$IMAGE", "OS-DCF:diskConfig": "AUTO" }}' https://$COMPUTE_ENDPOINT/servers
- Get available IPs:
curl -i -H 'Content-Type: application/json' -d '{"auth":{"identity":{"methods":["password"],"password":{"user":{"name":"lbonanomi","domain":{"id":"default"},"password":"LULZ_NO_PASSWORDS"}}},"scope":{"project":{"name":"$TENANCY_NAME","domain":{"id":"default"}}}}}' "https://openstack.$DOMAIN.com:5000/v3/auth/tokens?nocatalog"
- Hang an IP on it
curl -s -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $FETCHED_TOKEN' -d '{
"addFloatingIp" : {
"address": "100.70.19.216"
}
}' https://$COMPUTE_ENDPOINT
- Backup-and-Restore
- Console
- Emergencies
- Housekeeping
- Integrations-and-External-Programs
- Search
- Throttles
- Usage