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/sled to represent entire SLED
    r_sled = tree("sled", data = get_node_sled())
    r_api.addChild(r_sled)


    # Add mb /api/sled/mb
    r_mb = tree("mb", data = get_node_server_2s())
    r_sled.addChild(r_mb)

    # Add /api/sled/mb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("mb"))
    r_mb.addChild(r_temp)

    # /api/sled/mb/bmc end point
    r_temp = tree("bmc", data = get_node_bmc())
    r_mb.addChild(r_temp)

    r_temp = tree("vboot", data = get_node_vboot())
    r_mb.addChild(r_temp)

    # /api/sled/mb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("mb"))
    r_mb.addChild(r_temp)

    # /api/sled/mb/logs end point
    r_temp = tree("logs", data = get_node_logs("mb"))
    r_mb.addChild(r_temp)

    # Add /api/sled/mezz to represent Network Mezzaine card
    r_mezz = tree("mezz", data = get_node_mezz())
    r_sled.addChild(r_mezz)

    # Add /api/mezz/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("nic"))
    r_mezz.addChild(r_temp)

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

    # /api/mezz/logs end point
    r_temp = tree("logs", data = get_node_logs("nic"))
    r_mezz.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/spb to represent side plane board
    r_spb = tree("spb", data = get_node_spb())
    r_api.addChild(r_spb)

    # Add /api/mezz to represent Network Mezzaine card
    r_mezz = tree("mezz", data = get_node_mezz())
    r_api.addChild(r_mezz)

    # Add servers /api/server[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/spb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("spb"))
    r_spb.addChild(r_temp)

    # /api/spb/bmc end point
    r_temp = tree("bmc", data = get_node_bmc())
    r_spb.addChild(r_temp)

    # /api/spb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("spb"))
    r_spb.addChild(r_temp)

    # /api/spb/logs end point
    r_temp = tree("logs", data = get_node_logs("spb"))
    r_spb.addChild(r_temp)

    # Add /api/mezz/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("nic"))
    r_mezz.addChild(r_temp)

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

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

    return r_api
Ejemplo n.º 4
0
def setup_board_routes(app: Application, write_enabled: bool):

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

    # Add /api/spb to represent side plane board
    r_spb = tree("spb", data=get_node_spb())
    r_api.addChild(r_spb)

    # Add /api/mezz to represent Network Mezzaine card
    r_mezz = tree("mezz", data=get_node_mezz())
    r_api.addChild(r_mezz)

    # Add servers /api/server[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/spb/fruid end point
    r_temp = tree("fruid", data=get_node_fruid("spb"))
    r_spb.addChild(r_temp)

    # /api/spb/bmc end point
    r_temp = tree("bmc", data=get_node_bmc())
    r_spb.addChild(r_temp)

    # /api/spb/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("spb"))
    r_spb.addChild(r_temp)

    # /api/spb/logs end point
    r_temp = tree("logs", data=get_node_logs("spb"))
    r_spb.addChild(r_temp)

    # Add /api/mezz/fruid end point
    r_temp = tree("fruid", data=get_node_fruid("nic"))
    r_mezz.addChild(r_temp)

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

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

    r_api.setup(app, write_enabled)
Ejemplo n.º 5
0
def setup_board_routes(app: Application, write_enabled: bool):

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

    # Add /api/sled to represent entire SLED
    r_sled = tree("sled", data=get_node_sled())
    r_api.addChild(r_sled)

    # Add mb /api/sled/mb
    r_mb = tree("mb", data=get_node_server_2s(1, "mb"))
    r_sled.addChild(r_mb)

    # Add /api/sled/mb/fruid end point
    r_temp = tree("fruid", data=get_node_fruid("mb"))
    r_mb.addChild(r_temp)

    # /api/sled/mb/bmc end point
    r_temp = tree("bmc", data=get_node_bmc())
    r_mb.addChild(r_temp)

    # /api/sled/mb/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("mb"))
    r_mb.addChild(r_temp)

    # /api/sled/mb/logs end point
    r_temp = tree("logs", data=get_node_logs("mb"))
    r_mb.addChild(r_temp)

    r_api.setup(app, write_enabled)
Ejemplo n.º 6
0
def populate_server_node(num):
    prsnt = pal_is_fru_prsnt(num)
    if prsnt == None or prsnt == 0:
        return None

    r_server = tree("server", data = get_node_server(num))
    r_fruid = tree("fruid", data = get_node_fruid("server"))
    r_sensors = tree("sensors", data = get_node_sensors("server"))
    r_logs = tree("logs", data = get_node_logs("server"))
    r_config = tree("config", data = get_node_config("server"))
    r_bios = tree("bios", data = get_node_bios("server"))
    r_server.addChildren([r_fruid, r_sensors, r_logs, r_config, r_bios])

    r_boot_order_trunk = tree("boot-order", data = get_node_bios_boot_order_trunk("server"))
    r_postcode_trunk = tree("postcode", data = get_node_bios_postcode_trunk("server"))
    r_plat_info_trunk = tree("plat-info", data = get_node_bios_plat_info_trunk("server"))
    r_pcie_port_config_trunk = tree("pcie-port-config", data = get_node_bios_pcie_port_config_trunk("server"))
    r_bios.addChildren([r_boot_order_trunk, r_postcode_trunk, r_plat_info_trunk, r_pcie_port_config_trunk])


    r_clear_cmos = tree("clear_cmos", data = get_node_bios_clear_cmos("server"))
    r_force_boot_bios_setup = tree("force_boot_bios_setup", data = get_node_bios_force_boot_setup("server"))
    r_boot_order = tree("boot_order", data = get_node_bios_boot_order("server"))
    r_boot_order_trunk.addChildren([r_clear_cmos, r_force_boot_bios_setup, r_boot_order])

    return r_server
Ejemplo n.º 7
0
def populate_server_node(num):
    prsnt = pal_is_fru_prsnt(num)
    if prsnt == None or prsnt == 0:
        return None

    slot_type = get_slot_type(num)

    if slot_type == 0:
      r_server = tree("server" + repr(num), data = get_node_server(num))
    else :
      r_server = tree("device" + repr(num), data = get_node_device(num))

    r_fruid = tree("fruid", data = get_node_fruid("slot" + repr(num)))
    r_sensors = tree("sensors", data = get_node_sensors("slot" + repr(num)))
    r_logs = tree("logs", data = get_node_logs("slot" + repr(num)))
    r_config = tree("config", data = get_node_config("slot" + repr(num)))
    r_bios = tree("bios", data = get_node_bios("server" + repr(num)))
    r_server.addChildren([r_fruid, r_sensors, r_logs, r_config, r_bios])

    r_boot_order_trunk = tree("boot-order", data = get_node_bios_boot_order_trunk("slot" + repr(num)))
    r_postcode_trunk = tree("postcode", data = get_node_bios_postcode_trunk("slot" + repr(num)))
    r_plat_info_trunk = tree("plat-info", data = get_node_bios_plat_info_trunk("slot" + repr(num)))
    r_bios.addChildren([r_boot_order_trunk, r_postcode_trunk, r_plat_info_trunk])

    r_boot_mode = tree("boot_mode", data = get_node_bios_boot_mode("slot" + repr(num)))
    r_clear_cmos = tree("clear_cmos", data = get_node_bios_clear_cmos("slot" + repr(num)))
    r_force_boot_bios_setup = tree("force_boot_bios_setup", data = get_node_bios_force_boot_setup("slot" + repr(num)))
    r_boot_order = tree("boot_order", data = get_node_bios_boot_order("slot" + repr(num)))
    r_boot_order_trunk.addChildren([r_boot_mode, r_clear_cmos, r_force_boot_bios_setup, r_boot_order])

    return r_server
Ejemplo n.º 8
0
def init_plat_tree():

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

    # Add /api/spb to represent side plane board
    r_spb = tree("spb", data = get_node_spb())
    r_api.addChild(r_spb)

    # Add /api/mezz to represent Network Mezzaine card
    r_mezz = tree("mezz", data = get_node_mezz())
    r_api.addChild(r_mezz)

    # Add servers /api/server[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/spb/fruid end point
    r_temp = tree("fruid", data = get_node_fruid("spb"))
    r_spb.addChild(r_temp)
    # /api/spb/bmc end point
    r_temp = tree("bmc", data = get_node_bmc())
    r_spb.addChild(r_temp)
    # /api/spb/sensors end point
    r_temp = tree("sensors", data = get_node_sensors("spb"))
    r_spb.addChild(r_temp)
    #Add /api/spb/fans end point
    r_temp = tree("fans", data = get_node_fans())
    r_spb.addChild(r_temp)
    # /api/spb/logs end point
    r_temp = tree("logs", data = get_node_logs("spb"))
    r_spb.addChild(r_temp)

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

    return r_api
Ejemplo n.º 9
0
def populate_server_node(num):
    prsnt = pal_is_fru_prsnt(num)
    if prsnt == None or prsnt == 0:
        return None

    r_server = tree("server" + repr(num), data=get_node_server(num))

    r_fruid = tree("fruid", data=get_node_fruid("slot" + repr(num)))

    r_sensors = tree("sensors", data=get_node_sensors("slot" + repr(num)))

    r_logs = tree("logs", data=get_node_logs("slot" + repr(num)))

    r_config = tree("config", data=get_node_config("slot" + repr(num)))

    r_server.addChildren([r_fruid, r_sensors, r_logs, r_config])

    return r_server
Ejemplo n.º 10
0
def populate_server_node(num):
    prsnt = pal_is_fru_prsnt(num)
    if prsnt == None or prsnt == 0:
        return None

    r_server = tree("server" + repr(num), data = get_node_server(num))

    r_fruid = tree("fruid", data = get_node_fruid("slot" + repr(num)))

    r_sensors = tree("sensors", data = get_node_sensors("slot" + repr(num)))

    r_logs = tree("logs", data = get_node_logs("slot" + repr(num)))

    r_config = tree("config", data = get_node_config("slot" + repr(num)))

    r_server.addChildren([r_fruid, r_sensors, r_logs, r_config])

    return r_server
def init_common_tree():

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

    # /api/bmc end point
    r_temp = tree("bmc", data=get_node_bmc())
    r_api.addChild(r_temp)

    # /api/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("all"))
    r_api.addChild(r_temp)

    # /api/logs end point
    r_temp = tree("logs", data=get_node_logs("all"))
    r_api.addChild(r_temp)

    # /api/fans end point
    r_temp = tree("fans", data=get_node_fans())
    r_api.addChild(r_temp)

    return r_api
Ejemplo n.º 12
0
def setup_common_routes(app: Application, write_enabled: bool):

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

    # /api/bmc end point
    r_temp = tree("bmc", data=get_node_bmc())
    r_api.addChild(r_temp)

    # /api/sensors end point
    r_temp = tree("sensors", data=get_node_sensors("all"))
    r_api.addChild(r_temp)

    # /api/logs end point
    r_temp = tree("logs", data=get_node_logs("all"))
    r_api.addChild(r_temp)

    # /api/fans end point
    r_temp = tree("fans", data=get_node_fans())
    r_api.addChild(r_temp)

    r_api.setup(app, write_enabled)
Ejemplo n.º 13
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.º 14
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