cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1160
Views
12
Helpful
2
Replies

REST API for Prime profiles

tyhill2014
Level 1
Level 1

Hello All,

I am really new at all of this programming. I have been learning Python and just found out about REST APIs. This afternoon while messing around, I found that using Postman, REST client, I can pull data from our Prime server.

Our Prime server is used for plug-n-play for configuring 819s. We have about 50 profiles that we use. One of the problems I run into on occasion is that an 819 will be placed in the wrong profile and there is not an easy way of finding which profile it is defined to. So the only way to find it is to open each profile and search for the 819. This takes some time.

In using some of the GET commands, I see where I can search on the devices IP address, but the returned results does not show which profile the 819 is assigned to. Is there a REST API resource that I can use to identify by IP address which profile a device is assigned to? Using Get Devices does not give me this information.

TIA,

Ty

2 Replies 2

Spencer Zier
Cisco Employee
Cisco Employee

I'm by no means a PnP expert, but I believe the Prime Infrastructure API supports this since 3.1.5.  So if you're on 3.1, install the latest maintenance release.

You can check to see if the API resources needed are available by checking the following URLs

https://YOUR_SERVER/webacs/api/v1/op/pnp/profile/%7BpnpProfileFolder%7D-GET?_docs

https://YOUR_SERVER/webacs/api/v1/op/pnp/profile/%7BprofileName%7D/instance/-GET?_docs

If you get valid documentation, then you have the right version and patches applied.

First, get the list of profile names for your devices.  Since you're dealing with 819s, the URL to query is

https://YOUR_SERVER/webacs/api/v1/op/pnp/profile/Router

That will return a list of profiles.  Extract the profileNames of interest to you.

Next, issue queries for each profile to get back all of the instances of it.

https://YOUR_SERVER/webacs/api/v1/op/pnp/profile/PROFILE_NAME/instance/

The instances should include the device serial number for each device using the profile.  You can get from the GET data/InventoryDetails resource, which also includes the management IP of the device.

I hope that helps.

Thanks Spencer! I was able to get some information, so now I just need to learn how to extract/search for the information I need. Your help is greatly appreciated.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: