swift_container_objects
Creates, updates, deletes, gets or lists a swift_container_objects resource.
Overview​
| Name | swift_container_objects |
| Type | Resource |
| Id | ovh.public_cloud_storage.swift_container_objects |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
content_type | string | MIME type of the object content (Content-Type header), for example image/png (wire: contentType) |
etag | string | Entity tag of the object: the MD5 hash of its content, or a hash of the segment hashes for a large object |
key | string | Object key, which is its full path within the container, for example documents/report.pdf |
last_modified_at | string (date-time) | Last modification timestamp of the object (wire: lastModifiedAt) |
retrieval_delay | integer | Seconds to wait before the object becomes readable, only set while retrievalState is UNSEALING (wire: retrievalDelay) |
retrieval_state | string | Retrieval 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) |
size | integer | Object size in bytes |
An object stored in a Swift object storage container
| Name | Datatype | Description |
|---|---|---|
content_type | string | MIME type of the object content (Content-Type header), for example image/png (wire: contentType) |
etag | string | Entity tag of the object: the MD5 hash of its content, or a hash of the segment hashes for a large object |
key | string | Object key, which is its full path within the container, for example documents/report.pdf |
last_modified_at | string (date-time) | Last modification timestamp of the object (wire: lastModifiedAt) |
retrieval_delay | integer | Seconds to wait before the object becomes readable, only set while retrievalState is UNSEALING (wire: retrievalDelay) |
retrieval_state | string | Retrieval 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) |
size | integer | Object size in bytes |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | container_id, key, project_id | Returns the object metadata, without its content. | |
list | select | container_id, project_id | x_pagination_cursor, x_pagination_size, limit, marker, prefix | Returns 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. |
delete | delete | container_id, key, project_id | Deletes 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.
| 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"}}) |
container_id | string | Container ID (wire: containerId) |
key | string | Key |
project_id | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
limit | integer | Maximum number of objects to return. Defaults to 500. At most 500. |
marker | string | Only return objects whose keys sort after this one. Pass the key of the last object of the previous page to get the next page. |
prefix | string | Only return objects whose keys begin with this prefix |
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.
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
;
Returns 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.
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 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 limit = '{{ limit }}'
AND marker = '{{ marker }}'
AND prefix = '{{ prefix }}'
;
DELETE examples​
- delete
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
;