diff --git a/README.md b/README.md index 059f569..28de840 100644 --- a/README.md +++ b/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/ -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/ Schedule a checked-out VM for deletion.