Developer

 View Only
last person joined: 12 days ago 

Expand all | Collapse all

how to get subscription key of device by device_serial

This thread has been viewed 30 times
  • 1.  how to get subscription key of device by device_serial

    Posted Jul 16, 2024 08:07 AM

    I find this api to get my all subscriptions key

    curl --location 'https://api-ap.central.arubanetworks.com/platform/licensing/v1/subscriptions' \
    --header 'Accept: application/json'

    but it's impossible to asscoicate these keys with devices.



  • 2.  RE: how to get subscription key of device by device_serial

    EMPLOYEE
    Posted Jul 16, 2024 10:39 AM

    Assigning a Device Serial to a dedicated Subscription Key is not available as of today. But that is somthing that is comming.




  • 3.  RE: how to get subscription key of device by device_serial

    Posted Jul 16, 2024 11:43 PM

    I'm sorry, my English is very poor and you may misunderstand me. I just want to know the information about the subscription key of a device.

    十分抱歉,我的英文非常差,让你产生了误解。我只是想知道某个设备的订阅钥匙的相关信息。




  • 4.  RE: how to get subscription key of device by device_serial

    Posted Jul 17, 2024 04:43 AM

    pycentral  module licensing has function Subscription and it will return subscription keys. Module   device_inventory has a function that will return device inventory with subscription keys.

    You can also use direct url to get the same data:

    /platform/device_inventory/v1/devices?limit=100&sku_type=all

    Then it is just a simple search over serial number or device name to get subscription key assigned to it.

    Best, Gorazd



    ------------------------------
    Gorazd Kikelj
    MVP Guru 2024
    ------------------------------



  • 5.  RE: how to get subscription key of device by device_serial

    Posted Jul 18, 2024 04:35 AM

    Thank you very much for your answer. It is too complicated for me to directly obtain the inventory device list, but I can't find a more suitable API.




  • 6.  RE: how to get subscription key of device by device_serial

    Posted Jul 19, 2024 05:15 AM
      |   view attached

    Here is a quick and dirty python script. It will collect inventory data from central and return AP details with Subscription keys in CSV format.

    To run it you need to have pycentral installed.

    Update dictionary central_info with your central account info.

    Run it with

    python ap_inventory.py > my_ap.csv

    Then you can easily manipulate csv file.

    Best, Gorazd



    ------------------------------
    Gorazd Kikelj
    MVP Guru 2024
    ------------------------------

    Attachment(s)

    zip
    ap_inventory.zip   1 KB 1 version