summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKevin L. Mitchell <kevin.mitchell@rackspace.com>2012-06-29 17:17:04 -0500
committerKevin L. Mitchell <kevin.mitchell@rackspace.com>2012-06-29 17:17:51 -0500
commit6222385d837f90f769c94f21d003999741c4f800 (patch)
tree0ec6a458af9923deb1325b357edbe5bedb0b4819 /plugins
parent019d953ef5b4bed7c53401375bfd7aa890fc0c1d (diff)
downloadnova-6222385d837f90f769c94f21d003999741c4f800.tar.gz
nova-6222385d837f90f769c94f21d003999741c4f800.tar.xz
nova-6222385d837f90f769c94f21d003999741c4f800.zip
Get hypervisor uptime.
Adds a call to retrieve the current uptime on a specific hypervisor. This version of the patch only adds the XenAPI variant; other virt drivers will raise a NotImplementedError until they implement the get_host_uptime() method. Change-Id: Ie259589757a460fcd91a49a8dd8099e4d91524e7
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost
index d7effba19..4006de420 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost
@@ -339,6 +339,12 @@ def parse_response(resp):
return data
+@jsonify
+def host_uptime(self, arg_dict):
+ """Returns the result of the uptime command on the xenhost."""
+ return {"uptime": _run_command('uptime')}
+
+
def cleanup(dct):
"""Take the raw KV pairs returned and translate them into the
appropriate types, discarding any we don't need.
@@ -432,4 +438,5 @@ if __name__ == "__main__":
"host_join": host_join,
"get_config": get_config,
"set_config": set_config,
- "iptables_config": iptables_config})
+ "iptables_config": iptables_config,
+ "host_uptime": host_uptime})