-
Notifications
You must be signed in to change notification settings - Fork 17
REST API Usage Examples
The following environment variables are assumed to have proper values:
USER=“your Overmind username”
PASS=“your Overmind password”
OVERMIND_IP=“IP address of server where Overmind is running”
OVERMIND_PORT=“port number where Overmind is running”
curl --user $USER:$PASS http://${OVERMIND_IP}:${OVERMIND_PORT}/api/providers/
EC2_ACCESS_ID=“your EC2 access id”
EC2_SECRET_KEY=“your EC2 secret key”
PROVIDER_TYPE=“EC2_US_EAST” or “EC2_US_WEST” or “EC2_EU_WEST”
NAME=“my_new_EC2_provider_name”
curl --user $USER:$PASS -i -H "Accept: application/json" -X POST -d "name=$NAME&provider_type=$PROVIDER_TYPE&access_key=$EC2_ACCESS_ID&secret_key=$EC2_SECRET_KEY" http://${OVERMIND_IP}:${OVERMIND_PORT}/api/providers/
curl --user $USER:$PASS http://${OVERMIND_IP}:${OVERMIND_PORT}/api/nodes/
curl --user $USER:$PASS http://${OVERMIND_IP}:${OVERMIND_PORT}/api/nodes/?show_decommissioned=true
PROVIDER_ID=1 (this will vary based on your specific case; list your providers first to see which ID you need)
NAME=‘test_api_node’
REALM_ID=0
FLAVOR_ID=“m1.small”
IMAGE_ID=“ami-00194945”
curl --user $USER:$PASS -i -H "Accept: application/json" -X POST -d "provider_id=$PROVIDER_ID&name=$NAME&realm=$REALM_ID&flavor=$FLAVOR_ID&image=$IMAGE_ID" http://${OVERMIND_IP}:${OVERMIND_PORT}/api/nodes/
NODE_ID=node_id_of_node_you_want_to_delete
curl --user $USER:$PASS -i -H "Accept: application/json" -X DELETE http://${OVERMIND_IP}:${OVERMIND_PORT}/api/nodes/$NODE_ID