object_bucket_objects
Creates, updates, deletes, gets or lists an object_bucket_objects resource.
Overview​
| Name | object_bucket_objects |
| Type | Resource |
| Id | ovh.public_cloud_storage.object_bucket_objects |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
version_id | string | Identifier of the version (wire: versionId) |
etag | string | Entity tag (hash of the object content). The etag is omitted when isDeleteMarker is true. |
is_common_prefix | boolean | Whether this entry represents a common prefix (virtual directory) (wire: isCommonPrefix) |
is_delete_marker | boolean | Whether this version is a delete marker (wire: isDeleteMarker) |
is_latest | boolean | Whether this is the latest version of the object (wire: isLatest) |
key | string | Object key (path within the bucket) |
last_modified_at | string (date-time) | Last modification timestamp. Omitted when the entry is a common prefix. (wire: lastModifiedAt) |
legal_hold | string | Object legal hold status (OFF, ON) (wire: legalHold) |
lock | object | Object lock retention configuration |
replication_status | string | Replication status of the object (COMPLETED, FAILED, NONE, PENDING, REPLICA) (wire: replicationStatus) |
restore_status | object | Restore status for archived objects (wire: restoreStatus) |
size | integer | Object size in bytes |
storage_class | string | Storage 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) |
An object stored in an S3â„¢ compatible bucket
| Name | Datatype | Description |
|---|---|---|
version_id | string | Identifier of the version (wire: versionId) |
etag | string | Entity tag (hash of the object content). The etag is omitted when isDeleteMarker is true. |
is_common_prefix | boolean | Whether this entry represents a common prefix (virtual directory) (wire: isCommonPrefix) |
is_delete_marker | boolean | Whether this version is a delete marker (wire: isDeleteMarker) |
is_latest | boolean | Whether this is the latest version of the object (wire: isLatest) |
key | string | Object key (path within the bucket) |
last_modified_at | string (date-time) | Last modification timestamp. Omitted when the entry is a common prefix. (wire: lastModifiedAt) |
legal_hold | string | Object legal hold status (OFF, ON) (wire: legalHold) |
lock | object | Object lock retention configuration |
replication_status | string | Replication status of the object (COMPLETED, FAILED, NONE, PENDING, REPLICA) (wire: replicationStatus) |
restore_status | object | Restore status for archived objects (wire: restoreStatus) |
size | integer | Object size in bytes |
storage_class | string | Storage 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | bucket_name, key, project_id | Returns the object metadata, without its content. (Alpha version) | |
list | select | bucket_name, project_id | x_pagination_cursor, x_pagination_size, delimiter, prefix, with_versions | Returns the objects of the bucket. Filter by key prefix, and group keys with a delimiter. (Alpha version) |
update | update | bucket_name, key, project_id | Sets the retention period or the legal hold of the object. A locked object cannot be deleted or overwritten. (Alpha version) | |
delete | delete | bucket_name, key, project_id | Deletes 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.
| 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"}}) |
bucket_name | string | Bucket name (wire: bucketName) |
key | string | Key |
project_id | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
delimiter | string | Delimiter for grouping keys into common prefixes. Defaults to /. |
prefix | string | Filter objects whose keys begin with this prefix |
with_versions | boolean | Include all object versions and delete markers (wire: withVersions) |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
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
;
Returns the objects of the bucket. Filter by key prefix, and group keys with a delimiter. (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 project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
AND delimiter = '{{ delimiter }}'
AND prefix = '{{ prefix }}'
AND with_versions = '{{ with_versions }}'
;
UPDATE examples​
- update
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​
- delete
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
;