cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4199
Views
10
Helpful
11
Replies

Cisco PI 2.0 API - GET Device Interface Description

m.o.andersson_2
Level 1
Level 1

Hi,

we are using Cisco Prime Infrastructure 2.0 as our central device discovery and inventory for all network equipment. Then we export the database to multiple other systems, primary through the REST API. My question is if anyone have used the PI API to retrive a device interface descriptions?

Looking at the documentation at https://[prime IP]/webacs/api/v1/data/InventoryDetails?_docs you'll see under the value PhysicalPort[] a description field, but it seems like it only get the port name i.e. FastEthernet1/1. Basically the same as the Name field.

Do anyone know how to get the description on an interface through the Cisco PI 2.0 API?

Cheers // Mattias

2 Accepted Solutions

Accepted Solutions

Jimmy Johansson
Level 1
Level 1

If you haven't found it by now you can use the "Interface Details" API to get the description from a port.

View solution in original post

Try specifing the full name of the interface, so instead of Gi0/8 write GigabitEthernet0/8 and also no " " in the URL:

 

https://[URL]/webacs/api/v1/op/statisticsService/interface/details?ipAddress=143.237.147.22&ifName=GigabitEthernet0/8

 

View solution in original post

11 Replies 11

m.o.andersson_2
Level 1
Level 1

Anyone? Is this the right place to ask about Cisco PI API? If not, do anyone know where to get any good answers?

Because the information is obviously in the database, as i can see it in the GUI.

Cheers!

You can access the API information from your own appliance using this link:

https://your-ip-address/webacs/api/v1/

Or download Cisco Prime Infrastructure 2.0 API Reference Guide here :

http://www.cisco.com/en/US/docs/net_mgmt/prime/infrastructure/2.0/APIRef/PI-2.0.zip

-Thanks
Vinod
**Rating Encourages contributors, and its really free. **

-Thanks Vinod **Rating Encourages contributors, and its really free. **

Thanks for the reply. Of course i have red the manual... But i cant seem to find how to extract the interface description. So i was wondering if anyone have tried this and found a way. But if i do not get any reply i assume that it is not implemented at the moment.

Device Interface description was an issue in LMS as well, I am not sure, but it mostly seems not present on the PI as well, so far.

-Thanks
Vinod
**Rating Encourages contributors, and its really free. **

-Thanks Vinod **Rating Encourages contributors, and its really free. **

Because you would think that GET InventoryDetails -> PhysicalPort -> Description would be it... but no, it shows exactly the same thing as "name"!?

PhysicalPort[]

physicalPort

This nested field provides information about the physical ports associated with this device.

TypeAttribute NameDescription

String

description

The port description (i.e. Fast Ethernet Port, etc.).

long

deviceId

An internal id to recognize the device, which is the id of the associated management network element associated with this device.

long

equipmentId

The ID of the equipment object that this port is contained in.

String

name

The name of the port.

String

residingModule

The module that contains the port.

String

vendorEquipmentType

The vendor equipment type.

We have the same problem. Will we get this feature in 2.1?

Thanks.

Alexander

Nope, just upgraded to 2.1 and its the same problem. Here is an example output from our Cisco Prime:

<physicalPort>
<description>GigabitEthernet1/0/14</description>
<deviceId>6275269</deviceId>
<equipmentId>6277272</equipmentId>
<name>GigabitEthernet1/0/14</name>
<residingModule>Switch 1 - WS-C2960S-24TS-L - Fixed Module 0</residingModule>
<vendorEquipmentType>cevPortBaseTEther</vendorEquipmentType>
</physicalPort>
 
As you can see "Description" that you would think is the description set on the port and "Name" is the same value, which i think is a bit strange...
 
Neither does it contain any POST or PUT features as they promised from Cisco Live Milan 2014, i guess it will be in 2.2... riiiight...

Jimmy Johansson
Level 1
Level 1

If you haven't found it by now you can use the "Interface Details" API to get the description from a port.

Thanks for the reply. Haven't had much time to look into this in more detail. Im trying to use the "Interface Details" API, but i only get a HTTP 500 return. Looking at the documentation this should be enough:

 

https://[URL]/webacs/api/v1/op/statisticsService/interface/details?ipAddress="143.237.147.22"&ifName="Gi0/8"

But im not able to get anything back, am i missing something?

Try specifing the full name of the interface, so instead of Gi0/8 write GigabitEthernet0/8 and also no " " in the URL:

 

https://[URL]/webacs/api/v1/op/statisticsService/interface/details?ipAddress=143.237.147.22&ifName=GigabitEthernet0/8

 

This made the trick, and i can see the description. Thanks again! Strange that the documentation includes "". 

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: