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

Paulo Vital pvital at linux.vnet.ibm.com
Mon Jan 27 16:34:06 UTC 2014


Define SoftwareUpdate 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 f041b35..c6abedd 100644
--- a/src/kimchi/control/host.py
+++ b/src/kimchi/control/host.py
@@ -7,6 +7,7 @@
 #  Adam Litke <agl at linux.vnet.ibm.com>
 #  Aline Manera <alinefm at linux.vnet.ibm.com>
 #  Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
+#  Paulo Vital <pvital at linux.vnet.ibm.com>
 #  ShaoHe Feng <shaohef at linux.vnet.ibm.com>
 #
 # This library is free software; you can redistribute it and/or
@@ -38,6 +39,8 @@ class Host(Resource):
         self.stats.exposed = True
         self.partitions = Partitions(self.model)
         self.partitions.exposed = True
+        self.softwareupdate = SoftwareUpdate(self.model)
+        self.softwareupdate.exposed = True
 
     @property
     def data(self):
@@ -63,3 +66,12 @@ class Partition(Resource):
     @property
     def data(self):
         return self.info
+
+class SoftwareUpdate(Resource):
+    def __init__(self, model):
+        super(SoftwareUpdate, self).__init__(model)
+        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