Skip to main content

object_bucket_objects

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

Overview​

Nameobject_bucket_objects
TypeResource
Idovh.public_cloud_storage.object_bucket_objects

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
version_idstringIdentifier of the version (wire: versionId)
etagstringEntity tag (hash of the object content). The etag is omitted when isDeleteMarker is true.
is_common_prefixbooleanWhether this entry represents a common prefix (virtual directory) (wire: isCommonPrefix)
is_delete_markerbooleanWhether this version is a delete marker (wire: isDeleteMarker)
is_latestbooleanWhether this is the latest version of the object (wire: isLatest)
keystringObject key (path within the bucket)
last_modified_atstring (date-time)Last modification timestamp. Omitted when the entry is a common prefix. (wire: lastModifiedAt)
legal_holdstringObject legal hold status (OFF, ON) (wire: legalHold)
lockobjectObject lock retention configuration
replication_statusstringReplication status of the object (COMPLETED, FAILED, NONE, PENDING, REPLICA) (wire: replicationStatus)
restore_statusobjectRestore status for archived objects (wire: restoreStatus)
sizeintegerObject size in bytes
storage_classstringStorage class of the object. Omitted when the entry is a delete marker or a common prefix. (DEEP_ARCHIVE, GLACIER_IR, HIGH_PERF, STANDARD, STANDARD_IA) (wire: storageClass)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbucket_name, key, project_idReturns the object metadata, without its content. (Alpha version)
listselectbucket_name, project_idx_pagination_cursor, x_pagination_size, delimiter, prefix, with_versionsReturns the objects of the bucket. Filter by key prefix, and group keys with a delimiter. (Alpha version)
updateupdatebucket_name, key, project_idSets the retention period or the legal hold of the object. A locked object cannot be deleted or overwritten. (Alpha version)
deletedeletebucket_name, key, project_idDeletes the object. On a versioned bucket, adds a delete marker instead of removing the object. (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)
keystringKey
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
delimiterstringDelimiter for grouping keys into common prefixes. Defaults to /.
prefixstringFilter objects whose keys begin with this prefix
with_versionsbooleanInclude all object versions and delete markers (wire: withVersions)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the object metadata, without its content. (Alpha version)

SELECT
version_id,
etag,
is_common_prefix,
is_delete_marker,
is_latest,
key,
last_modified_at,
legal_hold,
lock,
replication_status,
restore_status,
size,
storage_class
FROM ovh.public_cloud_storage.object_bucket_objects
WHERE bucket_name = '{{ bucket_name }}' -- required
AND key = '{{ key }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

UPDATE examples​

Sets the retention period or the legal hold of the object. A locked object cannot be deleted or overwritten. (Alpha version)

UPDATE ovh.public_cloud_storage.object_bucket_objects
SET
legal_hold = '{{ legal_hold }}',
lock = '{{ lock }}'
WHERE
bucket_name = '{{ bucket_name }}' --required
AND key = '{{ key }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
version_id,
etag,
is_common_prefix,
is_delete_marker,
is_latest,
key,
last_modified_at,
legal_hold,
lock,
replication_status,
restore_status,
size,
storage_class;

DELETE examples​

Deletes the object. On a versioned bucket, adds a delete marker instead of removing the object. (Alpha version)

DELETE FROM ovh.public_cloud_storage.object_bucket_objects
WHERE bucket_name = '{{ bucket_name }}' --required
AND key = '{{ key }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;