Rushit Ajudiya (Customer) asked a question.

GET "/api/v1/device-groups/<group_id>/devices/-/config/template?limit=50&options=simple" returns 0 devices even though WhatsUp Gold instance has 1500+ devices across different groups

I want to list all the devices with the WhatsUp Gold REST API. The instance has 1500+ devices across many groups, but for a given group:

  1. GET /api/v1/device-groups/<group_id>/devices/-/config/template?limit=50&options=simple

returns HTTP 200 with an empty data.templates (0 devices). I've tried this for the group IDs returned by GET /api/v1/device-groups/- and get 0 for all of them. What could be the reason behind this, can you please help me to resolve this?

 

Thanks!


  • Mike Rockwell (Progress Software)

    Do you want a list of devices or do you want the template for all devices which will show tons of details about the device?

     

    If you want just a list of devices use ....:9644/api/v1/device-groups/0/devices?view=basic

     

  • Rushit Ajudiya (Customer)

    Hi @Mike Rockwell (Progress Software)​ I retrieved all groups using the /api/v1/device-groups/- endpoint and found 7 groups with IDs: 2, 58, 3, 398, 396, 427, and 0. I then called GET /api/v1/device-groups/<group_id>/devices/-/config/template?limit=50&options=simple for each group ID, but I'm getting the following response:

    1. {
    2. "paging": {
    3. "pageId": "0",
    4. "size": 0
    5. },
    6. "data": {
    7. "deviceCount": 0,
    8. "errors": [],
    9. "templates": []
    10. }
    11. }

    In the WhatsUp Gold UI, I am seeing around 1500 devices. What could be the reason for this behaviour?

    • Mike Rockwell (Progress Software)

      just try this

       

      GET /api/v1/device-groups/<group_id>/devices/-/config/template?limit=50

  • Rushit Ajudiya (Customer)

    Hi @Mike Rockwell (Progress Software)​ I tried by using this API endpoint but still I am getting 0 devices. I have also checked the IDs from /api/v1/device-groups/- endpoint and used GET /api/v1/device-groups/<group_id>/devices/-/config/template?limit=50&options=simple endpoint to fetch devices but still getting below response of 0 devices.

     

    1. {
    2. "paging": {
    3. "pageId": "0",
    4. "size": 0
    5. },
    6. "data": {
    7. "deviceCount": 0,
    8. "errors": [],
    9. "templates": []
    10. }
    11. }

     

     

    • Mike Rockwell (Progress Software)

      What group are you using? GroupID of 0 (zero) is the My Network, but if you don't have any devices in that group ... GroupID 2 is the All Devices Dynamic group, unless you deleted it.