Reviewed-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
On 06/03/2014 04:20 AM, lvroyce(a)linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Add eject action to vmstorage actions,
and add this action to doc.
Instead of reuse 'update', make eject a single action to avoid empty
path introduced confusion.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
docs/API.md | 3 +++
src/kimchi/control/vm/storages.py | 1 +
2 files changed, 4 insertions(+)
diff --git a/docs/API.md b/docs/API.md
index 9217a37..6c14806 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -155,6 +155,9 @@ Represents a snapshot of the Virtual Machine's primary monitor.
* path: Path of cdrom iso. Can not be blank. Now just support cdrom type.
* **DELETE**: Remove the storage.
+**Actions (POST):**
+
+* eject: Eject cdrom from device.
### Collection: Templates
diff --git a/src/kimchi/control/vm/storages.py b/src/kimchi/control/vm/storages.py
index 984c4d2..a8a037a 100644
--- a/src/kimchi/control/vm/storages.py
+++ b/src/kimchi/control/vm/storages.py
@@ -39,6 +39,7 @@ class VMStorage(Resource):
self.info = {}
self.model_args = [self.vm, self.ident]
self.uri_fmt = '/vms/%s/storages/%s'
+ self.eject = self.generate_action_handler('eject')
self.update_params = ['path']
@property