我真的很难理解 Ceilometerclient。我不明白为什么它不能识别 auth_token 属性,它写在他们的文档中,我做错了什么
import ceilometerclient
import ceilometerclient.client
import keystoneclient.v2_0.client as ksclient
import ceilometerclient.v2 as c_client
from ceilometerclient import client
OS_USERNAME="username"
OS_PASSWORD="pass"
OS_TENANT_NAME="project"
OS_AUTH_URL="hosturl:5000/v2.0/"
CEILOMETER_ENDPOINT="hosturl:8777"
ceilometer_client= ceilometerclient.client.get_client(2, os_username=OS_USERNAME, os_password=OS_PASSWORD, os_tenant_name=OS_TENANT_NAME, os_auth_url=OS_AUTH_URL)
auth_token = ceilometer_client.auth_token
ceilometer = c_client.Client(endpoint=CEILOMETER_ENDPOINT, token= lambda : auth_token )
meterlist = ceilometer_client.meters.list()
cpu_util_sample = ceilometer.samples.list('cpu_util')
for each in cpu_util_sample:
print each.timestamp, each.resource_id, each.counter_volume
错误
auth_token = ceilometer_client.auth_token
AttributeError: 'Client' object has no attribute 'auth_token'