GET

Retrieves an object from the OCI Object Storage.

Syntax

objectstorage get {OPTIONS}

Options

Option Description
Required
-object-name|-on <object-name> Specifies the name of an OCI object within a bucket.
-file|-f <file> Specifies the location of the file to store the object's content.
Optional
-etag|-et <etag> Specifies the entity tag (ETag) to match with the ETag of an existing object. If the specified ETag matches the ETag of the existing object, then the object is downloaded.
-avoid-etag-match|-aem <avoid-etag-match> Specifies the entity tag ( ETag) to avoid matching while retrieving the objects. Retrieves the object only when ETag does not match.
-client-request-id|-cid <client-request-id> Specifies the client request ID to use for tracing.
-namespace|-ns <namespace> Specifies the OCI namespace.

Note:

Omit this option if you previously specified objectstorage set namespace <name> by using the set sub-command.
-bucket-name|-bn <bucket-name> Specifies the OCI bucket name.

Note:

Omit this option if you previously specified objectstorage set bucket-name <name> by using the set sub-command.

Examples

GET an OCI object to download to the file location:
objectstorage object get -namespace ociNamespace -bucket-name
    ociBucketName -object-name someObject.txt -etag
    a1111111-b222-c333-d444-e55555555555 -file /path/to/output.txt
GET an OCI object that matches the entity tag (ETag) and download to the file location:
 objectstorage object get -namespace ociNamespace -bucket-name
    ociBucketName -object-name someObject.txt -etag
    a1111111-b222-c333-d444-e55555555555 -file /path/to/output.txt
GET an OCI object that does not match the entity tag (ETag) and download to the file location:
objectstorage object get -namespace ociNamespace -bucket-name
    ociBucketName -object-name someObject.txt -avoid-etag-match
    a9999999-b888-c777-d444-e66666666666 -file /path/to/output.txt