Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Python api for usage reports using os-simple-tenant-usage gives the output as <computeusage> . Please help me rectify this error.

import novaclient.v1_1.client as novaclient import datetime from novaclient.v1_1.client import usage from credentials import get_nova_creds creds = get_nova_creds() nc = novaclient.Client(**creds) now = datetime.datetime.now() later = now + datetime.timedelta(seconds=30) tenant_id = "70ec7525-be04-4c73-9257-e1e8d60b132a" usage_report = nc.usage.list(tenant_id, now.FormatISODate(), later.FormatISODate()) print usage_report

output: <computeusage>

Python api for usage reports using os-simple-tenant-usage gives the output as <computeusage> . Please help me rectify this error.

import novaclient.v1_1.client as novaclient novaclient

import datetime datetime

from novaclient.v1_1.client import usage usage

from credentials import get_nova_creds get_nova_creds

creds = get_nova_creds() get_nova_creds()

nc = novaclient.Client(**creds) novaclient.Client(**creds)

now = datetime.datetime.now() datetime.datetime.now()

later = now + datetime.timedelta(seconds=30) datetime.timedelta(seconds=30)

tenant_id = "70ec7525-be04-4c73-9257-e1e8d60b132a" "70ec7525-be04-4c73-9257-e1e8d60b132a"

usage_report = nc.usage.list(tenant_id, now.FormatISODate(), later.FormatISODate()) later.FormatISODate())

print usage_report

output: <computeusage>

Python api for usage reports using os-simple-tenant-usage gives the output as <computeusage> . Please help me rectify this error.

import novaclient.v1_1.client as novaclient

import datetime

from novaclient.v1_1.client import usage

from credentials import get_nova_creds

creds = get_nova_creds()

nc = novaclient.Client(**creds)

now = datetime.datetime.now()

later = now + datetime.timedelta(seconds=30)

tenant_id = "70ec7525-be04-4c73-9257-e1e8d60b132a"

usage_report = nc.usage.list(tenant_id, now.FormatISODate(), later.FormatISODate())nc.usage.get(tenant_id, now, later)

print usage_report

output: <computeusage>

click to hide/show revision 4
No.4 Revision

Problems accessing os-simple-tenant-usage with Python API

Python api for usage reports using os-simple-tenant-usage gives the output as <computeusage> . Please help me rectify this error.

import novaclient.v1_1.client as novaclient

novaclient import datetime

datetime from novaclient.v1_1.client import usage

usage from credentials import get_nova_creds

get_nova_creds creds = get_nova_creds()

get_nova_creds() nc = novaclient.Client(**creds)

novaclient.Client(**creds) now = datetime.datetime.now()

datetime.datetime.now() later = now + datetime.timedelta(seconds=30)

datetime.timedelta(seconds=30) tenant_id = "70ec7525-be04-4c73-9257-e1e8d60b132a"

"70ec7525-be04-4c73-9257-e1e8d60b132a" usage_report = nc.usage.get(tenant_id, now, later)later) print usage_report

Gives the output:

print usage_report

output: <computeusage>

<ComputeUsage>