adding hardware info call to management client
This commit is contained in:
@@ -25,6 +25,7 @@ from reddwarfclient.root import Root
|
||||
from reddwarfclient.storage import StorageInfo
|
||||
from reddwarfclient.users import Users
|
||||
from reddwarfclient.versions import Versions
|
||||
from reddwarfclient.diagnostics import Interrogator
|
||||
from reddwarfclient.diagnostics import DiagnosticsInterrogator
|
||||
from reddwarfclient.diagnostics import HwInfoInterrogator
|
||||
from reddwarfclient.client import Dbaas
|
||||
from reddwarfclient.client import ReddwarfHTTPClient
|
||||
|
@@ -310,7 +310,8 @@ class Dbaas(object):
|
||||
from reddwarfclient.storage import StorageInfo
|
||||
from reddwarfclient.management import Management
|
||||
from reddwarfclient.accounts import Accounts
|
||||
from reddwarfclient.diagnostics import Interrogator
|
||||
from reddwarfclient.diagnostics import DiagnosticsInterrogator
|
||||
from reddwarfclient.diagnostics import HwInfoInterrogator
|
||||
|
||||
self.client = client_cls(username, api_key, tenant, auth_url,
|
||||
service_type=service_type,
|
||||
@@ -329,7 +330,8 @@ class Dbaas(object):
|
||||
self.storage = StorageInfo(self)
|
||||
self.management = Management(self)
|
||||
self.accounts = Accounts(self)
|
||||
self.diagnostics = Interrogator(self)
|
||||
self.diagnostics = DiagnosticsInterrogator(self)
|
||||
self.hwinfo = HwInfoInterrogator(self)
|
||||
|
||||
class Mgmt(object):
|
||||
def __init__(self, dbaas):
|
||||
|
@@ -25,7 +25,7 @@ class Diagnostics(base.Resource):
|
||||
return "<Diagnostics: %s>" % self.version
|
||||
|
||||
|
||||
class Interrogator(base.ManagerWithFind):
|
||||
class DiagnosticsInterrogator(base.ManagerWithFind):
|
||||
"""
|
||||
Manager class for Interrogator resource
|
||||
"""
|
||||
@@ -37,3 +37,22 @@ class Interrogator(base.ManagerWithFind):
|
||||
"""
|
||||
return self._get("/mgmt/instances/%s/diagnostics" % base.getid(instance),
|
||||
"diagnostics")
|
||||
|
||||
|
||||
class HwInfo(base.Resource):
|
||||
|
||||
def __repr__(self):
|
||||
return "<HwInfo: %s>" % self.version
|
||||
|
||||
|
||||
class HwInfoInterrogator(base.ManagerWithFind):
|
||||
"""
|
||||
Manager class for HwInfo
|
||||
"""
|
||||
resource_class = HwInfo
|
||||
|
||||
def get(self, instance):
|
||||
"""
|
||||
Get the hardware information of the instance.
|
||||
"""
|
||||
return self._get("/mgmt/instances/%s/hwinfo" % base.getid(instance))
|
||||
|
@@ -121,10 +121,14 @@ class InstanceCommands(common.AuthedCommandsBase):
|
||||
deleted = False
|
||||
self._pretty_paged(self.dbaas.management.index, deleted=deleted)
|
||||
|
||||
def hwinfo(self):
|
||||
"""Show hardware information details about an instance."""
|
||||
self._require('id')
|
||||
self._pretty_print(self.dbaas.hwinfo.get, self.id)
|
||||
|
||||
def diagnostic(self):
|
||||
"""List diagnostic details about an instance."""
|
||||
self._require('id')
|
||||
dbaas = common.get_client()
|
||||
self._pretty_print(self.dbaas.diagnostics.get, self.id)
|
||||
|
||||
def stop(self):
|
||||
|
Reference in New Issue
Block a user