Updating API documentation

This commit is contained in:
Scott Schneider 2014-06-10 10:15:58 -07:00
parent b6e68db24b
commit 47cf8db39c

View file

@ -84,21 +84,63 @@ $ curl --url vmpooler.company.com/vm
]
```
#### POST /vm
Useful for batch operations; post JSON (see format below), get back VMs.
```
$ curl -d '{"debian-7-i386":"2","debian-7-x86_64":"1"}' --url vmpooler.company.com/vm
```
```json
{
"ok": true,
"debian-7-i386": {
"hostname": [
"o41xtodlvnvu5cw",
"khirruvwfjlmx3y"
]
},
"debian-7-x86_64": {
"hostname": "y91qbrpbfj6d13q"
}
}
```
#### POST /vm/<pool>
Check-out a VM.
Check-out a VM or VMs.
```
$ curl -d --url vmpooler.company.com/vm/debian-7-i386
```
```json
{
"ok": true,
"debian-7-i386": {
"ok": true,
"hostname": "fq6qlpjlsskycq6"
}
}
```
Multiple VMs can be requested by using multiple query parameters in the URL:
```
$ curl -d --url vmpooler.company.com/vm/debian-7-i386+debian-7-i386+debian-7-x86_64
```
```json
{
"ok": true,
"debian-7-i386": {
"hostname": [
"sc0o4xqtodlul5w",
"4m4dkhqiufnjmxy"
]
},
"debian-7-x86_64": {
"hostname": "zb91y9qbrbf6d3q"
}
}
```
#### DELETE /vm/<hostnamename>
Schedule a checked-out VM for deletion.