Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
example of curling against the openstack api
(trey|n3va)~/nova> cat novarc
NOVA_KEY_DIR=$(pushd $(dirname $BASH_SOURCE)>/dev/null; pwd; popd>/dev/null)
export EC2_ACCESS_KEY="admin:openstack"
export EC2_SECRET_KEY="5a7fc8fe-4029-4046-82fc-b8b45a5ef0e8"
export EC2_URL=""
export S3_URL=""
export EC2_USER_ID=42 # nova does not use user id, but bundling requires it
export EC2_PRIVATE_KEY=${NOVA_KEY_DIR}/pk.pem
export EC2_CERT=${NOVA_KEY_DIR}/cert.pem
export NOVA_CERT=${NOVA_KEY_DIR}/cacert.pem
export EUCALYPTUS_CERT=${NOVA_CERT} # euca-bundle-image seems to require this set
alias ec2-bundle-image="ec2-bundle-image --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}"
alias ec2-upload-bundle="ec2-upload-bundle -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"
export NOVA_API_KEY="admin"
export NOVA_USERNAME="admin"
export NOVA_URL=""
(trey|n3va)~/nova> curl -ik -H 'X-Auth-User: admin' -H 'X-Auth-Key: admin'
HTTP/1.1 204 No Content
Content-Length: 0
X-Auth-Token: b36db315100968305df2ee5d6e49e0a85be8ad15
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Apr 2011 18:56:42 GMT
(trey|n3va)~/nova> curl -ik -H 'X-Auth-Token: b36db315100968305df2ee5d6e49e0a85be8ad15'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 238
Date: Tue, 19 Apr 2011 18:57:07 GMT
{"server": {"status": "ACTIVE", "hostId": "3ab5b1023ba8417425cb13d54d5187643b28fafaa285a181471188e0", "addresses": {"public": [], "private": ["", ""]}, "name": "t1", "flavorId": 1, "imageId": "7", "id": 1, "metadata": {}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.