Skip to main content

usage_forecasts

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

Overview​

Nameusage_forecasts
TypeResource
Idovh.cloud.usage_forecasts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
hourly_usageobjectHourly forecast (wire: hourlyUsage)
last_updatestring (date-time)Entry last update (wire: lastUpdate)
monthly_usageobjectMonthly forecast (wire: monthlyUsage)
periodobjectForecast dates (from/to)
resources_usagearrayResource usage forecast (billed per hour/minute/second/unit) (wire: resourcesUsage)
total_priceobjectTotal price (wire: totalPrice)
usable_creditsobjectUsable credit to pay next bill (wire: usableCredits)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameReturns the forecast usage and price of the project at the end of the current month, and the credits that can pay the next bill.

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 forecast usage and price of the project at the end of the current month, and the credits that can pay the next bill.

SELECT
hourly_usage,
last_update,
monthly_usage,
period,
resources_usage,
total_price,
usable_credits
FROM ovh.cloud.usage_forecasts
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;