Ask Your Question
0

Gnocchi API responses 401 Unauthorised

asked 2018-03-31 05:23:31 -0600

M.Pav gravatar image

updated 2018-04-04 16:26:05 -0600

I have prepaired Gnocchi by documentation at https://gnocchi.xyz/stable_4.2/rest.html. I am using Keystone, but I am not able to make a request.

Sample:

GET http://<serverIP>:8041/v1/metric/0b5aa633-3ebf-49d5-99ad-e78302c41376 HTTP/1.1

Response:

date: Fri, 30 Mar 2018 20:24:26 GMT
server: Apache/2.4.18 (Ubuntu)
www-authenticate: Keystone uri='http://127.0.0.1/identity'
content-length: 114
connection: close
content-type: application/json

{
    "error": {
    "message": "The request you have made requires authentication.",
    "code": 401,
    "title": "Unauthorized"
    }
}

I have OpenStack Queens installed by DevStack script on my Ubuntu 16.

I have only admin credentials, how can i get X-Auth-Token required? Or is the request bad?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-04-04 17:30:29 -0600

updated 2018-04-04 17:33:55 -0600

The easiest way to get a token is the command openstack token issue. Then you put that token into the x-auth-token header of you GET request to Gnocchi.

Getting a token via API is documented at the API guide.

edit flag offensive delete link more

Comments

Meanwhile, i installed version Pike instead Queens. But this answer really helped. Thanks.

M.Pav gravatar imageM.Pav ( 2018-04-05 11:08:04 -0600 )edit

The process to get a token is the same on Queens as any earlier OpenStack version (within reason).

There are, however, two Keystone API versions; the approach taken by v2 is much simpler than v3, but you are more likely to encounter v3, no matter which OpenStack version you have.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-05 22:58:07 -0600 )edit

Definitely use v3 if available. Not only is v2 going away, it suffers from some security issues...

edmondsw gravatar imageedmondsw ( 2018-04-06 08:38:03 -0600 )edit

I use the commandopenstack token issue, still repsonses 401 Unauthorised.Why! How can trouble shooting.

ohofanz gravatar imageohofanz ( 2018-04-26 04:53:22 -0600 )edit

I would start looking for errors in the Keystone and Gnocchi logs, and checking the Gnocchi authentication configuration. If you see nothing in the Keystone logs, your Gnocchi authentication config may reference an incorrect Keystone endpoint, and you should see relevant errors in the Gnocchi log.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-29 17:46:48 -0600 )edit

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

2 followers

Stats

Asked: 2018-03-31 05:21:16 -0600

Seen: 355 times

Last updated: Apr 04