Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2016 06:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/f59d96918f3103ad5651 to your computer and use it in GitHub Desktop.
Save anonymous/f59d96918f3103ad5651 to your computer and use it in GitHub Desktop.
octavia curl command help
# Create a loadbalancer:
curl -X POST -H Content-type:application/json -d '{"name": "test_lb", "vip": {"ip_address": "10.0.0.3", "port_id": "92a345db-3ba6-42b3-85ad-7fb5193c43d5", "subnet_id": "47a12b70-c436-4f2b-b2bf-d0518627c31f"}}' http://localhost:9876/v1/loadbalancers
# Get loadbalancer list (do this until pending create is no longer pending...):
curl http://localhost:9876/v1/loadbalancers
# get listeners:
curl http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/listeners
# create listener:
curl -X POST -H Content-type:application/json -d '{"name": "test_listener", "protocol": "HTTP", "protocol_port": 80}' http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/listeners
# get the above listener's pools:
curl http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/listeners/466104c4-828c-40c9-9392-82d14333a482/pools
# create pool:
curl -X POST -H Content-type:application/json -d '{"name":"test_pool1", "protocol": "HTTP", "lb_algorithm": "ROUND_ROBIN"}' http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/listeners/466104c4-828c-40c9-9392-82d14333a482/pools
curl -X POST -H Content-type:application/json -d '{"name":"test_pool1", "protocol": "HTTP", "lb_algorithm": "ROUND_ROBIN"}' http://localhost:9876/v1/loadbalancers/85ceb556-9a84-4fc0-aa83-45bd07897ff0/listeners/aac8d3bf-9e64-4bfe-9a96-f2cce0e1d1f0/pools
# create pool in lb context:
curl -X POST -H Content-type:application/json -d '{"name":"test_pool2", "protocol": "HTTP", "lb_algorithm": "ROUND_ROBIN"}' http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/pools
# Update listener to use different pool2 as default:
curl -X PUT -H Content-type:application/json -d '{"default_pool_id": "277f97ca-68db-4985-af05-dd01c6583e16"}' http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/listeners/466104c4-828c-40c9-9392-82d14333a482
# Create second listener that also uses the above pool
curl -X POST -H Content-type:application/json -d '{"name": "test_listener2", "protocol": "HTTP", "protocol_port": 81, "default_pool_id": "277f97ca-68db-4985-af05-dd01c6583e16"}' http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/listeners
# Delete that default pool...
curl -X DELETE http://localhost:9876/v1/loadbalancers/0fb3aa47-2d88-4c51-85dc-0e997c876f5a/pools/277f97ca-68db-4985-af05-dd01c6583e16
# Get a pool...
curl -X GET http://localhost:9876/v1/loadbalancers/85ceb556-9a84-4fc0-aa83-45bd07897ff0/pools/c18d6cdd-1bad-4dee-b19c-811d1c8c0fc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment