Developer

 View Only
last person joined: yesterday 

Expand all | Collapse all

API - SHOW LLDP NEIGHBORS - CX 10.0.4

Jump to Best Answer
This thread has been viewed 22 times
  • 1.  API - SHOW LLDP NEIGHBORS - CX 10.0.4

    Posted Dec 07, 2021 12:03 PM
    I'm working on a script to call the API to get output similar to the CLI command "show lldp neighbor-info".  I'd like to get a table similar to the cli output.  It appears the API only allows a per interface call?  Is this correct?  I'd have to loop through all the interfaces, making multiple calls?  I'm looking for a single call with the whole table output.

    I'm looking for this:
     LOCAL-PORT  CHASSIS-ID         PORT-ID                      PORT-DESC                    TTL      SYS-NAME    
    -----------------------------------------------------------------------------------------------------------
    1/3/1       d0:d3:e0:c1:62:e6  d0:d3:e0:c1:62:e6            eth0                         120      SEAP11-1-1                         
    1/3/2       d0:d3:e0:c1:61:c6  d0:d3:e0:c1:61:c6            eth0                         120      SEAP11-1-2                         
    1/3/3       d0:d3:e0:c1:62:b4  d0:d3:e0:c1:62:b4            eth0                         120      SEAP11-1-3                         
    1/3/4       d0:d3:e0:c1:62:2a  d0:d3:e0:c1:62:2a            eth0                         120      SEAP11-1-4


    I'm getting this, for one port only.  Changing interface to 1/3/1-1/3/4 doesn't work.

    /rest/v10.04/system/interfaces/1%2F3%2F1/lldp_neighbors?attributes=neighbor_info&depth=2
    
    {
      "d0:d3:e0:c1:62:e6,d0:d3:e0:c1:62:e6": {
        "neighbor_info": {
          "chassis_capability_available": "Bridge, WLAN",
          "chassis_capability_enabled": "WLAN",
          "chassis_description": "ArubaOS (MODEL: 535), Version Aruba IAP",
          "chassis_id_len": "6",
          "chassis_id_subtype": "link_local_addr",
          "chassis_index": "36",
          "chassis_name": "SEAP11-1-1",
          "chassis_protocol": "LLDP",
          "chassis_refcount": "1",
          "chassis_ttl": "120",
          "eee_wake_time_fallback": 0,
          "eee_wake_time_rx": 0,
          "eee_wake_time_rx_echo": 0,
          "eee_wake_time_tx": 0,
          "eee_wake_time_tx_echo": 0,
          "macphy_autoneg_advertised": "1000 BASE_TFD, 100 BASE_TXFD, Other",
          "macphy_autoneg_enabled": "1",
          "macphy_autoneg_support": "1",
          "macphy_mau_type": " ",
          "mgmt_iface_list": "16",
          "mgmt_iface_oid_list": "0",
          "mgmt_iface_sybtype_list": "2",
          "mgmt_ip_list": "10.130.116.69",
          "port_description": "eth0",
          "port_hidden_in": "0",
          "port_hidden_out": "0",
          "port_id_len": "6",
          "port_id_subtype": "link_local_addr",
          "port_lastchange": "61a58710",
          "port_lastupdate": "61acbd47",
          "port_mfs": "0",
          "port_protocol": "LLDP",
          "power_allocated": 0,
          "power_allocated_pair_a": 0,
          "power_allocated_pair_b": 0,
          "power_requested": 0,
          "power_requested_pair_a": 0,
          "power_requested_pair_b": 0,
          "power_supported": 0,
          "remote_index": 1
        }
      }
    }


    ------------------------------
    Brannen Taylor
    ------------------------------


  • 2.  RE: API - SHOW LLDP NEIGHBORS - CX 10.0.4
    Best Answer

    MVP GURU
    Posted Dec 08, 2021 04:58 PM
    Do you have try to use * (wildcard) ?

    if it is not possible, you need to write a loop and check each port...

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 3.  RE: API - SHOW LLDP NEIGHBORS - CX 10.0.4

    Posted Dec 22, 2021 02:03 PM

    Alexis, thank you - such a simple idea.  Yes, putting the * in for the Interface, results in output for all the interfaces, in a JSON format.  Perfect.  Thank you.

    https://10.130.100.111/rest/v10.04/system/interfaces/%2A/lldp_neighbors?attributes=neighbor_info&depth=2


    ------------------------------
    Brannen Taylor
    ------------------------------



  • 4.  RE: API - SHOW LLDP NEIGHBORS - CX 10.0.4

    MVP GURU
    Posted Dec 22, 2021 02:39 PM
    Perfect :-)

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------