Ask Your Question
0

Can't access Quantum services via REST requests

asked 2012-11-06 22:46:50 -0500

I can't seem to access the quantum services via the REST requests. The quantum CLI client works just fine. Also the non-quantum REST services work fine with the authentication credentials..

curl -d '{"auth":{"passwordCredentials":{"username": "admin", "password": "os"}}}' -H "Content-type: application/json" http://172.23.220.36:9696/v2.0/networks

Returns <html> <head> <title>401 Unauthorized</title> </head> <body>

401 Unauthorized

This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.

Authentication required

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2012-11-07 15:02:52 -0500

vikasd gravatar image

Akihiro,

When you fetch the token in your example, where did you use them in your rest calls?

edit flag offensive delete link more
0

answered 2012-11-07 07:29:18 -0500

amotoki gravatar image

If your quantum server is configured to use keystone auth (it is default in Folsom), you need to fetch a valid token from keystone before accesing quantum server.

Command lines are here when I tested: http://paste.openstack.org/show/24745/

I hope it will help you.

edit flag offensive delete link more
0

answered 2012-11-07 18:16:42 -0500

amotoki gravatar image

"id" returned by token-get should be passed as X-Auth-Token in REST call.

In my last command line, "X-Auth-Token: dcf3d36161154f9faedcec7d16cc01ff" should be "X-Auth-Token: f21fb6ffde104696ad5a3c854391ce75".

I did a mistake when I prepared the command lines to paste them. I reused the previous command line without updating the token. The previous token "dcf3d36161154f9faedcec7d16cc01ff" is also valid in this case.

edit flag offensive delete link more
0

answered 2012-11-07 20:10:57 -0500

Thanks Akihiro Motoki, that solved my question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-11-06 22:46:50 -0500

Seen: 18 times

Last updated: Nov 07 '12