title: Trouble with OpenStack Ceilometer client
body: <p>I try to get meters and notifications from OpenStack. For this purpose I want to use Ceilometer (via ceilometerclient). I wrote some code to test these possibilities.</p>
  
  <pre><code>import keystoneclient.v2_0
  import ceilometerclient.v2 as ceilometer
  
  class CloudMessageHandler(object):
  
  def __init__(self, params):
  
      self._client = None
      self._auth_data = self._get_token(params["auth"])
      try:
          print "auth_data = %s" % repr(self._auth_data)
          self._client = ceilometer.Client(endpoint=self._auth_data['endpoint'],
                                           token=self._auth_data['token'])
      except:
          raise Exception("Can't create Ceilometer client.")
  
  def _get_token(self, params):
      try:
          ksclient = keystoneclient.v2_0.Client(username=params["username"],
                                                password=params["password"],
                                                tenant_id=params["tenant_id"],
                                                tenant_name=params["tenant_name"],
                                                auth_url=params["auth_url"])
          token = ksclient.auth_token
          endpoint = ksclient.service_catalog.url_for(service_type="metering",
                                                      endpoint_type=params["endpoint_type"])
          return { "token" : token, "endpoint" : endpoint }
      except IndexError as e:
          raise Exception("Can't get token and endpoint through Keystone API.")
  
  def test(self):
      print "meters = %s" % self._client.meters.list()
      print "resources = %s" % self._client.resources.list()
      print "alarms = %s" % self._client.alarms.list()
  </code></pre>
  
  <p>Output that I get:</p>
  
  <pre><code>auth_data = {'token': u'xxx', 'endpoint': u'http://ip:port'}
  meters = []
  resources = []
  No handlers could be found for logger "ceilometerclient.common.http"
  Traceback (most recent call last):
     ...
     File "/usr/local/lib/python2.7/dist-packages/ceilometerclient/v2/alarms.py", line 53, in     list
       return self._list(options.build_url(self._path(), q))
     File "/usr/local/lib/python2.7/dist-packages/ceilometerclient/common/base.py", line 57, in _list
       resp, body = self.api.json_request('GET', url)
     File "/usr/local/lib/python2.7/dist-packages/ceilometerclient/common/http.py", line 182, in json_request
       resp, body_iter = self._http_request(url, method, **kwargs)
     File "/usr/local/lib/python2.7/dist-packages/ceilometerclient/common/http.py", line 165, in _http_request
      raise exc.from_response(resp)
   ceilometerclient.exc.HTTPNotFound: HTTPNotFound (HTTP 404)
  </code></pre>
  
  <p>What's wrong? I also can't create alarms.
  Can anybody give me an example how I can get notifications about an instance (run/terminate events) via Ceilometer client?</p>