Skip to main content

billing_report_consumptions

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

Overview​

Namebilling_report_consumptions
TypeResource
Idovh.me.billing_report_consumptions

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
task_idstringTask id of the report (wire: taskId)
period_endstring (date)End date of the report period (wire: periodEnd)
period_startstring (date)Start date of the report period (wire: periodStart)
reportstringUrl of the report
statusstringStatus of the report (CREATING, ERROR, READY)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecttask_idRetrieve a consumption billing report with task id
listselectx_pagination_modeRetrieve all billing reports of consumption
createinsertperiod_end, period_startGenerate consumption billing report for a period

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"}})
task_idstringTask ID (wire: taskId)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Retrieve a consumption billing report with task id

SELECT
task_id,
period_end,
period_start,
report,
status
FROM ovh.me.billing_report_consumptions
WHERE task_id = '{{ task_id }}' -- required
;

INSERT examples​

Generate consumption billing report for a period

INSERT INTO ovh.me.billing_report_consumptions (
period_end,
period_start
)
SELECT
'{{ period_end }}' /* required */,
'{{ period_start }}' /* required */
RETURNING
task_id
;