def get_summary(self):
     cluster_summary = vsmapi.cluster_summary(self.request)
     data = SortedDict()
     for k, d in enumerate(cluster_summary.detail):
         data[mark_safe("<lable id=detail-%s>Warn</lable>" % k)] = d
     for k, d in enumerate(cluster_summary.status):
         try:
             data[mark_safe("<lable id=summary-%s>%s</lable>" % (k, d.get('severity')))] = d.get('summary')
         except:
             pass
     return data
Ejemplo n.º 2
0
 def get_summary(self):
     cluster_summary = vsmapi.cluster_summary(self.request)
     data = SortedDict()
     for k, d in enumerate(cluster_summary.detail):
         data[mark_safe("<lable id=detail-%s>Warn</lable>" % k)] = d
     for k, d in enumerate(cluster_summary.status):
         try:
             data[mark_safe("<lable id=summary-%s>%s</lable>" % (k, d.get('severity')))] = d.get('summary')
         except:
             pass
     return data
Ejemplo n.º 3
0
def get_cluster():
    cluster_summary = vsmapi.cluster_summary(None)
    cluster_name = vsmapi.get_cluster_list(None)[1]["clusters"][0]["name"]
    # HEALTH_OK HEALTH_WARN  HEALTH_ERROR
    cluster_status = cluster_summary.health_list[0]
    cluster_note = []
    for note in cluster_summary.health_list[1:]:
        cluster_note.append(note)

    vsm_status_dict = {"name": cluster_name, "status": cluster_status, "note": cluster_note}
    vsmstatusdata = json.dumps(vsm_status_dict)
    return vsmstatusdata
Ejemplo n.º 4
0
def get_cluster():
    cluster_summary = vsmapi.cluster_summary(None)
    cluster_name = vsmapi.get_cluster_list(None)[1]['clusters'][0]['name']
    #HEALTH_OK HEALTH_WARN  HEALTH_ERR
    cluster_status = cluster_summary.health_list[0]
    cluster_note = []
    for note in cluster_summary.health_list[1:]:
        cluster_note.append(note)

    vsm_status_dict = { "name":cluster_name
                      , "status": cluster_status
                      , "note":cluster_note}
    vsmstatusdata = json.dumps(vsm_status_dict)
    return vsmstatusdata
Ejemplo n.º 5
0
def get_cluster():
    cluster_summary = vsmapi.cluster_summary(None)
    cluster_name = vsmapi.get_cluster_list(None)[1]['clusters'][0]['name']
    #HEALTH_OK HEALTH_WARN  HEALTH_ERROR
    cluster_status = cluster_summary.health_list[0]
    cluster_note = []
    if cluster_status == "HEALTH_OK":
        for note in cluster_summary.health_list[1:]:
            cluster_note.append(note)
    else:
        for index, note in enumerate(cluster_summary.detail):
            cluster_note.append(note)

    vsm_status_dict = { "name":cluster_name
                      , "status": cluster_status
                      , "note":cluster_note}
    vsmstatusdata = json.dumps(vsm_status_dict)
    return vsmstatusdata
Ejemplo n.º 6
0
def get_cluster():
    cluster_summary = vsmapi.cluster_summary(None)
    cluster_name = vsmapi.get_cluster_list(None)[1]['clusters'][0]['name']
    #HEALTH_OK HEALTH_WARN  HEALTH_ERROR
    cluster_status = cluster_summary.health_list[0]
    cluster_note = []
    if cluster_status == "HEALTH_OK":
        for note in cluster_summary.health_list[1:]:
            cluster_note.append(note)
    else:
        for index, note in enumerate(cluster_summary.detail):
            cluster_note.append(note)

    vsm_status_dict = {
        "name": cluster_name,
        "status": cluster_status,
        "note": cluster_note
    }
    vsmstatusdata = json.dumps(vsm_status_dict)
    return vsmstatusdata
    def get_summary(self):
        cluster_summary = vsmapi.cluster_summary(self.request)
        cluster_name = vsmapi.get_cluster_list(self.request)[1]['clusters'][0]['name']
        data = SortedDict()
        data["Cluster Name"] = cluster_name
        try:
            data["Status"] = cluster_summary.health_list[0]
            status = data['Status'].lower()
            if status.find('ok') != -1:
                self.css_id = "health_ok"
            elif status.find('war') != -1:
                self.css_id = "health_warning"
            elif status.find('error') != -1:
                self.css_id = "health_error"

            msg = self.font % (self.css_id, data["Status"])
            data["Status"] = mark_safe(msg)
        except:
            pass
        return data
Ejemplo n.º 8
0
    def get_summary(self):
        cluster_summary = vsmapi.cluster_summary(self.request)
        cluster_name = vsmapi.get_cluster_list(self.request)[1]['clusters'][0]['name']
        data = SortedDict()
        data["Cluster Name"] = cluster_name
        try:
            data["Status"] = cluster_summary.health_list[0]
            status = data['Status'].lower()
            if status.find('ok') != -1:
                self.css_id = "health_ok"
            elif status.find('war') != -1:
                self.css_id = "health_warning"
            elif status.find('error') != -1:
                self.css_id = "health_error"

            msg = self.font % (self.css_id, data["Status"])
            data["Status"] = mark_safe(msg)
        except:
            pass
        return data
 def get_summary_list(self):
     cluster_summary = vsmapi.cluster_summary(self.request)
     summary_list = []
     for d in cluster_summary.health_list[1:]:
         summary_list.append(d)
     return summary_list
Ejemplo n.º 10
0
 def get_summary_list(self):
     cluster_summary = vsmapi.cluster_summary(self.request)
     summary_list = []
     for d in cluster_summary.health_list[1:]:
         summary_list.append(d)
     return summary_list