[Openstack] [Gnocchi][Keystone][Identity] Unable to authenticate to access Gnocchi API

Gautham Yajamaan gautham.yejamaan at gmail.com
Thu Nov 30 06:30:50 UTC 2017


Hi Everyone,

*ISSUE*: Unable to authenticate python program to access gnocchi api.

*Request*: Please guide me how to obtain the token and access gnocchi.
Also, Please help with any documentation which will help me in knowing this
process better.

*Description*:

I have installed and running gnocchi for ceilometer. I am successfully able
to obtain measures from the metrics.

Identity service is running authentication. Keystone is not listening on
port 5000 and port 35357.

I was able to work with Postman and manage to get the token and send
request to Gnocchi.

I am trying to use GnocchiClient to access the gnocchi api to get the
measures through my own python program but I am always ending up with
errors such as BadRequest, HTTP 401 and 500 errors.

*In all my attempts, I have no been able to successfully obtain a token and
request gnocchi through program. *

I tried to follow the function *auth.password* for the Identity service and
the below mentioned code to obtain authentication.

>>> from gnocchiclient import auth>>> from gnocchiclient.v1 import client>>>>>> auth_plugin = auth.GnocchiBasicPlugin(user="admin",>>>                                       endpoint="http://localhost:8041")>>> gnocchi = client.Client(session_options={'auth': auth_plugin})>>> gnocchi.resource.list("generic")

>>> from keystoneauth1 import loading>>> from oslo_config import cfg>>> from gnocchiclient import auth>>> from gnocchiclient.v1 import client>>>>>> conf = cfg.ConfigOpts()>>> ...>>> auth_plugin = loading.load_auth_from_conf_options(conf, "gnocchi_credentials")>>> gnocchi = client.Client(session_options={'auth': auth_plugin})>>> gnocchi.resource.list("generic")


-- 
Thanks and Regards
Gautham
+1-206+295+8813
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20171129/0364277f/attachment.html>


More information about the Openstack mailing list