Developer

 View Only
  • 1.  REST API to get interface tx_drops

    Posted Sep 09, 2025 10:15 AM

    What is the REST API request that I should use in order to get only the tx_bytes counter?

    When issuing the following:

    curl -k -X GET -b /tmp/cookie --insecure "https://172.16.0.3/rest/v10.04/system/interfaces/1%2F1%2F2?attributes=statistics" -H  "accept: application/json"
    I'm getting the full interface statistics:

    {
      "statistics": {
        "dot1d_tp_port_in_frames": 15063413,
        "ethernet_stats_broadcast_packets": 2459,
        "ethernet_stats_bytes": 29457538689,
        "ethernet_stats_packets": 35776212,
        "ethernet_stats_packets_1024_to_1518_bytes": 6096328,
        "ethernet_stats_packets_128_to_255_bytes": 12636555,
        "ethernet_stats_packets_1519_to_2047_bytes": 11494978,
        "ethernet_stats_packets_256_to_511_bytes": 281157,
        "ethernet_stats_packets_512_to_1023_bytes": 129825,
        "ethernet_stats_packets_64_bytes": 1347,
        "ethernet_stats_packets_65_to_127_bytes": 5136022,
        "ethernet_stats_rx_no_errors": 15063413,
        "ethernet_stats_rx_packets_1024_to_1518_bytes": 125752,
        "ethernet_stats_rx_packets_128_to_255_bytes": 7285340,
        "ethernet_stats_rx_packets_1519_to_2047_bytes": 5939326,
        "ethernet_stats_rx_packets_256_to_511_bytes": 201344,
        "ethernet_stats_rx_packets_512_to_1023_bytes": 65479,
        "ethernet_stats_rx_packets_64_bytes": 21,
        "ethernet_stats_rx_packets_65_to_127_bytes": 1446151,
        "ethernet_stats_tx_no_errors": 20712799,
        "ethernet_stats_tx_packets_1024_to_1518_bytes": 5970576,
        "ethernet_stats_tx_packets_128_to_255_bytes": 5351215,
        "ethernet_stats_tx_packets_1519_to_2047_bytes": 5555652,
        "ethernet_stats_tx_packets_256_to_511_bytes": 79813,
        "ethernet_stats_tx_packets_512_to_1023_bytes": 64346,
        "ethernet_stats_tx_packets_64_bytes": 1326,
        "ethernet_stats_tx_packets_65_to_127_bytes": 3689871,
        "fe_if_in_discard_packets": 34786,
        "if_hc_in_broadcast_packets": 1931,
        "if_hc_in_bytes": 10834874607,
        "if_hc_in_multicast_packets": 2888,
        "if_hc_in_unicast_packets": 15058594,
        "if_hc_out_broadcast_packets": 528,
        "if_hc_out_bytes": 18622664082,
        "if_hc_out_multicast_packets": 8901,
        "if_hc_out_unicast_packets": 20703370,
        "if_in_broadcast_packets": 1931,
        "if_in_multicast_packets": 2888,
        "if_in_non_unicast_packets": 4819,
        "if_in_unicast_packets": 15058594,
        "if_out_broadcast_packets": 528,
        "if_out_multicast_packets": 8901,
        "if_out_non_unicast_packets": 9429,
        "if_out_unicast_packets": 20703370,
        "multicast": 11789,
        "rx_bytes": 10834874607,
        "rx_jumbos": 5939326,
        "rx_packets": 15063413,
        "total_jumbos": 11494978,
        "total_packets_no_errors": 35776212,
        "total_uc_packets": 35761964,
        "tx_bytes": 18622664082,
        "tx_jumbos": 5555652,
        "tx_packets": 20712799
      }

    How can I get only the value for tx_bytes?



    -------------------------------------------


  • 2.  RE: REST API to get interface tx_drops

    Posted Sep 10, 2025 10:55 AM

    Hi,

    Do you have try to use attributes=statistics.tx_bytes ? (may be need to encode dot)

    or you can use yq 



    ------------------------------
    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: REST API to get interface tx_drops

    Posted Sep 11, 2025 10:25 PM

    Hi @tal.madari ! The CX "attributes" feature only filters the first layer of the database/values that are returned - I'm double checking with engineering but from what I'm seeing nested filtering is not supported 



    ------------------------------
    Ti Chiapuzio-Wong (they/them)
    HPE Aruba Networking
    ------------------------------



  • 4.  RE: REST API to get interface tx_drops

    Posted Sep 12, 2025 06:45 PM

    @tal.madari I checked with engineering and they confirmed that those features of attributes/selector/filter etc only apply to the "columns" or the first level of keys of the dictionaries returned



    ------------------------------
    Ti Chiapuzio-Wong (they/them)
    HPE Aruba Networking
    ------------------------------



  • 5.  RE: REST API to get interface tx_drops

    Posted Sep 15, 2025 05:58 AM

    Hi,

    You can try 

    curl -k -X GET -b /tmp/cookie --insecure "https://172.16.0.3/rest/v10.04/system/interfaces/1%2F1%2F2?attributes=statistics" -H  "accept: application/json" | jq -r '.statistics.tx_bytes'

    it will be display only tx_bytes value



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