Ejemplo n.º 1
0
def init_plat_tree():

    # Create /api end point as root node
    r_api = tree("api", data = get_node_api())

    # Add /api/fcb to represent fan control board
    r_fcb = tree("fcb", data = get_node_fcb())
    r_api.addChild(r_fcb)
    # Add /api/pdpb to represent fan control board
    r_pdpb = tree("pdpb", data = get_node_pdpb())
    r_api.addChild(r_pdpb)
    # Add /api/peb to represent fan control board
    r_peb = tree("peb", data = get_node_peb())
    r_api.addChild(r_peb)

    #Add /api/fcb/fans end point
    r_temp = tree("fans", data = get_node_fans())
    r_fcb.addChild(r_temp)
    #Add /api/fcb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("fcb"))
    r_fcb.addChild(r_temp)
    #Add /api/fcb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("fcb"))
    r_fcb.addChild(r_temp)
    #Add /api/fcb/logs end point
    r_temp = tree("logs", data = get_node_logs("fcb"))
    r_fcb.addChild(r_temp)

    #Add /api/pdpb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("pdpb"))
    r_pdpb.addChild(r_temp)
    #Add /api/pdpb/flash end point
    r_temp = tree("flash", data = get_node_flash())
    r_pdpb.addChild(r_temp)
    #Add /api/pdpb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("pdpb"))
    r_pdpb.addChild(r_temp)
    #Add /api/pdpb/logs end point
    r_temp = tree("logs", data = get_node_logs("pdpb"))
    r_pdpb.addChild(r_temp)

    #Add /api/peb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("peb"))
    r_peb.addChild(r_temp)
    #Add /api/peb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("peb"))
    r_peb.addChild(r_temp)
    #Add /api/peb/bmc end point
    r_temp = tree("bmc", data = get_node_bmc())
    r_peb.addChild(r_temp)
    #Add /api/peb/health end point
    r_temp = tree("health", data = get_node_health())
    r_peb.addChild(r_temp)
    #Add /api/peb/logs end point
    r_temp = tree("logs", data = get_node_logs("peb"))
    r_peb.addChild(r_temp)

    return r_api
Ejemplo n.º 2
0
def init_plat_tree():

    # Create /api end point as root node
    r_api = tree("api", data=get_node_api())

    # Add /api/mezz to represent Mezzanine Card
    r_mezz = tree("nic", data=get_node_mezz())
    r_api.addChild(r_mezz)
    # Add /api/iom to represent IO Module
    r_iom = tree("iom", data=get_node_iom())
    r_api.addChild(r_iom)
    # Add /api/dpb to represent Drive Plan Board
    r_dpb = tree("dpb", data=get_node_dpb())
    r_api.addChild(r_dpb)
    # Add /api/scc to represent Storage Controller Card
    r_scc = tree("scc", data=get_node_scc())
    r_api.addChild(r_scc)

    # Add servers /api/slot[1-max]
    num = pal_get_num_slots()
    for i in range(1, num + 1):
        r_server = populate_server_node(i)
        if r_server:
            r_api.addChild(r_server)

    # Add /api/mezz/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("nic"))
    r_mezz.addChild(r_temp)
    # Add /api/mezz/logs end point
    r_temp = tree("logs", data=get_node_logs("nic"))
    r_mezz.addChild(r_temp)

    # Add /api/iom/fruid end point
    r_temp = tree("fruid", data=get_node_fruid("iom"))
    r_iom.addChild(r_temp)
    # Add /api/iom/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("iom"))
    r_iom.addChild(r_temp)
    # Add /api/iom/logs end point
    r_temp = tree("logs", data=get_node_logs("iom"))
    r_iom.addChild(r_temp)
    # Add /api/iom/bmc end point
    r_temp = tree("bmc", data=get_node_bmc())
    r_iom.addChild(r_temp)
    # Add /api/iom/health end point
    r_temp = tree("health", data=get_node_health())
    r_iom.addChild(r_temp)
    # Add /api/iom/identify end point
    r_temp = tree("identify", data=get_node_identify("iom"))
    r_iom.addChild(r_temp)

    # Add /api/dpb/fruid end point
    r_temp = tree("fruid", data=get_node_fruid("dpb"))
    r_dpb.addChild(r_temp)
    # Add /api/dpb/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("dpb"))
    r_dpb.addChild(r_temp)
    # Add /api/dpb/logs end point
    r_temp = tree("logs", data=get_node_logs("dpb"))
    r_dpb.addChild(r_temp)
    # Add /api/dpb/fans end point
    r_temp = tree("fans", data=get_node_fans())
    r_dpb.addChild(r_temp)
    # Add /api/dpb/hdd-status end point
    r_tmp = tree("hdd-status", data=get_node_enclosure_hdd_status())
    r_dpb.addChild(r_tmp)
    # Add /api/dpb/error end point
    r_tmp = tree("error", data=get_node_enclosure_error())
    r_dpb.addChild(r_tmp)
    # Add /api/dpb/flash-health end point
    r_tmp = tree("flash-health", data=get_node_enclosure_flash_health())
    r_dpb.addChild(r_tmp)
    # Add /api/dpb/flash-status end point
    r_tmp = tree("flash-status", data=get_node_enclosure_flash_status())
    r_dpb.addChild(r_tmp)

    # Add /api/scc/fruid end point
    r_temp = tree("fruid", data=get_node_fruid("scc"))
    r_scc.addChild(r_temp)
    # Add /api/scc/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("scc"))
    r_scc.addChild(r_temp)
    # Add /api/scc/logs end point
    r_temp = tree("logs", data=get_node_logs("scc"))
    r_scc.addChild(r_temp)

    return r_api
Ejemplo n.º 3
0
def init_plat_tree():

    # Create /api end point as root node
    r_api = tree("api", data = get_node_api())

    # Add /api/fcb to represent fan control board
    r_fcb = tree("fcb", data = get_node_fcb())
    r_api.addChild(r_fcb)
    # Add /api/pdpb to represent fan control board
    r_pdpb = tree("pdpb", data = get_node_pdpb())
    r_api.addChild(r_pdpb)
    # Add /api/peb to represent fan control board
    r_peb = tree("peb", data = get_node_peb())
    r_api.addChild(r_peb)

    #Add /api/fcb/fans end point
    r_temp = tree("fans", data = get_node_fans())
    r_fcb.addChild(r_temp)
    #Add /api/fcb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("fcb"))
    r_fcb.addChild(r_temp)
    #Add /api/fcb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("fcb"))
    r_fcb.addChild(r_temp)
    #Add /api/fcb/logs end point
    r_temp = tree("logs", data = get_node_logs("fcb"))
    r_fcb.addChild(r_temp)

    #Add /api/pdpb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("pdpb"))
    r_pdpb.addChild(r_temp)
    #Add /api/pdpb/flash end point
    r_temp = tree("flash", data = get_node_flash())
    r_pdpb.addChild(r_temp)
    #Add /api/pdpb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("pdpb"))
    r_pdpb.addChild(r_temp)
    #Add /api/pdpb/logs end point
    r_temp = tree("logs", data = get_node_logs("pdpb"))
    r_pdpb.addChild(r_temp)

    #Add /api/peb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("peb"))
    r_peb.addChild(r_temp)
    #Add /api/peb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("peb"))
    r_peb.addChild(r_temp)
    #Add /api/peb/bmc end point
    r_temp = tree("bmc", data = get_node_bmc())
    r_peb.addChild(r_temp)
    #Add /api/peb/health end point
    r_temp = tree("health", data = get_node_health())
    r_peb.addChild(r_temp)
    #Add /api/peb/identify end point
    r_temp = tree("identify", data = get_node_identify("peb"))
    r_peb.addChild(r_temp)
    #Add /api/peb/logs end point
    r_temp = tree("logs", data = get_node_logs("peb"))
    r_peb.addChild(r_temp)

    return r_api