objects
Creates, updates, deletes, gets or lists an objects resource.
Overview​
| Name | objects |
| Type | Resource |
| Id | oci.object_storage.objects |
Fields​
The following fields are returned by SELECT queries:
- list
List of object summaries, including optional prefixes and, in a truncated response, the name of the object to<br />start 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. |
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. |
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 | Lists the objects in a bucket. By default, ListObjects returns object names only. See the fields<br />parameter for other fields that you can optionally include in ListObjects response.<br /><br />ListObjects returns at most 1000 objects. To paginate through more objects, use the returned 'nextStartWith'<br />value with the 'start' parameter. To filter which objects ListObjects returns, use the 'start' and 'end'<br />parameters.<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 /> |
delete | delete | namespaceName, bucketName, objectName, region | if-match, opc-client-request-id, versionId | Deletes an object.<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. |
objectName | string | The name of the object. Avoid entering confidential information. Example: test/object1.log |
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'. |
if-match | string | The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource. |
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. |
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. |
versionId | string | VersionId used to identify a particular version of the object |
SELECT examples​
- list
Lists the objects in a bucket. By default, ListObjects returns object names only. See the fields<br />parameter for other fields that you can optionally include in ListObjects response.<br /><br />ListObjects returns at most 1000 objects. To paginate through more objects, use the returned 'nextStartWith'<br />value with the 'start' parameter. To filter which objects ListObjects returns, use the 'start' and 'end'<br />parameters.<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,
md5,
size,
storageTier,
timeCreated,
timeModified
FROM oci.object_storage.objects
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 }}'
;
DELETE examples​
- delete
Deletes an object.<br />
DELETE FROM oci.object_storage.objects
WHERE namespaceName = '{{ namespaceName }}' --required
AND bucketName = '{{ bucketName }}' --required
AND objectName = '{{ objectName }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-client-request-id = '{{ opc-client-request-id }}'
AND versionId = '{{ versionId }}'
;