Created
July 31, 2017 09:36
-
-
Save dalitun/4a16d727451f77ae30ddf1c4c17f7ffa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
JSON=`jq -n ".auth.passwordCredentials.password = \"$OS_PASSWORD\" | .auth.passwordCredentials.username = \"$OS_USERNAME\" | .auth.tenantName = \"$OS_TENANT_NAME\""` | |
CREDS=`curl -s "$OS_AUTH_URL/tokens" -X POST -H "Content-Type: application/json" -d "$JSON"` | |
TOKEN=`echo $CREDS | jq -r .access.token.id` | |
#echo $TOKEN | |
TENANT_ID=`echo $CREDS | jq -r .access.token.tenant.id` | |
ENDPOINT=`echo $CREDS | jq -r '.access.serviceCatalog[] | select(.type == "compute").endpoints[0].publicURL'` | |
#NET="98a334b9-59fe-417c-8230-7a89a85b4701" | |
#echo $NET | |
#curl -s "https://compute.fr1.cloudwatt.com/v2/467b00f998064f1688feeca95bdc7a88/os-keypairs" -X GET -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" | jq '.' | |
#curl -k "https://bssapi.fr1.cloudwatt.com/openstack/neutron/openstack" -X GET -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" | jq '.' | |
#curl -s "https://compute.fr1.cloudwatt.com/v2/467b00f998064f1688feeca95bdc7a88/os-networks" -X GET -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" | jq '.' | |
#curl -k "https://network.fr1.cloudwatt.com/v2.0/networks" -X GET -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" | jq '.' | |
#curl -k "https://network.fr1.cloudwatt.com/v2.0/networks" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X POST -d '{"networks": [{"name": "sample_network_1","admin_state_up": true}]}' | |
#curl -k "https://network.fr1.cloudwatt.com/v2.0/networks" -X POST -H "Accept: application/json" -H "X-Auth-Token: $TOKEN" | jq '.' | |
#curl -k "https://network.fr1.cloudwatt.com/v2.0/subnets" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X POST -d '{"subnet": {"network_id": '$NET',"ip_version": 4,"cidr": "192.168.0.0/24"} }' | jq '.' | |
#curl -k "https://image.fr1.cloudwatt.com/v2/$OS_PROJECT_ID/images" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" | jq '.' | |
#curl -k "https://compute.fr1.cloudwatt.com/v2/467b00f998064f1688feeca95bdc7a88/servers/6077dd47-94f0-4d83-a628-f36be7cc51e9/action" -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X POST -d '{"createImage" : {"name" : "foooooooo-image","metadata": {"meta_var": "meta_val"}}}' | jq '.' | |
#echo $OS_PROJECT_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment