Skip to main content

usage_plans

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

Overview​

Nameusage_plans
TypeResource
Idovh.cloud.usage_plans

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
project_idstringProject ID of the fetched plans (wire: projectId)
flavorsarrayList of consumption details by flavor
periodobjectRequested period
total_savingsobjectTotal savings for all the flavors (wire: totalSavings)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameflavor, month, yearReturns, for each flavor, the savings plan subscriptions, their coverage and utilization over time, and the amount saved. Filter by flavor, year and month.

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.
flavorstringFlavor to filter plans on
monthintegerMonth of the period to extract plans consumption
yearintegerYear of the period to extract plans consumption

SELECT examples​

Returns, for each flavor, the savings plan subscriptions, their coverage and utilization over time, and the amount saved. Filter by flavor, year and month.

SELECT
project_id,
flavors,
period,
total_savings
FROM ovh.cloud.usage_plans
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND flavor = '{{ flavor }}'
AND month = '{{ month }}'
AND year = '{{ year }}'
;