cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2238
Views
3
Helpful
3
Replies

Python connection error with Prime Infra 3.2 Rest API

david.mahe
Level 1
Level 1

Hello,

I am trying to test API Rest call with a Prime version 3.2

I face an issue with the authentication: I have : "connection failed 503 Service Unavailable"

My script works with another customer and a Prime 3.1

I even tried the script linked in this post Rest API using Python , Template based provisioning with Cisco Prime Infrastructure Part 2

This script works well with the Prime 3.1 and don't work with my customer on Prime 3.2 (I have the same 503 issue)

So I think it doesn't come from my script.

After a few investigation, I find a difference in the answer of Prime server after sending the credentials to the j_spring_security_check file.

Prime 3.1 is responding to the POST request with an HTTP 302 and location header to an absolute URL : https://myhost/webacs/pages/common/index.jsp?....

Prime 3.2 is responding to the POST request with an HTTP 302 and location header is set to a relative URL: "/webacs/pages/common/index.jsp?&selectedCategory=en"

I think that the Python REQUESTS module doesn't manage to deal with this relative URL.

I have to confirm this.

As a workaround or as a test, I would like to know if we can do something in the Prime configuration to change the behavior and have an absolute URL like before ?

Thank you in advance if someone could help.

3 Replies 3