What API gives me the data on the overview page

Asked by sak rai

I am looking for the api calls that return data for usgae on the overview page - the area where you would get active instances, active ram, this months vcpus-hours, this months GB hours.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
sak rai
Solved:
Last query:
Last reply:
Revision history for this message
Tiantian Gao (gtt116) said :
#1

The URL is shown below:
v2/{tenant_id}/os-simple-tenant-usage
v2/{tenant_id}/os-simple-tenant-usage/{tenant_id}
The detail usage of the URL is in http://api.openstack.org/.

you can use nova script, too.
#nova usage-list

hope this is helpfull to you.

Revision history for this message
sak rai (sakvinder-rai) said :
#2

Thanks, that is the API call I have been using, the only thing is when you remove all instances the API call comes back with no results. From the UI perspective if all instances are removed on the Horizon dashboard you would still get data back for This Month's VCPU-Hours and This Month's GB-Hours, where does this data come from if v2/{tenant_id}/os-simple-tenant-usage/{tenant_id} has no result when there are no instances.

Revision history for this message
Tiantian Gao (gtt116) said :
#3

Because all instances in database is not actually deleted, we can find out when the instance is created, and when the instance is deleted.

So, although instance is deleted from UI, we can know This Month's usage.

Revision history for this message
sak rai (sakvinder-rai) said :
#4

Thanks. I figured out that I wasn't using dates in the API call, the dates return all data including data for terminated instances.