Skip to main content

object_versions

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

Overview​

Nameobject_versions
TypeResource
Idoci.object_storage.object_versions

Fields​

The following fields are returned by SELECT queries:

List of object version summaries, including optional prefixes and, in a truncated response, the opc-next-page to<br />start the next page of results.<br />

NameDatatypeDescription
namestringThe name of the object. Avoid entering confidential information. Example: test/object1.log
archivalStatestringArchival state of an object. This field is set only for objects in Archive tier. (Archived, Restoring, Restored) (x-obmcs-top-level-enum: #/definitions/ArchivalState)
etagstringThe current entity tag (ETag) for the object.
isDeleteMarkerbooleanThis flag will indicate if the version is deleted or not.
md5stringBase64-encoded MD5 hash of the object data.
sizeinteger (int64)Size of the object in bytes.
storageTierstringThe storage tier that the object is stored in. (Standard, InfrequentAccess, Archive) (x-obmcs-top-level-enum: #/definitions/StorageTier)
timeCreatedstring (date-time)The date and time the object was created, as described in [RFC 2616](https:​//tools.ietf.org/html/rfc2616#section-14.29).
timeModifiedstring (date-time)The date and time the object was modified, as described in [RFC 2616](https:​//tools.ietf.org/rfc/rfc2616#section-14.29).
versionIdstringVersionId of the object.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectnamespaceName, bucketName, regionprefix, start, end, limit, delimiter, fields, opc-client-request-id, startAfter, pageLists the object versions in a bucket.<br /><br />ListObjectVersions returns an ObjectVersionCollection containing at most 1000 object versions. To paginate through<br />more object versions, use the returned opc-next-page value with the page request parameter.<br /><br />To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized,<br />talk to an administrator. If you are an administrator who needs to write policies to give users access, see<br />[Getting Started with Policies](/Content/Identity/Concepts/policygetstarted.htm).<br />

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
bucketNamestringThe name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
namespaceNamestringThe Object Storage namespace used for the request.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
delimiterstringWhen this parameter is set, only objects whose names do not contain the delimiter character (after an optionally specified prefix) are returned in the objects key of the response body. Scanned objects whose names contain the delimiter have the part of their name up to the first occurrence of the delimiter (including the optional prefix) returned as a set of prefixes. Note that only '/' is a supported delimiter character at this time.
endstringReturns object names which are lexicographically strictly less than this parameter.
fieldsstringObject summary by default includes only the 'name' field. Use this parameter to also include 'size' (object size in bytes), 'etag', 'md5', 'timeCreated' (object creation date and time), 'timeModified' (object modification date and time), 'storageTier' and 'archivalState' fields. Specify the value of this parameter as a comma-separated, case-insensitive list of those field names. For example 'name,etag,timeCreated,md5,timeModified,storageTier,archivalState'.
limitintegerFor list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).
opc-client-request-idstringThe client request ID for tracing.
pagestringFor list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).
prefixstringThe string to use for matching against the start of object names in a list query.
startstringReturns object names which are lexicographically greater than or equal to this parameter.
startAfterstringReturns object names which are lexicographically strictly greater than this parameter.

SELECT examples​

Lists the object versions in a bucket.<br /><br />ListObjectVersions returns an ObjectVersionCollection containing at most 1000 object versions. To paginate through<br />more object versions, use the returned opc-next-page value with the page request parameter.<br /><br />To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized,<br />talk to an administrator. If you are an administrator who needs to write policies to give users access, see<br />[Getting Started with Policies](/Content/Identity/Concepts/policygetstarted.htm).<br />

SELECT
name,
archivalState,
etag,
isDeleteMarker,
md5,
size,
storageTier,
timeCreated,
timeModified,
versionId
FROM oci.object_storage.object_versions
WHERE namespaceName = '{{ namespaceName }}' -- required
AND bucketName = '{{ bucketName }}' -- required
AND region = '{{ region }}' -- required
AND prefix = '{{ prefix }}'
AND start = '{{ start }}'
AND end = '{{ end }}'
AND limit = '{{ limit }}'
AND delimiter = '{{ delimiter }}'
AND fields = '{{ fields }}'
AND opc-client-request-id = '{{ opc-client-request-id }}'
AND startAfter = '{{ startAfter }}'
AND page = '{{ page }}'
;