Skip to content

Instantly share code, notes, and snippets.

@boris-42
Last active August 29, 2015 14:02
Show Gist options
  • Save boris-42/7fc4abd928cec9698b3e to your computer and use it in GitHub Desktop.
Save boris-42/7fc4abd928cec9698b3e to your computer and use it in GitHub Desktop.
from keystoneclient.v2_0 import client as keystone
from ceilometerclient import client as ceilometer
#CREDENTIALS
auth_url = "http://172.16.52.152:5000/v2.0"
username = "admin"
tenant_name = "admin"
password = "admin"
#GET CEILOMETER CLIENT
kc = keystone.Client(auth_url=auth_url, username=username, password=password, tenant_name=tenant_name)
endpoint = kc.service_catalog.get_endpoints()['metering'][0]
auth_token = lambda: kc.auth_token
ceil = ceilometer.Client(version, endpoint=endpoint["publicURL"], token=auth_token)
#RETRIEVE DATA ABOUT TRACE with $base_id
base_id = 5fa9abb6-71dd-44b3-9e66-bba116fc5d28
ceil.query_samples.query('{"=": {"resource_id": "profiler-%s"}}' % base_id, None, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment