Getting error while trying to get POD details through curl

pranjalic
Participant II

We are trying to execute below curl command from Management Server to get details of our Organisation but getting below response.Please help if anyone knows what is missing in the curl?

curl -u adminEmail:pword http://ms_IP:8080/v1/servers?pod=gateway
<br>O/P :<br>403 forbidden
Solved Solved
0 5 212
1 ACCEPTED SOLUTION

pranjalic
Participant II

@Shwetha R Yermal @santosh_ghalsasi

Hello @Maruti, Yes I am using Admin email and password.

When I am executing other Management API calls , they are working fine. I have listed some of the calls which are working :

curl -v -u adminEmail:pword "http://ms_IP:8081/v1/servers/self"
curl -v -u adminEmail:pword "http://ms_IP:8082/v1/servers/self"

View solution in original post

5 REPLIES 5

Not applicable

Hi @Pranjali, The API is correct but are you sure you using the admin email?
adminEmail is the email address of your sysadmin user.

Hi @Maruti Chand ,

you are correct, we were inadvertently using org admin credentials instead of sys admin credentials. Now we are able to get output using sys admin credentials.

Thanks,

Santosh

pranjalic
Participant II

@Shwetha R Yermal @santosh_ghalsasi

Hello @Maruti, Yes I am using Admin email and password.

When I am executing other Management API calls , they are working fine. I have listed some of the calls which are working :

curl -v -u adminEmail:pword "http://ms_IP:8081/v1/servers/self"
curl -v -u adminEmail:pword "http://ms_IP:8082/v1/servers/self"

Can you try /v1/users or /v1/regions? Usually a 401 indicates bad credentials and 403 indicates missing permissions. You can look at /v1/users/<email>/userroles to confirm that the "sysadmin" role is assigned to the user.

Hello @Paul

Thank you for the solution. We tried with the way you aksed us to do and we got sysadmin and Orgadmin details. So we used sysadmin credentials and it worked.

Previously we were using Org admin credentials.

curl -v -u email:passwd http://ms_IP:8080/v1/users/"email"/userroles