Skip to main content

swift_container_objects

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

Overview​

Nameswift_container_objects
TypeResource
Idovh.public_cloud_storage.swift_container_objects

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
content_typestringMIME type of the object content (Content-Type header), for example image/png (wire: contentType)
etagstringEntity tag of the object: the MD5 hash of its content, or a hash of the segment hashes for a large object
keystringObject key, which is its full path within the container, for example documents/report.pdf
last_modified_atstring (date-time)Last modification timestamp of the object (wire: lastModifiedAt)
retrieval_delayintegerSeconds to wait before the object becomes readable, only set while retrievalState is UNSEALING (wire: retrievalDelay)
retrieval_statestringRetrieval state of the object, only meaningful in an archive container: SEALED objects must be unsealed before download, UNSEALING objects are being retrieved, UNSEALED objects can be downloaded. Absent in a standard container. (SEALED, UNSEALED, UNSEALING) (wire: retrievalState)
sizeintegerObject size in bytes

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcontainer_id, key, project_idReturns the object metadata, without its content.
listselectcontainer_id, project_idx_pagination_cursor, x_pagination_size, limit, marker, prefixReturns the objects of the container, at most 500 per page. Filter by key prefix, and page with the marker: the key of the last object of the previous page.
deletedeletecontainer_id, key, project_idDeletes the object from the container.

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"}})
container_idstringContainer ID (wire: containerId)
keystringKey
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
limitintegerMaximum number of objects to return. Defaults to 500. At most 500.
markerstringOnly return objects whose keys sort after this one. Pass the key of the last object of the previous page to get the next page.
prefixstringOnly return objects whose keys begin with this prefix
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.

SELECT
content_type,
etag,
key,
last_modified_at,
retrieval_delay,
retrieval_state,
size
FROM ovh.public_cloud_storage.swift_container_objects
WHERE container_id = '{{ container_id }}' -- required
AND key = '{{ key }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

DELETE examples​

Deletes the object from the container.

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