object_versions
Creates, updates, deletes, gets or lists an object_versions resource.
Overview​
| Name | object_versions |
| Type | Resource |
| Id | oci.object_storage.object_versions |
Fields​
The following fields are returned by SELECT queries:
- list
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 />
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the object. Avoid entering confidential information. Example: test/object1.log |
archivalState | string | Archival state of an object. This field is set only for objects in Archive tier. (Archived, Restoring, Restored) (x-obmcs-top-level-enum: #/definitions/ArchivalState) |
etag | string | The current entity tag (ETag) for the object. |
isDeleteMarker | boolean | This flag will indicate if the version is deleted or not. |
md5 | string | Base64-encoded MD5 hash of the object data. |
size | integer (int64) | Size of the object in bytes. |
storageTier | string | The storage tier that the object is stored in. (Standard, InfrequentAccess, Archive) (x-obmcs-top-level-enum: #/definitions/StorageTier) |
timeCreated | string (date-time) | The date and time the object was created, as described in [RFC 2616](https:​//tools.ietf.org/html/rfc2616#section-14.29). |
timeModified | string (date-time) | The date and time the object was modified, as described in [RFC 2616](https:​//tools.ietf.org/rfc/rfc2616#section-14.29). |
versionId | string | VersionId of the object. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | namespaceName, bucketName, region | prefix, start, end, limit, delimiter, fields, opc-client-request-id, startAfter, page | 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 /> |
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 |
|---|---|---|
bucketName | string | The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1 |
namespaceName | string | The Object Storage namespace used for the request. |
region | string | OCI 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) |
delimiter | string | When 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. |
end | string | Returns object names which are lexicographically strictly less than this parameter. |
fields | string | Object 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'. |
limit | integer | For 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-id | string | The client request ID for tracing. |
page | string | For 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). |
prefix | string | The string to use for matching against the start of object names in a list query. |
start | string | Returns object names which are lexicographically greater than or equal to this parameter. |
startAfter | string | Returns object names which are lexicographically strictly greater than this parameter. |
SELECT examples​
- list
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 }}'
;