Skip to main content

object_bucket_lifecycles

Creates, updates, deletes, gets or lists an object_bucket_lifecycles resource.

Overview​

Nameobject_bucket_lifecycles
TypeResource
Idovh.public_cloud_storage.object_bucket_lifecycles

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
rulesarrayArray of lifecycle rules

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbucket_name, project_idReturns the rules that expire objects or move them to another storage class. (Alpha version)
updateupdatebucket_name, project_id, rulesReplaces all lifecycle rules of the bucket. An empty list deletes all rules. (Alpha version)

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"}})
bucket_namestringBucket name (wire: bucketName)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.

SELECT examples​

Returns the rules that expire objects or move them to another storage class. (Alpha version)

SELECT
rules
FROM ovh.public_cloud_storage.object_bucket_lifecycles
WHERE bucket_name = '{{ bucket_name }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

UPDATE examples​

Replaces all lifecycle rules of the bucket. An empty list deletes all rules. (Alpha version)

UPDATE ovh.public_cloud_storage.object_bucket_lifecycles
SET
rules = '{{ rules }}'
WHERE
bucket_name = '{{ bucket_name }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND rules = '{{ rules }}' --required
RETURNING
rules;