mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Updating API documentation
This commit is contained in:
parent
b6e68db24b
commit
47cf8db39c
1 changed files with 44 additions and 2 deletions
46
README.md
46
README.md
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue