def get_MDS(): mds_summary = vsmapi.mds_summary(None) ecpoch = mds_summary.epoch Up = mds_summary.num_up_mdses In = mds_summary.num_in_mdses Failed = mds_summary.num_failed_mdses Stopped = mds_summary.num_stopped_mdses mds_status = vsmapi.mds_status(None) update = "" for mds in mds_status: update = get_time_delta(mds.updated_at) MDS_dict = { "epoch": ecpoch, "update": update, "Up": Up, "In": In, "Failed": Failed, "Stopped": Stopped, "PoolData": "--", "MetaData": "--" } MDSdata = json.dumps(MDS_dict) return MDSdata
def get_MDS(): mds_summary = vsmapi.mds_summary(None) ecpoch = mds_summary.epoch Up = mds_summary.num_up_mdses In = mds_summary.num_in_mdses Failed = mds_summary.num_failed_mdses Stopped = mds_summary.num_stopped_mdses PoolData = mds_summary.data_pools MetaData = mds_summary.metadata_pool mds_status = vsmapi.mds_status(None) update = "" for mds in mds_status: update = get_time_delta(mds.updated_at) MDS_dict = {"epoch":ecpoch ,"update":update ,"Up":Up ,"In":In ,"Failed":Failed ,"Stopped":Stopped ,"PoolData":PoolData ,"MetaData":MetaData} MDSdata = json.dumps(MDS_dict) return MDSdata
def mds(): mds_summary = vsmapi.mds_summary(None) mds_summary_dict = { "epoch":mds_summary.epoch ,"up": mds_summary.num_up_mdses ,"in": mds_summary.num_in_mdses ,"max": mds_summary.num_max_mdses ,"failed":mds_summary.num_failed_mdses ,"stopped":mds_summary.num_stopped_mdses } return mds_summary_dict
def get_summary(self): mds_summary = vsmapi.mds_summary(self.request) LOG.debug("dir mds_summary:%s"%(dir(mds_summary))) #LOG.error(dir(mds_summary)) #LOG.error("(mds_summary)") data = SortedDict() data["MDS Epoch"] = mds_summary.epoch data["Up"] = mds_summary.num_up_mdses data["In"] = mds_summary.num_in_mdses data["Max"] = mds_summary.num_max_mdses data["Failed"] = mds_summary.num_failed_mdses data["Stopped"] = mds_summary.num_stopped_mdses return data
def get_summary(self): mds_summary = vsmapi.mds_summary(self.request) LOG.error("(mds_summary)") LOG.error(dir(mds_summary)) LOG.error("(mds_summary)") data = SortedDict() data["MDS Epoch"] = mds_summary.epoch data["Up"] = mds_summary.num_up_mdses data["In"] = mds_summary.num_in_mdses data["Max"] = mds_summary.num_max_mdses data["Failed"] = mds_summary.num_failed_mdses data["Stopped"] = mds_summary.num_stopped_mdses return data
def get_data(self): _servers = [] #_servers= vsmapi.get_server_list(self.request,) try: _mds_summary = vsmapi.mds_summary(self.request) _mds_status = vsmapi.mds_status(self.request) except: exceptions.handle(self.request, _('Unable to retrieve sever list. ')) mds_status = [] for _mds in _mds_status: mds = {"gid": _mds.gid, "id": _mds.id, "name": _mds.name, "state": _mds.state, "address": _mds.address, "updated_at": get_time_delta(_mds.updated_at), } mds_status.append(mds) return mds_status
def get_data(self): _servers = [] #_servers= vsmapi.get_server_list(self.request,) try: _mds_summary = vsmapi.mds_summary(self.request) _mds_status = vsmapi.mds_status(self.request) except: exceptions.handle(self.request, _('Unable to retrieve sever list. ')) mds_status = [] for _mds in _mds_status: mds = { "gid": _mds.gid, "id": _mds.id, "name": _mds.name, "state": _mds.state, "address": _mds.address, "updated_at": get_time_delta(_mds.updated_at), } mds_status.append(mds) return mds_status