Skip to main content

bills

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

Overview​

Namebills
TypeResource
Idovh.cloud.bills

Fields​

The following fields are returned by SELECT queries:

Project bill

NameDatatypeDescription
bill_idstringBill id (wire: billId)
typestringBill type (creditPurchased, monthlyConsumption, monthlyInstanceActivation)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectfrom, to, service_nameList project bills. Returns the bills of the project between the from and to dates.

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"}})
fromstring (date-time)Get bills from
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
tostring (date-time)Get bills to

SELECT examples​

List project bills. Returns the bills of the project between the from and to dates.

SELECT
bill_id,
type
FROM ovh.cloud.bills
WHERE from = '{{ from }}' -- required
AND to = '{{ to }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;