Developer

 View Only
last person joined: 2 days ago 

Expand all | Collapse all

lookup site_id for device serial

This thread has been viewed 1 times
  • 1.  lookup site_id for device serial

    Posted Jul 17, 2020 02:17 PM

    I am currently working on an ansible playbook for when we decommission a branch that will delete all of the equipment from a site and then remove the aforementioned site. I am struggling finding a good way to look up the site_id via the API as the delete site command requires the side_id, but I do not see a way to look up the site_id except by listing all sites. I've learned that looking up a device details with a serial number gives me a site_name, but then there is no way to search sites by site_name.  

     

    Is anyone aware of a way to look up the site_id without listing all sites?

     



  • 2.  RE: lookup site_id for device serial

    MVP GURU
    Posted Jul 18, 2020 04:21 AM

    Hi,

     

    Do you have example of URI do you are using ? for look on swagger ?



  • 3.  RE: lookup site_id for device serial

    Posted Jul 20, 2020 09:50 AM

    I appreciate your response, specifically, this is regarding: https://apigw-prod2.central.arubanetworks.com/swagger/central/#!/Site/sites_external_controller_delete_site 

     

    In order to pull the "site_id", I must first list all sites as it is not displayed in the UI of Aruba Central unless I am missing something.  When we decommission a site, the automated process should disassociate all hardware from the site in Central, delete the site, and then also remove the site from it's configuration group. 

     

    As there is no immediately identifiable site_id listed in Central, we must start by finding the "site_id", and from what I've found in the API, it appears to only be identifiable in the list sites functions of the API.  

    https://apigw-prod2.central.arubanetworks.com/swagger/central/#!/Site/sites_external_controller_get_sites

     

    Identification of each device when queried lists the "site_name" as "site", but does not list the "site_id."   Ideally, i want to be able to query a mac address/serial of a device or the "site_name" and get a response back of which "site_id" each is associated. 



  • 4.  RE: lookup site_id for device serial
    Best Answer

    Posted Jul 23, 2020 01:25 PM

    For now, for our automation, after initial site creation, i'm updating the site name to include the site_id in the name.