Exemple #1
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 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)

    # TODO: Need to add /api/nic to represent NIC Mezz Card

    # 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)

    return r_api
Exemple #2
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
Exemple #3
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)
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