rcbops-qe / monster

Deployment/Orchestration Engine
Apache License 2.0
4 stars 8 forks source link

features: add-nodes and adding a webserver to serve as an HTTP API #209

Closed jcourtois closed 10 years ago

jcourtois commented 10 years ago

add nodes

monster add-nodes --compute-nodes 2 will add two compute nodes, uniquely named, to your deployment and put them under control of the chefserver.


webserver (using pyramid framework)

From within a suitable virtualenv (make sure to run pip install -r requirements.txt to get the new package requirements), run python monster-api/pyramid/hello_deployment.py. This will start the server on http://0.0.0.0:8080.

Currently, the only route that is defined supports GET, POST, and DELETE requests to

http://0.0.0.0:8080/rpcs/deployment/{name}

Hit the url with

curl http://localhost:8080/rpcs/deployment/my-deployment -d '{ "dry": false, "secret": "secret.yaml", "orchestrator": "chef", "name": "my-private-cloud", "template": "ubuntu-neutron-lite", "branch": "4.2.2", "destroy_on_failure": true, "provisioner": "rackspace", "config": "pubcloud-neutron.yaml", "log": null}'

This will initiate a build that's the equivalent of the command:

monster build rpcs my-deployment -c pubcloud-neutron.yaml -t ubuntu-neutron-lite -o chef -p rackspace -b 4.2.2 --destroy-on-failure

Hit the url with:

curl -X GET http://localhost:8080/rpcs/deployment/my-deployment

This is the equivalent of:

monster show my-deployment

Hit the url with:

curl -X DELETE http://localhost:8080/rpcs/deployment/my-deployment

This is the equivalent of:

monster destroy my-deployment