From a417e6aaaf55ce65a0da87016f2885f198e309d2 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Tue, 30 Jan 2007 13:53:44 +0000 Subject: [PATCH] Added backreference from PIF_metrics to PIF, and added a uuid to the session record. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/XendAPI.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index 519b00a71f..354e0d8932 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -497,7 +497,8 @@ class XendAPI(object): auth_manager().logout(session) return xen_api_success_void() def session_get_record(self, session): - record = {'this_host': XendNode.instance().uuid, + record = {'uuid' : session, + 'this_host': XendNode.instance().uuid, 'this_user': auth_manager().get_user(session)} return xen_api_success(record) def session_get_all(self): @@ -902,7 +903,8 @@ class XendAPI(object): # Xen API: Class PIF_metrics # ---------------------------------------------------------------- - PIF_metrics_attr_ro = ['io_read_kbs', + PIF_metrics_attr_ro = ['PIF', + 'io_read_kbs', 'io_write_kbs'] PIF_metrics_attr_rw = [] PIF_methods = [] @@ -913,6 +915,9 @@ class XendAPI(object): def PIF_metrics_get_record(self, _, ref): return xen_api_success(self._PIF_metrics_get(ref).get_record()) + def PIF_metrics_get_PIF(self, _, ref): + return xen_api_success(self._PIF_metrics_get(ref).pif.uuid) + def PIF_metrics_get_io_read_kbs(self, _, ref): return xen_api_success(self._PIF_metrics_get(ref).get_io_read_kbs()) -- 2.30.2