Usage
Allowed HTTP methods
Method |
Description |
---|---|
GET |
get / list object/s |
Note
See RFC 2616#section-9 for more details on HTTP methods semantics
Listing
- GET /usage/
Retrieve the usage data for a specific time range. The start and end times are specified using the poll_time_gt (greater than) and poll_time_lt (less than) query parameters, along with an optional limit parameter to define the number of results returned.
- Status Codes:
200 OK – no error
Example request:
GET /api/2.0/usage?poll_time_gt=2024-04-01&poll_time_lt=2024-04-02&limit=1500
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "meta":{ "limit":1500, "offset":0, "total_count":0 }, "objects":[ { "amount":"6000", "poll_time":"2024-10-08T11:52:57.757677+00:00", "resource":"intel_cpu", "uuid":"f493b092-5eef-4a17-bf34-cfaec42f5fb2" }, { "amount":"3221225472", "poll_time":"2024-10-08T11:52:57.757677+00:00", "resource":"intel_mem", "uuid":"f493b092-5eef-4a17-bf34-cfaec42f5fb2" }, { "amount":"3221225472", "poll_time":"2024-10-08T11:52:57.757677+00:00", "resource":"dssd", "uuid":"d73c3226-f53a-4c33-b11f-086ac0349a33" }, { "amount":"6000", "poll_time":"2024-10-08T11:57:57.762428+00:00", "resource":"intel_cpu", "uuid":"f493b092-5eef-4a17-bf34-cfaec42f5fb2" }, { "amount":"3221225472", "poll_time":"2024-10-08T11:57:57.762428+00:00", "resource":"intel_mem", "uuid":"f493b092-5eef-4a17-bf34-cfaec42f5fb2" }, { "amount":"3221225472", "poll_time":"2024-10-08T11:57:57.762428+00:00", "resource":"dssd", "uuid":"d73c3226-f53a-4c33-b11f-086ac0349a33" } ] }
Example:
To retrieve user usage data for the entire day of April 1st, 2024, the query parameters would be set like this:
poll_time_gt=2024-04-01&poll_time_lt=2024-04-02&limit=1500
This request will fetch all usage data between 2024-04-01 00:00:00 and 2024-04-02 00:00:00. The limit=1500 parameter restricts the response to 1500 records.