Expose the method-listing call as host.list_methods.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2007-04-04 18:42:20 +01:00
1 parent 3a7400aa86
commit fccf5da0dd
6 files changed
+92 -11

No files matched your search

+8 -10
View File
@@ -886,7 +886,8 @@ class XendAPI(object):
('get_log', 'String'),
('send_debug_keys', None)]
host_funcs = [('get_by_name_label', 'Set(host)')]
host_funcs = [('get_by_name_label', None),
('list_methods', None)]
# attributes
def host_get_name_label(self, session, host_ref):
@@ -1010,6 +1011,12 @@ class XendAPI(object):
return xen_api_success((XendNode.instance().uuid,))
return xen_api_success([])
def host_list_methods(self, _):
def _funcs():
return [getattr(XendAPI, x) for x in XendAPI.__dict__]
return xen_api_success([x.api for x in _funcs()
if hasattr(x, 'api')])
# Xen API: Class host_CPU
# ----------------------------------------------------------------
@@ -2611,15 +2618,6 @@ class XendAPI(object):
return xen_api_success({'uuid': debug_ref})
def list_all_methods(self, _):
def _funcs():
return [getattr(XendAPI, x) for x in XendAPI.__dict__]
return xen_api_success([x.api for x in _funcs()
if hasattr(x, 'api')])
list_all_methods.api = '_UNSUPPORTED_list_all_methods'
class XendAPIAsyncProxy:
""" A redirector for Async.Class.function calls to XendAPI
but wraps the call for use with the XendTaskManager.
+1 -1
View File
@@ -591,7 +591,7 @@ class Shell(cmd.Cmd):
self.prompt = "xm> "
if serverType == SERVER_XEN_API:
try:
res = server.xenapi._UNSUPPORTED_list_all_methods()
res = server.xenapi.host.list_methods()
for f in res:
setattr(Shell, 'do_' + f + ' ', self.default)
except:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.