usage_plans
Creates, updates, deletes, gets or lists a usage_plans resource.
Overview​
| Name | usage_plans |
| Type | Resource |
| Id | ovh.cloud.usage_plans |
Fields​
The following fields are returned by SELECT queries:
- get
successful operation
| Name | Datatype | Description |
|---|---|---|
project_id | string | Project ID of the fetched plans (wire: projectId) |
flavors | array | List of consumption details by flavor |
period | object | Requested period |
total_savings | object | Total savings for all the flavors (wire: totalSavings) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | flavor, month, year | Returns, 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.
| 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. |
flavor | string | Flavor to filter plans on |
month | integer | Month of the period to extract plans consumption |
year | integer | Year of the period to extract plans consumption |
SELECT examples​
- get
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 }}'
;