mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Add new disks via API
Add an additional disk to a running VM via the vmpooler API.
````
$ curl -X POST -H X-AUTH-TOKEN:a9znth9dn01t416hrguu56ze37t790bl --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6/disk/8
````
````json
{
"ok": true,
"fq6qlpjlsskycq6": {
"disk": "+8mb"
}
}
````
Provisioning and attaching disks can take a moment, but once the task completes it will be reflected in a `GET /vm/<hostname>` query:
````
$ curl --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6
````
````json
{
"ok": true,
"fq6qlpjlsskycq6": {
"template": "debian-7-x86_64",
"lifetime": 2,
"running": 0.08,
"state": "running",
"disk": [
"+8mb"
],
"domain": "delivery.puppetlabs.net"
}
}
This commit is contained in:
parent
7d0f7254ae
commit
48a1a8d621
4 changed files with 146 additions and 1 deletions
40
API.md
40
API.md
|
|
@ -226,6 +226,46 @@ $ curl -X DELETE --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6
|
|||
}
|
||||
```
|
||||
|
||||
#### Adding additional disk(s)
|
||||
|
||||
##### POST /vm/<hostname>/disk/<size>
|
||||
|
||||
Add an additional disk to a running VM.
|
||||
|
||||
````
|
||||
$ curl -X POST -H X-AUTH-TOKEN:a9znth9dn01t416hrguu56ze37t790bl --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6/disk/8
|
||||
````
|
||||
````json
|
||||
{
|
||||
"ok": true,
|
||||
"fq6qlpjlsskycq6": {
|
||||
"disk": "+8gb"
|
||||
}
|
||||
}
|
||||
````
|
||||
|
||||
Provisioning and attaching disks can take a moment, but once the task completes it will be reflected in a `GET /vm/<hostname>` query:
|
||||
|
||||
````
|
||||
$ curl --url vmpooler.company.com/api/v1/vm/fq6qlpjlsskycq6
|
||||
````
|
||||
````json
|
||||
{
|
||||
"ok": true,
|
||||
"fq6qlpjlsskycq6": {
|
||||
"template": "debian-7-x86_64",
|
||||
"lifetime": 2,
|
||||
"running": 0.08,
|
||||
"state": "running",
|
||||
"disk": [
|
||||
"+8gb"
|
||||
],
|
||||
"domain": "delivery.puppetlabs.net"
|
||||
}
|
||||
}
|
||||
|
||||
````
|
||||
|
||||
#### VM snapshots
|
||||
|
||||
##### POST /vm/<hostname>/snapshot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue