[Kimchi-devel] [PATCH 2/4] Host's software update: Update REST API

Paulo Vital pvital at linux.vnet.ibm.com
Mon Feb 10 02:50:39 UTC 2014


Define PackageUpdate resource features according to API.md
Activate auth support to new resource

Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
 src/kimchi/control/host.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/kimchi/control/host.py b/src/kimchi/control/host.py
index 053c822..f382eb3 100644
--- a/src/kimchi/control/host.py
+++ b/src/kimchi/control/host.py
@@ -36,6 +36,8 @@ class Host(Resource):
         self.shutdown = self.generate_action_handler('shutdown')
         self.stats = HostStats(self.model)
         self.partitions = Partitions(self.model)
+        self.packageupdate = PackageUpdate(self.model)
+        self.packageupdate.expose = True
 
     @property
     def data(self):
@@ -61,3 +63,13 @@ class Partition(Resource):
     @property
     def data(self):
         return self.info
+
+
+class PackageUpdate(Resource):
+    def __init__(self, model, id=None):
+        super(PackageUpdate, self).__init__(model, id)
+        self.update = self.generate_action_handler('update')
+
+    @property
+    def data(self):
+        return self.info
-- 
1.8.3.1




More information about the Kimchi-devel mailing list