usage_currents
Creates, updates, deletes, gets or lists a usage_currents resource.
Overview​
| Name | usage_currents |
| Type | Resource |
| Id | ovh.cloud.usage_currents |
Fields​
The following fields are returned by SELECT queries:
- get
successful operation
| Name | Datatype | Description |
|---|---|---|
hourly_usage | object | Hourly usage (wire: hourlyUsage) |
last_update | string (date-time) | Entry last update (wire: lastUpdate) |
monthly_usage | object | Monthly usage (wire: monthlyUsage) |
period | object | Usage dates (from/to) |
resources_usage | array | Resource usage (billed per hour/minute/second/unit) (wire: resourcesUsage) |
total_price | object | Total price (wire: totalPrice) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | Returns the usage and price of the project for the current month, by resource type: hourly, monthly and per-unit resources. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
SELECT examples​
- get
Returns the usage and price of the project for the current month, by resource type: hourly, monthly and per-unit resources.
SELECT
hourly_usage,
last_update,
monthly_usage,
period,
resources_usage,
total_price
FROM ovh.cloud.usage_currents
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;