This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Run manual RackHD APIs
Avery Yen edited this page Feb 16, 2016
·
2 revisions
curl -X PUT -H "Content-Type: application/json" --data @src/github.com/rackhd/rackhd-cpi/templates/wipe_machine_task.json "$RACKHD_API_URL/api/common/workflows/tasks"
curl -X PUT -H "Content-Type: application/json" --data @../templates/create_vm_workflow.json "$RACKHD_API_URL/api/common/workflows"
curl $RACKHD_API_URL/api/common/workflows/tasks/library | jq '.[] | select(.injectableName == "Task.Os.Delete.CF.VM")'
curl $RACKHD_API_URL/api/common/workflows/library | jq '.[] | select(.injectableName == "Graph.CF.DeleteVM")'
curl $RACKHD_API_URL/api/common/nodes/55e79ea54e66816f6152fff9/workflows/active | jq .
watch -c -n 10 'curl $RACKHD_API_URL/api/common/nodes/55e79eb14e66816f6152fffb/workflows/active | jq ". | ._status"'
curl -X DELETE $RACKHD_API_URL/api/common/nodes/55e79ea54e66816f6152fff9/workflows/active
curl -X POST -H "Content-Type: application/json" $RACKHD_API_URL/api/common/nodes/55e79eb14e66816f6152fffb/workflows -d '{"name":"Graph.CF.CreateReserveVM","options":{"defaults": {"agentSettingsFile": "env-234567", "agentSettingsPath": "/var/vcap/bosh/baremetal-cpi-agent-env.json", "cid": "vm-1234","downloadDir": "/opt/downloads","registrySettingsFile": "agent-123456", "registrySettingsPath": "/var/vcap/bosh/agent.json", "stemcellFile": "raw-image"}}}'
curl -X POST -H "Content-Type: application/json" $RACKHD_API_URL/api/common/nodes/.../workflows -d '{"name":"Graph.CF.DeleteVM","options":{"defaults": {}}}'
curl -X PATCH -H "Content-Type: application/json" -d '{"status":"blocked"}' $RACKHD_API_URL/api/common/nodes/${Node_ID}
curl -X PATCH -H "Content-Type: application/json" -d '{"status":"maintenance"}' $RACKHD_API_URL/api/common/nodes/${Node_ID}
curl -X PATCH -H "Content-Type: application/json" -d '{"status":"available"}' $RACKHD_API_URL/api/common/nodes/${Node_ID}
curl -X POST -H "Content-Type: application/json" $RACKHD_API_URL/api/common/nodes/55e79ea54e66816f6152fff9/workflows -d '{"name":"Graph.CF.DeleteVM","options":{}}'
curl "$RACKHD_API_URL/api/common/nodes" | jq .
curl "$RACKHD_API_URL/api/common/files/list/all" | jq .
curl -X PUT "$RACKHD_API_URL/api/common/files/env-234567" --upload-file {a_file}
curl -X DELETE "$RACKHD_API_URL/api/common/files/{a_file_uuid}"