cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1492
Views
5
Helpful
4
Replies

Cisco Prime 2.1 problem with API/Client

m.o.andersson_2
Beginner
Beginner

Hi,

 

im having a problem with the API output i get from Cisco Prime Infrastructure. The URL im trying to GET info from is:

https://<URL>/webacs/api/v1/data/Clients

The output shows that im missing data from a specific ID. Example:

{"@url":"https:\/\/prime.lmv.lm.se\/webacs\/api\/v1\/data\/Clients\/1280389614","@type":"Clients","$":"1280389614"}

Then i try to GET the info regarding this ID: https://<URL>/webacs/api/v1/data/Clients/1280389614

{"errorDocument":{"httpResponseCode":500,"httpMethod":"GET","message":"No such entity as Clients \/ 1280389614.-PRS-101","id":"presentation.PRS-101","uriPath":"data\/Clients\/1280389614","queryParams":"{}"}}

So something is wrong here, so when i add ".full=true" parameter i get the following error as it cannot show the client data:

https://<URL>/webacs/api/v1/data/Clients.json?.full=true&.firstResult=1000&.maxResults=1000

{"errorDocument":{"httpResponseCode":500,"httpMethod":"GET","message":"Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientProtocolEnum'; nested exception is org.hibernate.HibernateException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientProtocolEnum'","exception":"org.springframework.orm.hibernate3.HibernateSystemException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientProtocolEnum'; nested exception is org.hibernate.HibernateException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientProtocolEnum'","uriPath":"data\/Clients","queryParams":"{.full=[true], .firstResult=[1000], .maxResults=[1000]}"}}

Any idea how to solve this issue, how can i find the client that is causing this problem? In my script im reading all the clients in the network to a third party application. But right now its hard to get this output in a smart way. It might be resolved in 2.2, but it feels like the data i corrupt in some way so i doubt that this error is related to the version?

Best Regards // Mattias Andersson

1 Accepted Solution

Accepted Solutions

Jimmy Johansson
Beginner
Beginner

Hi,

I have also run into this problem on two different Prime 2.1-systems when trying to get all Client-data available. I haven't figured out a way to fix it more than making small calls (.maxResults=100) then trying to pin-point and skip the ID giving the error. I've been using 2.2 for a while now but haven't tested the Client-API that much yet. I'll experiment some more on it and see if I can recreate the problem to see if it's related to the version.

View solution in original post

4 Replies 4

Jimmy Johansson
Beginner
Beginner

Hi,

I have also run into this problem on two different Prime 2.1-systems when trying to get all Client-data available. I haven't figured out a way to fix it more than making small calls (.maxResults=100) then trying to pin-point and skip the ID giving the error. I've been using 2.2 for a while now but haven't tested the Client-API that much yet. I'll experiment some more on it and see if I can recreate the problem to see if it's related to the version.

Thanks for a quick reply. Well i guess you could make the maxResult smaller, but the script will become much much slower. Also you need to build intellegence to exclude the broken devices. Im guessing that Cisco would like to have a working API :) Maybe there is already an open case regarding this?

m.o.andersson_2
Beginner
Beginner

Answering my own question here, but it seems like the problem was solved when upgrading to PI 2.2! Or if something changed in the client database, im not sure. But now everything seem fine at least. I let you know if the problem will show later on in version 2.2.

 

Cheers!

wrightjeff
Beginner
Beginner

After upgrading from Prime Infrastructure 3.1.6 to 3.2 I am seeing this too. I agree there must be some corruption, but how do I find the client ID? I am guessing 46197 is not the ID, but a point in time API index.

https://ciscoprime/webacs/api/v3/data/ClientDetails.json?.nocount=true&.maxResults=1&.firstResult=46197&.full=true



Exception:
org.springframework.orm.hibernate3.HibernateSystemException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientApModeEnum'; nested exception is org.hibernate.HibernateException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientApModeEnum'

RAW ERROR Message:

{"errorDocument":{"httpResponseCode":500,"httpMethod":"GET","message":"Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientApModeEnum'; nested exception is org.hibernate.HibernateException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientApModeEnum'","exception":"org.springframework.orm.hibernate3.HibernateSystemException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientApModeEnum'; nested exception is org.hibernate.HibernateException: Exception while invoking valueOf method 'getEnum' of enumeration class 'class com.cisco.ncs.nbi.client.ClientApModeEnum'","uriPath":"data/ClientDetails","queryParams":"{.nocount=[true], .maxResults=[1], .firstResult=[46197], .full=[true]}"}}  

 

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: