Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Cisco PI 2.0 API - GET Device Interface Description

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

Everyone's tags (2)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Member

If you haven't found it by

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

Community Member

Try specifing the full name

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

 

11 REPLIES
Community Member

Cisco PI 2.0 API - GET Device Interface Description

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!

Cisco Employee

Cisco PI 2.0 API - GET Device Interface Description

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. **
Community Member

Cisco PI 2.0 API - GET Device Interface Description

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.

Cisco Employee

Cisco PI 2.0 API - GET Device Interface Description

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. **
Community Member

Cisco PI 2.0 API - GET Device Interface Description

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.

Community Member

Cisco PI 2.0 API - GET Device Interface Description

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

Thanks.

Alexander

Community Member

Nope, just upgraded to 2.1

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...
Community Member

If you haven't found it by

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

Community Member

Thanks for the reply. Haven't

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?

Community Member

Try specifing the full name

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

 

Community Member

This made the trick, and i

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

1667
Views
10
Helpful
11
Replies
CreatePlease to create content