Developer

last person joined: 2 days ago 

Expand all | Collapse all

REST API : value is in json schema but cannot find in any service

Jump to Best Answer
This thread has been viewed 6 times
  • 1.  REST API : value is in json schema but cannot find in any service

    Posted Sep 28, 2020 05:41 AM

    Good day,

    tl;dr: How can I read these values via de API?

    They are in a json schema, but not in a service

     

    I'm interested in reading values such as "power_drawn_in_watts" and "amperage_drawn_in_milliamps" from a POE switch.

     

    I see these are available in a json schema:

    device-api-v7.0-16.10.0010\WC-device-api-v7.0\device-rest-api\schema\wired\PoeStats.json

     

    But this schema does not seem to be used in any service: 

    device-api-v7.0-16.10.0010\WC-device-api-v7.0\device-rest-api\services\server.html

     

    I'm trusting these values are not unavailable via the API. All I can see available is  integer values of power, which is clearly insufficient information for somebody who specifically bought a POE switch and is interested in reading the power out of it.

     

    Thank you.

     

    P.S. I am very new to REST API, so excuse me if my lingo makes no sense.

     

     



  • 2.  RE: REST API : value is in json schema but cannot find in any service

    Posted Sep 28, 2020 03:52 PM

    Hi,

     

    What model of switch ?

    i get this with a 2530

     

    Get-ArubaSWPoEStats -Verbose
    VERBOSE: GET http://192.168.44.241/rest/v4/poe/ports/stats with 0-byte payload
    VERBOSE: received -byte response of content type application/json
                                                                                                                                poe_detection_status  : PPDS_DELIVERING                                                                                     uri                   : /ports/1/poe/stats                                                                                  port_id               : 1                                                                                                   
    port_voltage_in_volts : 55
    power_denied_count    : 0
    over_current_count    : 0
    mps_absent_count      : 0
    short_count           : 0
    actual_power_in_watts : 5
    power_class           : 4


  • 3.  RE: REST API : value is in json schema but cannot find in any service
    Best Answer

    Posted Oct 01, 2020 07:27 AM

    Thanks for your response alagoutte  (btw, I thought I would receive an email notification for a response to my thread, but I did not).

     

    The model is 2930F. I get pretty much the same information as you. I'm guessing the REST API does not offer "amperage_drawn_in_milliamps" (which is a value measured by the switch) and, therefore, the power is only made available in integer values on watts, which is very poor resolution.

     

    I ended up resolving it using the REST CLI and parsing the response, or using SNMP. I ended spending much more time on this that I'd have expected. 

     

    I recommend making the power in milliwatts available in the REST API. 



  • 4.  RE: REST API : value is in json schema but cannot find in any service

    Posted Oct 04, 2020 03:36 PM

    need to ask on innovate zone...



  • 5.  RE: REST API : value is in json schema but cannot find in any service

    Posted Oct 05, 2020 03:35 AM