Skip to main content

usage_currents

Creates, updates, deletes, gets or lists a usage_currents resource.

Overview​

Nameusage_currents
TypeResource
Idovh.cloud.usage_currents

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
hourly_usageobjectHourly usage (wire: hourlyUsage)
last_updatestring (date-time)Entry last update (wire: lastUpdate)
monthly_usageobjectMonthly usage (wire: monthlyUsage)
periodobjectUsage dates (from/to)
resources_usagearrayResource usage (billed per hour/minute/second/unit) (wire: resourcesUsage)
total_priceobjectTotal price (wire: totalPrice)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameReturns 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.

NameDatatypeDescription
api_hoststringThe 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_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.

SELECT examples​

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
;