3 Managing Objects in Object Storage Classic

This section provides documentation about managing objects in Object Storage Classic.

Topics:

Typical Workflow for Managing Objects

Use the following table as a guide to the workflow for managing objects. If you have not yet subscribed to or set up your service, see Workflow for Getting Started with Oracle Cloud Infrastructure Object Storage Classic.

Task Description More Information

Access the service

Access the service through the REST API.

To know more about accessing the service using other interfaces, see Interfaces to Object Storage Classic.

Accessing Object Storage Classic

Generate an authentication token

Generate an authentication token if you are accessing the service through the REST API interface. If you are accessing the service through Java library, the authentication token would be automatically generated and applied.

Authenticating Access When Using the REST API

List containers

List containers in an account.

Listing Containers

List objects within a container

List objects within a specified container.

Listing Objects in a Container

Create objects

Create a single object, bulk create objects and upload files larger than 5GB.

Creating a Single Object

Get object metadata

Retrieve information about an object in a container.

Getting Object Metadata

Restore archived objects

To download an archived object, the object must first be restored.

Restoring Archived Objects

Download objects

Download an object's metadata and data.

Downloading Objects

Delete objects

Delete and bulk delete objects.

Deleting Objects

Update object metadata

Update custom metadata and special metadata.

Updating Object Metadata

Copy objects

Copy an object to another object.

Copying Objects

Encrypt objects

Transparently encrypt objects with the Java library before uploading.

Encrypting Objects

Roles Required for Managing Objects in Object Storage Classic

Users with the Storage Administrator role can create, read, update, and delete all containers and objects for the service instance.

  • Tasks that cause changes to containers and objects require the Storage_ReadWriteGroup role or a custom role in the associated container's X-Container-Write Access Control List (ACL).
  • Tasks that do not cause changes to containers and objects require the Storage_ReadOnlyGroup role or a custom role in the associated container's X-Container-Read ACL.

For more information about roles and ACLs, see About Oracle Cloud Infrastructure Object Storage Classic Roles and Users.

Listing Objects in a Container

All objects within a container can be listed.

Any user with the Service Administrator role or a role that is specified in the X-Container-Read ACL of the container can perform this task.

You can list objects in a container by using the following interfaces:
Interface Resources

Web Console

(Not available on Oracle Cloud at Customer)
See Listing Objects in a Container Using the Web Console.

RESTful API

See Show container details and List Objects in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic.

Java Library

See listObjects in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See listObjects in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See Listing Objects in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

Listing Objects in a Container Using the Web Console

(Not available on Oracle Cloud at Customer)
  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.

    The list of containers is displayed.

  2. Select the container for which you want to list objects.

    The objects in the container are listed.

Listing Objects in a Container Using the REST API

Objects are sorted by their names lexicographically, using memcmp(). All objects, up to 10000 by default, will be returned in the list, unless you filter the list by using any of the following parameters:

  • limit: Limit the number of objects listed to the specified value. The default and maximum value is 10000.
  • marker: Return objects with names greater than the specified string.
  • end_marker: Return objects with names less than the specified string.
  • format: Return extended information about each returned object in either xml or json format (REST API only).
  • prefix: Return objects with names that start with the specified string.
  • delimiter: Return objects with names that include the specified character. Only the substring of object names before the specified character are returned. Only unique substrings are returned.
    • If the prefix parameter is also used, any matches of the specified delimiter character are ignored.
    • Used to emulate directory structures within a container (that is, with a forward slash (/) as the delimiter).

cURL Command Syntax

curl -v -X GET \
     -H "X-Auth-Token: token" \
     accountURL/containerName[?query_parameter=value]

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X GET \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/myContainer?limit=15
    

    Note:

    The URL of the account in this example is https://acme.storage.oraclecloud.com/v1/Storage-acme. Replace this URL with the URL for your account. For the steps to find out your account URL, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources.

    The following is an example of the output of this command:

    > GET /v1/Storage-acme/FirstContainer HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tk4af5123f84d2e3ffb9e77ba657ac8edf
    >
    < HTTP/1.1 200 OK
    < Date: Mon, 09 Mar 2015 11:15:50 GMT
    < Content-Length: 63
    < X-Container-Object-Count: 4
    < X-Container-Write: myIdentityDomainID.Storage.Storage_ReadWriteGroup
    < Accept-Ranges: bytes
    < X-Timestamp: 1425033529.95392
    < X-Container-Read: myIdentityDomainID.Storage.Storage_ReadOnlyGroup,myIdentityDomainID.Storage.Storage_ReadWriteGroup
    < X-Container-Bytes-Used: 92095
    < Content-Type: text/plain; charset=utf-8
    < X-Trans-Id: tx23ba568df8864b45bc443-0054fd80e6
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    <
    Backup-2-0_24680
    Backup-3-0_32872
    MetadataLog-0_32872
    test.key
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X GET \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/myContainer?limit=15
    

    Note:

    The URL of the account in this example is https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365. Replace this URL with the URL for your account. For the steps to find out your account URL, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources.

    The following is an example of the output of this command:

    > GET /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tk4af5123f84d2e3ffb9e77ba657ac8edf
    >
    < HTTP/1.1 200 OK
    < Date: Mon, 09 Mar 2015 11:15:50 GMT
    < Content-Length: 63
    < X-Container-Object-Count: 4
    < X-Container-Write: myIdentityDomainID.Storage.Storage_ReadWriteGroup
    < Accept-Ranges: bytes
    < X-Timestamp: 1425033529.95392
    < X-Container-Read: myIdentityDomainID.Storage.Storage_ReadOnlyGroup,myIdentityDomainID.Storage.Storage_ReadWriteGroup
    < X-Container-Bytes-Used: 92095
    < Content-Type: text/plain; charset=utf-8
    < X-Trans-Id: tx23ba568df8864b45bc443-0054fd80e6
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    <
    Backup-2-0_24680
    Backup-3-0_32872
    MetadataLog-0_32872
    test.key
    

Creating Objects

Objects must be created within a container. You can create a single object or upload multiple objects to a container.

Creating a Single Object

Objects must be created within a container. Objects can be created by uploading files and/or specifying metadata.

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can perform this task. You can create objects in a standard or archive container.

You can create objects in a container by using the following interfaces:
Interface Resources

Web Console

(Not available on Oracle Cloud at Customer)

See Creating a Single Object Using the Web Console.

RESTful API

See

Java Library

See storeObject in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See upload in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See Uploading an Object in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

For the steps to upload multiple objects in a single operation, see Uploading Multiple Objects in a Single Operation.

Creating a Single Object Using the Web Console

(Not available on Oracle Cloud at Customer)
  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
  2. Select the container in which you would like to upload an object.
  3. Select Enable Upload and Download in the Container Information pane.

    The following message appears:

    In order to upload and download objects to the current container, this application must enable Cross-Origin Resource Sharing (CORS) for this domain domainName.
    You can disable this setting at anytime. 
    Would you like to continue?
  4. Click OK to enable Cross-Origin Resource Sharing (CORS).

    The Upload Objects button is enabled.

    Note:

    You can disable CORS in the container at any time. Select Disable Upload and Download in the Container Information pane to disable CORS. You can’t upload objects to the container if CORS is disabled.
  5. Click Upload Objects and select the object to be uploaded.

    Note:

    Ensure that the object name complies with the input restrictions mentioned in Character Restrictions.

    The upload progress and upload status of the object is displayed.

    After the object is uploaded, the object details (Last Modified and Size) are displayed.

Creating a Single Object Using the REST API

cURL Command Syntax

curl -v -X PUT \
     -H "X-Auth-Token: token" \
     -T file \
     accountURL/containerName/objectName

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

To schedule automatic deletion of objects, include the X-Delete-After or X-Delete-At header. See Scheduling Automatic Deletion of Objects.

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -T myFile.txt \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myObject
    

    The following is an example of the output of this command:

    > PUT /v1/Storage-acme/FirstContainer/myObject HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    > Content-Length: 23
    > Expect: 100-continue
    >
    * Done waiting for 100-continue
    < HTTP/1.1 201 Created
    < Date: Mon, 09 Mar 2015 11:26:57 GMT
    < Last-Modified: Mon, 09 Mar 2015 11:26:58 GMT
    < Content-Length: 0
    < Etag: 846fa9d298be05e5f598703f0c3d6f51
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: tx2a97f34acb7048679ae3b-0054fd8381
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -T myFile.txt \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject
    

    The following is an example of the output of this command:

    > PUT /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    > Content-Length: 23
    > Expect: 100-continue
    >
    * Done waiting for 100-continue
    < HTTP/1.1 201 Created
    < Date: Mon, 09 Mar 2015 11:26:57 GMT
    < Last-Modified: Mon, 09 Mar 2015 11:26:58 GMT
    < Content-Length: 0
    < Etag: 846fa9d298be05e5f598703f0c3d6f51
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: tx2a97f34acb7048679ae3b-0054fd8381
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    

Uploading Multiple Objects in a Single Operation

You can create multiple objects in a single operation by uploading an archive file containing multiple files and directories.

Note:

The term archive in this topic refers to files in the .tar, .tar.gz, or tar.bz2 format. It does not refer to the Archive storage class. Bulk-creating objects in an Archive container is not supported.

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can perform this task.

To bulk-create objects:

  1. Create a local archive (.tar, .tar.gz, or tar.bz2) of the files and directories to be stored.
    • The top-level directory will be stored as a container; nested directories will be represented in object names.
    • Files will be stored as objects.

    Example archive file contents:

    $ tar -tzf myfiles.tar.gz
    
    bulktest-files/
    bulktest-files/file1.txt
    bulktest-files/file2.txt
    bulktest-files/file3.txt
    
  2. Upload the archive.
    • Upload the file to the account URL. Specify the archive type by using the ?extract-archive request parameter.
    • The response indicates the number of files created and any errors, if any.

    cURL Command Examples

    Sample Cloud account with the following details:
    • Account name: acme
    • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
    • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

      Note:

      The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
    • Using the REST Endpoint URL obtained from the REST Endpoint field:
      $ curl -v -X PUT 
             -H "X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831" \
             "https://acme.storage.oraclecloud.com/v1/Storage-acme/?extract-archive=tar.gz" \
             --data-binary @myfiles.tar.gz
      
      > PUT /v1/Storage-acme/?extract-archive=tar.gz HTTP/1.1
      > Host: acme.storage.oraclecloud.com
      > Accept: */*
      > X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831
      > Content-Length: 214
      > Content-Type: application/x-www-form-urlencoded
      
      < HTTP/1.1 200 OK
      < Date: Thu, 12 Dec 2013 14:56:18 GMT
      < Content-Type: text/plain
      < Transfer-Encoding: chunked
      
      Number Files Created: 3
      Response Body: 
      Response Status: 201 Created
      

      Note:

      For the result of the operation, look at the response body (not the returned status code).
    • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

      This cURL command example applies to the accounts created after November 2017.

      $ curl -v -X PUT 
             -H "X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831" \
             "https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/?extract-archive=tar.gz" \
             --data-binary @myfiles.tar.gz
      
      > PUT /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/?extract-archive=tar.gz HTTP/1.1
      > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
      > Accept: */*
      > X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831
      > Content-Length: 214
      > Content-Type: application/x-www-form-urlencoded
      
      < HTTP/1.1 200 OK
      < Date: Thu, 12 Dec 2013 14:56:18 GMT
      < Content-Type: text/plain
      < Transfer-Encoding: chunked
      
      Number Files Created: 3
      Response Body: 
      Response Status: 201 Created
      

      Note:

      For the result of the operation, look at the response body (not the returned status code).
You can create multiple objects in a single operation by using the following different interfaces:
Interface Resources

RESTful API

See Bulk Operations in OpenStack Object Storage Service API Reference.

File Transfer Manager API

See uploadMultipleFiles in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See Uploading an Object in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

Uploading Large Objects

A single object can hold up to 5 GB of data, but multiple objects can be linked together to hold more than 5 GB of contiguous data. You can create small objects as segments and upload them as one large object by using a manifest object.

Note:

A large object can have a maximum of 2048 segments. Each segment can be up to 5 GB. So the maximum size of a file that you can upload to Oracle Cloud Infrastructure Object Storage Classic as a large object is 10 TB.

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can perform this task.

You can upload large objects in a container by using the following interfaces:
Interface Resources

Web Console

(Not available on Oracle Cloud at Customer)

See Uploading a Large Object Using the Web Console.

RESTful API

File Transfer Manager API

See upload in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See Uploading Files in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

Uploading a Large Object Using the Web Console

(Not available on Oracle Cloud at Customer)
  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
  2. Select the container in which you would like to upload a large object.
  3. Select Enable Upload and Download in the Container Information pane.

    The following message appears:

    In order to upload and download objects to the current container, this application must enable Cross-Origin Resource Sharing (CORS) for this domain domainName.
    You can disable this setting at anytime. 
    Would you like to continue?
  4. Click OK to enable Cross-Origin Resource Sharing (CORS).

    The Large Object Upload button is enabled.

    Note:

    You can disable CORS in the container at any time. Select Disable Upload and Download in the Container Information pane to disable CORS. You can’t upload objects to the container if CORS is disabled.
  5. Click Large Object Upload and select the large object to be uploaded.

    The upload progress of all the segment objects is displayed.

    After the uploads are complete, the details (Last Modified and Size) are displayed for the manifest object and segment objects.

Uploading a Large Object Using the REST API

To upload a large object:

  1. Segment the large file locally into multiple sequential segment files, each smaller than 5 GB.

    On Linux, for example, you can use the following command:

    split -b 10m file_name segment_name

  2. List all the segment files.

    ls —al segment_name*

  3. Create objects from each segment file. Upload all the objects in the same container.
    curl -v -X PUT \
            -H "X-Auth-Token:token" \
            -T segmentName \
            accountURL/containerName/objectName
  4. Create a manifest file in JSON format, where each element contains the following attributes:
    • path: The container and object name in the format:

      containerName/segmentObjectName

    • etag: MD5 checksum of the segment object.

      You can find the value from the Etag header of the segment object.

    • size_bytes: Size of the segment object.

      You can find the value from the Content-Length header of the segment object.

    Ensure that the manifest file contains these three attributes for each segment object.

    Sample manifest file:

    [
        {
            "path": "FirstContainer/segment_aa",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        {
            "path": "FirstContainer/segment_ab",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        {
            "path": "FirstContainer/segment_ac",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        {
            "path": "FirstContainer/segment_ad",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        
        ...    
        {
            "path": "FirstContainer/segment_aj",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        }
    ]
  5. Upload the manifest file that you just created. In the URI, include the ?multipart-manifest=put query parameter.
    curl -v -X PUT \
            -H "X-Auth-Token:token" \
            "accountURL/containerName/LargeFileName?multipart-manifest=put" \
            -T ./fileName.json
    • LargeFileName is the name of the large object
    • fileName.json is the name of the manifest file
    • ?multipart-manifest=put is the query parameter to upload the manifest file
  6. Check the size of the large object.
    curl -v -X HEAD \
            -H "X-Auth-Token:token" \
            accountURL/containerName/LargeObjectName

    The size of the large object is the total size of all the segment objects. To download a large object, see Downloading Large Objects.

Example:

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.

The REST Endpoint URL for the sample Cloud account is used in the steps below. To use the REST Endpoint (Permanent) URL, replace https://acme.storage.oraclecloud.com/v1/Storage-acme with https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365.

  1. Segment the large file locally into multiple sequential segment files, each smaller than 5 GB:

    split -b 10m myLargeFile.zip segment_

  2. List all the segment files:

    ls —al segment_*

    segment_aa
    segment_ab
    segment_ac
    segment_ad
    segment_ae
    segment_af
    segment_ag
    segment_ah
    segment_ai
    segment_aj
  3. Create objects from each segment file (segment_aa, segment_ab...segment_aj), preserving the segment file names. Upload all the objects in the same container FirstContainer. Here’s an example for one of the segment files:
    curl -v -X PUT \
             -H "X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650" \
             -T segment_aa 
             https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/segment_aa

    The following is the output of this command:

    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkc9305a46ebaa0585c4c7ae063c844f0b
    > Content-Length: 10485760
    > Expect: 100-continue
    >
    < HTTP/1.1 100 Continue
    * We are completely uploaded and fine
    < HTTP/1.1 201 Created
    < Date: Tue, 15 Dec 2015 10:18:26 GMT
    < Last-Modified: Tue, 15 Dec 2015 10:17:21 GMT
    < X-Trans-Id: tx85da332ec5ae4852b7d8c-00566fe8b0ga
    < Etag: f1c9645dbc14efddc7d8a322685f26eb
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1450174640.10123
    < Content-Type: text/html;charset=UTF-8
    < Content-Length: 0
    <
    
  4. Create a manifest file in JSON format.

    Sample manifest file:

    [
        {
            "path": "FirstContainer/segment_aa",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        {
            "path": "FirstContainer/segment_ab",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        {
            "path": "FirstContainer/segment_ac",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        {
            "path": "FirstContainer/segment_ad",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        },
        
        ...    
        {
            "path": "FirstContainer/segment_aj",
            "etag": "f1c9645dbc14efddc7d8a322685f26eb",
            "size_bytes": 10485760
        }
    ]
  5. Upload the manifest file. Add the query parameter ?multipart-manifest=put to upload the manifest file.
    curl -v -X PUT \
            -H "X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650" 
            "https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myLargeFile.manifest?multipart-manifest=put" \
            -T ./manifest.json
    
  6. Download the large object by sending a GET request. All the segment objects are concatenated and downloaded as one large object.
    curl -v -X GET \
            -H "X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650" 
            https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myLargeFile.manifest \
            -o ./myLargeFile
    

    Download the manifest object by sending a GET request and add the query parameter ?multipart-manifest=get.

    curl -v -X GET \
            -H "X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650" 
            "https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myLargeFile.manifest?multipart-manifest=get" \
            -o ./manifestFile
  7. Run a HEAD request to view the size of the large object (myLargeFile) that you created:
    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tkbaebb60dfa5b80d84e62b0d5d07031e5" 
    		 https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myLargeFile

    The following is the output of this command:

    > HEAD /v1/Storage-acme/FirstContainer/myLargeFile HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkc9305a46ebaa0585c4c7ae063c844f0b
    < Etag: "e6da53c20abee5c471fe8bf796abb1a4"
    < Accept-Ranges: bytes
    < Last-Modified: Tue, 15 Dec 2015 10:07:53 GMT
    < X-Timestamp: 1455012472.56679
    < X-Trans-Id: txcab964b91ba8474ca9193-0056b9bb6fga
    < Date: Tue, 15 Dec 2015 10:12:00 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1455012472.56679
    < Content-Type: application/octet-stream;charset=UTF-8
    < Content-Length: 104857600
    curl: (18) transfer closed with 52428800 bytes remaining to read
    

    You can view the size of the large object in the header Content-Length. The size of the large object is the sum total of the sizes of the segment objects. To download the large object, see Downloading Large Objects.

Making an Object Immutable

You can make an object immutable by setting it’s Write-Once-Read-Many (WORM) policy when uploading it to the container to prevent the users from modifying or deleting it for a specified duration.

Once you’ve set an object’s WORM policy, you cannot change it. When the WORM policy expires, you can delete the object but can’t modify it or it’s metadata. If the container to which you intend to upload the object has a WORM policy, then the duration of the object-level WORM policy must be equal to or higher than the duration of the container-level policy. To learn more about setting a container’s WORM policy, see Making Objects in a Container Immutable.

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can set the object’s WORM policy headers X-Worm-Expiration-Days and X-Worm-Expiration-At.

For information about using the REST API to set the object metadata, see Create or Replace Object in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic.

cURL Command Syntax

To set the WORM policy of an object by specifying the duration of validity of the policy:

curl -v -X PUT \
     -H "X-Auth-Token: token" \
     -H "X-Worm-Expiration-Days: period" \
     -H "Content-Length: length"
     accountURL/containerName/objectName

To set the WORM policy of an object by setting the expiration time:

curl -v -X PUT \
     -H "X-Auth-Token: token" \
     -H "X-Worm-Expiration-At: time" \
     -H "Content-Length: length"
     accountURL/containerName/objectName
  • token is the authentication token obtained earlier from Oracle Cloud Infrastructure Object Storage Classic. See Authenticating Access When Using the REST API.
  • period is the duration, in days, for which the WORM policy is set for the container.
  • time is the UNIX Epoch timestamp representing the date and time at which the WORM policy must expire. For example, 1481364600 represents December 10, 2016 10:10:00 GMT. See http://epochconverter.com.

    This value must be greater than the current Epoch time.

  • length is the size of the object.
  • For the syntax of accountURL, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources.
  • containerName is the name of the container to which the object must be uploaded.
  • objectName is the name of the object for which the WORM policy must be set.

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

For information about getting object metadata, see Getting Object Metadata.

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.

The REST Endpoint URL for the sample Cloud account is used in all the cURL command examples in this section. To use the REST Endpoint (Permanent) URL, replace https://acme.storage.oraclecloud.com/v1/Storage-acme with https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365.

  • This command sets the WORM policy of 4 days for the object FirstObject uploaded to the container FirstContainer:

    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "X-Worm-Expiration-Days: 4" \
         -H "Content-Length: 0"
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/FirstObject
    

    The following is an example of the output of this command:

    > PUT /v1/Storage-acme/FirstContainer/FirstObject HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Worm-Expiration-Days: 4
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    > Content-Length: 0
    
    < HTTP/1.1 201 Created
    < Date: Fri, 06 Dec 2016 11:41:20 GMT
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: txe8869b3edea348e5b49eb-0054f99088
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    
  • This command sets the WORM policy to expire at Thu, 08 Dec 2016 22:00:00 GMT represented by the Epoch timestamp 1481234400 for the object SecondObject uploaded to the container FirstContainer:

    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "X-Worm-Expiration-At: 1481234400" \
         -H "Content-Length: 12"
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/SecondObject
    

    The following is an example of the output of this command:

    > PUT /v1/Storage-acme/FirstContainer/SecondObject HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Worm-Expiration-At: 1481234400
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    > Content-Length: 12
    
    < HTTP/1.1 201 Created
    < Date: Fri, 06 Dec 2016 11:43:50 GMT
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: txe8869b3edea348e5b49eb-0054f99095
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    

Getting Object Metadata

Any user with the Service Administrator role or a role that is specified in the X-Container-Read ACL of the container can perform this task.

You can retrieve information about an object in a container by sending a HEAD request, which returns the following information:

  • Object type (Content-Type)
  • Object size (Content-Length)
  • MD5 Checksum value (Etag)
You can retrieve object metadata by using the following interfaces:
Interface Resources

RESTful API

See Show Object Metadata in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See class: ObjectMetadata in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See setQuotaBytes() in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

cURL Command Syntax

curl -v -X HEAD \
     -H "X-Auth-Token: token" \
     accountURL/containerName/objectName

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myObject
    

    The following is an example of the output of this command:

    > HEAD /v1/acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myObject HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tk4863bdbfb5eee0d6d452eed5348d21ed
    >
    < HTTP/1.1 200 OK
    < Accept-Ranges: bytes
    < Last-Modified: Wed, 16 Dec 2015 08:14:17 GMT
    < Etag: f1c9645dbc14efddc7d8a322685f26eb
    < X-Timestamp: 1450253656.45313
    < X-Trans-Id: txb3d80329b3ec4915971c0-0056a9d7c0ga
    < Date: Thu, 28 Jan 2016 08:56:32 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1450253656.45313
    < Content-Type: application/octet-stream;charset=UTF-8
    < Content-Length: 10485760
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    This cURL command example applies to the accounts created after November 2017.

    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject
    

    The following is an example of the output of this command:

    > HEAD v1/storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tk4863bdbfb5eee0d6d452eed5348d21ed
    >
    < HTTP/1.1 200 OK
    < Accept-Ranges: bytes
    < Last-Modified: Wed, 16 Dec 2015 08:14:17 GMT
    < Etag: f1c9645dbc14efddc7d8a322685f26eb
    < X-Timestamp: 1450253656.45313
    < X-Trans-Id: txb3d80329b3ec4915971c0-0056a9d7c0ga
    < Date: Thu, 28 Jan 2016 08:56:32 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1450253656.45313
    < Content-Type: application/octet-stream;charset=UTF-8
    < Content-Length: 10485760
    

Getting Object Metadata for Large Objects

Any user with the Service Administrator role or a role that is specified in the X-Container-Read ACL of the container can perform this task.

You can retrieve information about a large object in a container by sending a HEAD request, which returns the following information:

  • Object type (Content-Type)
  • Object size (Content-Length)
  • MD5 Checksum value (Etag)

For information about retrieving large object metadata by using the REST API, see Get Object Metadata in OpenStack Object Storage Service API Reference. The Java library does not support this task.

cURL Command Syntax

curl -v -X HEAD \
     -H "X-Auth-Token: token" \
     accountURL/containerName/manifestObjectName

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tka6b18380f0e22c57d721b9101d425759" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/LargeFile.manifest
    

    The following is an example of the output of this command:

    > HEAD /v1/acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/LargeFile.manifest HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tka6b18380f0e22c57d721b9101d425759
    >
    < HTTP/1.1 200 OK
    < Etag: "6e9647a0cd268b9299e647d28f7027f7"
    < Accept-Ranges: bytes
    < Last-Modified: Mon, 25 Jan 2016 18:48:22 GMT
    < X-Object-Manifest: FirstContainer/segment_
    < X-Timestamp: 1453747701.91311
    < X-Trans-Id: txbfb035e9ddf24d96bf602-0056ab5bf2ga
    < Date: Fri, 29 Jan 2016 12:32:50 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1453747701.91311
    < Content-Type: application/zip;charset=UTF-8
    < Content-Length: 52428800
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    This cURL command example applies to the accounts created after November 2017.

    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tka6b18380f0e22c57d721b9101d425759" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/LargeFile.manifest
    

    The following is an example of the output of this command:

    > HEAD /v1/storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/LargeFile.manifest HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tka6b18380f0e22c57d721b9101d425759
    >
    < HTTP/1.1 200 OK
    < Etag: "6e9647a0cd268b9299e647d28f7027f7"
    < Accept-Ranges: bytes
    < Last-Modified: Mon, 25 Jan 2016 18:48:22 GMT
    < X-Object-Manifest: FirstContainer/segment_
    < X-Timestamp: 1453747701.91311
    < X-Trans-Id: txbfb035e9ddf24d96bf602-0056ab5bf2ga
    < Date: Fri, 29 Jan 2016 12:32:50 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1453747701.91311
    < Content-Type: application/zip;charset=UTF-8
    < Content-Length: 52428800
    

Finding Out the Status of Objects in an Archive Container

Not Oracle Cloud at Customer This topic does not apply to Oracle Cloud at Customer.

Any user with a role that is specified in the X-Container-Read ACL of a container can find out the status of an object in an Archive container.

Finding Out the Status of Objects Using the Web Console

  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
  2. Select the Archive container from which you would like to find out the status of an object.

    The objects in the container are listed.

  3. Identify the object for which you want to find out the status.
  4. Select Check Status.
    • If the object is archived, the Checking current status of archive object dialog box appears with the following message:

      Currently the object is archived.

      If you would like to restore the object, select Restore. See Restoring Archived Objects.

      Else, click Cancel.

    • If the archived object is being restored, the Checking current status of archive object dialog box appears with the following message:

      Restoration job is in progress.

  5. Click OK.

Finding Out the Status of Objects Using the REST API

After creating or restoring an object in an Archive container, you can find out the status of the object from its header X-Archive-Restore-Status, which can have one of the following values:
  • archived: Indicates that the object is archived
  • restored: Indicates that the object is restored
  • inprogress: Indicates that object restoration is in progress

cURL Command Syntax

curl -v -X HEAD \
     -H "X-Auth-Token: token" \
     accountURL/containerName/objectName

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tkb237a55e17b772a7579f433d8b4f6e05" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/firstArchiveContainer/obj1.txt
    

    The following is an example of the output of this command with the object status as archived:

    > HEAD /v1/Storage-acme/firstArchiveContainer/obj1.txt HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tkb237a55e17b772a7579f433d8b4f6e05
    >
    < HTTP/1.1 200 OK
    < X-Archive-Restore-Status: archived
    < Accept-Ranges: bytes
    < Last-Modified: Thu, 18 Jun 2015 19:45:26 GMT
    < Etag: 3db2050fcf84bb631dcae417d3db518c
    < X-Timestamp: 1434656725.77022
    < X-Trans-Id: tx37fb896a0a8144f3860da-0055832016ga
    < Date: Thu, 18 Jun 2015 19:46:30 GMT
    < Content-Type: text/plain;charset=UTF-8
    < Content-Length: 12
    <
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X HEAD \
         -H "X-Auth-Token: AUTH_tkb237a55e17b772a7579f433d8b4f6e05" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer/obj1.txt
    

    The following is an example of the output of this command with the object status as archived:

    > HEAD /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer/obj1.txt HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tkb237a55e17b772a7579f433d8b4f6e05
    >
    < HTTP/1.1 200 OK
    < X-Archive-Restore-Status: archived
    < Accept-Ranges: bytes
    < Last-Modified: Thu, 18 Jun 2015 19:45:26 GMT
    < Etag: 3db2050fcf84bb631dcae417d3db518c
    < X-Timestamp: 1434656725.77022
    < X-Trans-Id: tx37fb896a0a8144f3860da-0055832016ga
    < Date: Thu, 18 Jun 2015 19:46:30 GMT
    < Content-Type: text/plain;charset=UTF-8
    < Content-Length: 12
    <
    

Restoring Archived Objects

Not Oracle Cloud at Customer This topic does not apply to Oracle Cloud at Customer.

Any user with the Service Administrator role or a role that is specified in the X-Container-Read ACL of the container can perform this task.

To download an archived object, the object must first be restored. Restoring archived objects is an asynchronous operation. It can take up to four hours to restore an object. When you have requested to restore an object, a Job ID and a tracking URL are returned. This information can be used to monitor the object's restoration progress.

You can restore archived objects in a container by using the following interfaces:
Interface Resources

Web Console

See Restoring an Archived Object Using the Web Console.

RESTful API

See Trigger the retrieval of an archived object in REST API for Archive Storage in Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager CLI

See Restoring an Object in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See restoreObject in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

Restoring an Archived Object Using the Web Console

  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
  2. Select the Archive container from which the archived object must be restored.

    The objects in the container are listed.

  3. Identify the archived object that you want to restore.
  4. Select Check Status.

    The Checking current status of archive object dialog box appears with the following message:

    Currently the object is archived.

  5. Select Restore to restore the archived object.

    The following message appears:

    Are you sure you want to restore the object objectName?

  6. Click OK.

    The following message appears:

    Restore job for objectName initiated successfully. You can check the Restore Status by clicking the Check Status button.

    By default, the object remains restored for one day, after which you must restore it again to be able to download it.

  7. Click OK.

Restoring an Archived Object Using the REST API

cURL Command Syntax

curl -v -X POST \
     -H "X-Auth-Token: token" \
     "accountURL/containerName/objectName?restore"

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Example

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X POST \ 
         -H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" \
         "https://acme.storage.oraclecloud.com/v0/Storage-acme/firstArchiveContainer/file.txt?restore"

    The following is an example of the output of this command:

    > HEAD /v1/Storage-acme/firstArchiveContainer/file.txt HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd
    >
    > POST /v0/Storage-acme/firstArchiveContainer/file.txt?restore HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd
    < HTTP/1.1 202 Accepted
    < Location: acme.storage.oraclecloud.com:443/v0/Storage-acme/firstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4
    < X-Archive-Restore-Tracking: http://acme.storage.oraclecloud.com:443/v0/Storage-acme/TestArch?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4
    < X-Archive-Restore-JobId: a75c8bbf53224a88738e68d6628acd83a4b300e4
    < Content-Length: 0
    < Date: Thu, 18 Jun 2015 17:53:41 GMT
    <
    

    Note:

    By default, the object remains restored for one day, after which you must restore it again to be able to download it. You can change the period (in days) that an object remains restored, by specifying that period in the X-Archive-Restore-Expiration header, as shown in the following example.

    curl -v -X POST \ 
         -H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" \
         -H "X-Archive-Restore-Expiration: 3" \
         "https://acme.storage.oraclecloud.com/v0/Storage-acme/firstArchiveContainer/file.txt?restore
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    This cURL command example applies to the accounts created after November 2017.

    curl -v -X POST \ 
         -H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" \
         "https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer/file.txt?restore"

    The following is an example of the output of this command:

    > HEAD /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer/file.txt HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd
    >
    > POST /v0/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer/file.txt?restore HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd
    < HTTP/1.1 202 Accepted
    < Location: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4
    < X-Archive-Restore-Tracking: http://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443/v0/Storage-7b16fede61e1417ab83eb52e06f0e365/TestArch?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4
    < X-Archive-Restore-JobId: a75c8bbf53224a88738e68d6628acd83a4b300e4
    < Content-Length: 0
    < Date: Thu, 18 Jun 2015 17:53:41 GMT
    <
    

    Note:

    By default, the object remains restored for one day, after which you must restore it again to be able to download it. You can change the period (in days) that an object remains restored, by specifying that period in the X-Archive-Restore-Expiration header, as shown in the following example.

    curl -v -X POST \ 
         -H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" \
         -H "X-Archive-Restore-Expiration: 3" \
         "https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v0/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer/file.txt?restore

Next Step

You can now track the restoration progress of the object in the Archive container. To track the object's restoration progress, make a note of the URL in the X-Archive-Restore-Tracking header and the job ID in the header X-Archive-Restore-JobId when you restore an object. For more information, see Tracking Restoration of an Object in an Archive Container.

Tracking Restoration of an Object in an Archive Container

Not Oracle Cloud at Customer This topic does not apply to Oracle Cloud at Customer.

Any user with a role that is specified in the X-Container-Read ACL of the container can track the restoration of an object in an Archive container.

It might take up to four hours for an object to be restored and accessible.

You can track the restoration progress of the object from the URL in the X-Archive-Restore-Tracking status header in the object metadata.

The following details are displayed when you track the restoration progress:
  • Restoration Start Time
  • Restoration End Time (if the restoration is complete)
  • Restoration Progress
  • Percentage of Restoration Completion
  • Job Details
  • Object Size
  • Object Etag
  • Restored Object Expiration time
  • Link to archived version of the object
  • Job Type
  • Job ID

For information about tracking restoration of an object in an archive container by using the REST API, see Return status of restore job in REST API for Archive Storage in Oracle Cloud Infrastructure Object Storage Classic.

cURL Command Syntax

curl -v -X GET \
     -H "X-Auth-Token: token" \
     "accountURL/containerName?jobs&jobID"

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Examples

  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X GET \
         -H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" 
         "https://acme.storage.oraclecloud.com/v0/Storage-acme/firstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4"

    The following is an example of the output of this command:

    > GET /v0/Storage-acme/firstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4 HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd
    >
    < HTTP/1.1 200 OK
    < Transfer-Encoding: chunked
    < Date: Thu, 18 Jun 2015 17:56:14 GMT
    <
    * Connection #0 to host acme.storage.oraclecloud.com left intact
     {
     "endTime":"2015-06-18,17:54",
     "progress":"success","completedPercentage":100,
     "intervalToPoll":10,
     "jobDetails":{
    	"objectSizeInBytes":"20",
    	"objectEtag":"4221d002ceb5d3c9e9137e495ceaa647",
    	"objectExpiration":"1434736481424"
    	},
     "links":
      [
    	{"rel":"self",
    	 "href":"http://acme.storage.oraclecloud.com:443/v0/Storage-acme/TestArch?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4"},
    	{"rel":"original","href":"http://acme.storage.oraclecloud.com:443/v1/Storage-acme/TestArch/file.txt"},
    	{"rel":"canonical","href":"http://acme.storage.oraclecloud.com:443/v1/Storage-acme/TestArch/file.txt"}
    	],
     "startTime":"2015-06-18,17:53",
     "completed":true,
     "jobType":"RestoreArchivedObjectJob",
     "jobId":"a75c8bbf53224a88738e68d6628acd83a4b300e4"
     } 

    The objectExpiration field in the response body shows the UNIX Epoch time stamp representing the date and time when the restored object will expire. For example, 1434736481424 represents June 19, 2015 17:54:41 GMT. See http://www.epochconverter.com/. The standard expiry duration is 24 hours.

  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    This cURL command example applies to the accounts created after November 2017.

    curl -v -X GET \
         -H "X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd" 
         "https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v0/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4"

    The following is an example of the output of this command:

    > GET /v0/Storage-7b16fede61e1417ab83eb52e06f0e365/firstArchiveContainer?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4 HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443
    > Accept: */*
    > X-Auth-Token: AUTH_tk1ff0554c1fefff9209696d63553722fd
    >
    < HTTP/1.1 200 OK
    < Transfer-Encoding: chunked
    < Date: Thu, 18 Jun 2015 17:56:14 GMT
    <
    * Connection #0 to host storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com left intact
     {
     "endTime":"2015-06-18,17:54",
     "progress":"success","completedPercentage":100,
     "intervalToPoll":10,
     "jobDetails":{
    	"objectSizeInBytes":"20",
    	"objectEtag":"4221d002ceb5d3c9e9137e495ceaa647",
    	"objectExpiration":"1434736481424"
    	},
     "links":
      [
    	{"rel":"self",
    	 "href":"http://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443/v0/Storage-7b16fede61e1417ab83eb52e06f0e365/TestArch?jobs&jobid=a75c8bbf53224a88738e68d6628acd83a4b300e4"},
    	{"rel":"original","href":"http://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/TestArch/file.txt"},
    	{"rel":"canonical","href":"http://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com:443/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/TestArch/file.txt"}
    	],
     "startTime":"2015-06-18,17:53",
     "completed":true,
     "jobType":"RestoreArchivedObjectJob",
     "jobId":"a75c8bbf53224a88738e68d6628acd83a4b300e4"
     } 

    The objectExpiration field in the response body shows the UNIX Epoch time stamp representing the date and time when the restored object will expire. For example, 1434736481424 represents June 19, 2015 17:54:41 GMT. See http://www.epochconverter.com/. The standard expiry duration is 24 hours.

You can now download the restored object before it expires. For more information, see Downloading Objects.

Downloading Objects

When you download an object, the object's metadata and data are downloaded. You can download a single object or a large object.

Downloading an Object

When you download an object, the object's metadata and data are downloaded.

Any user with the Service Administrator role or a role that is specified in the X-Container-Read ACL of the container can perform this task.

You can download objects from a container by using the following interfaces:
Interface Resources

Web Console

(Not available on Oracle Cloud at Customer)

See Downloading an Object Using the Web Console.

RESTful API

See Get object content and metadata in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic.

Java Library

See retrieveObject in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See download in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See Downloading an Object in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

Downloading an Object Using the Web Console

(Not available on Oracle Cloud at Customer)
  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
  2. Select the container from which the object must be downloaded.

    The objects in the container are listed.

  3. If you see the Enable Upload and Download button in the Container Information pane, you can’t download the object.
    1. Click Enable Upload and Download.

      The following message appears:

      In order to upload and download objects to the current container, this application must enable Cross-Origin Resource Sharing (CORS) for this domain domainName.
      You can disable this setting at anytime. 
      Would you like to continue?
    2. Click OK to enable Cross-Origin Resource Sharing (CORS).

      Note:

      You can disable CORS in the container at any time. Select Disable Upload and Download in the Container Information pane to disable CORS.
  4. Identify the object that you want to download.

    Note:

    You can't download objects that are larger than 10 MB using the web console. To download such objects, use the CLI or REST API.
  5. From the Actions drop-down list for the object to be downloaded, select Download.

    The object is downloaded to the desired location.

Downloading an Object Using the REST API

cURL Command Syntax

curl -v -X GET \
     -H "X-Auth-Token: token" \
     -o file \
     accountURL/containerName/objectName

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X GET \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -o myFile.txt \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/myContainer/myObject
    

    The following is an example of the output of this command:

    > GET /v1/Storage-acme/FirstContainer/myObject HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    >
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    < 
    < HTTP/1.1 200 OK
    < Date: Mon, 09 Mar 2015 11:34:33 GMT
    < Content-Length: 23
    < Accept-Ranges: bytes
    < Last-Modified: Mon, 09 Mar 2015 11:26:58 GMT
    < Etag: 846fa9d298be05e5f598703f0c3d6f51
    < X-Timestamp: 1425900417.95553
    < Content-Type: application/octet-stream
    < X-Trans-Id: txf0b592c7e49b4475944f8-0054fd8549
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    <
    { [data not shown]
      0    23    0    23    0     0     53      0 --:--:-- --:--:-- --:--:--   234* Connection #0 to host acme.storage.oraclecloud.com left intact
    
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X GET \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -o myFile.txt \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/myContainer/myObject
    

    The following is an example of the output of this command:

    > GET /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    >
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    < 
    < HTTP/1.1 200 OK
    < Date: Mon, 09 Mar 2015 11:34:33 GMT
    < Content-Length: 23
    < Accept-Ranges: bytes
    < Last-Modified: Mon, 09 Mar 2015 11:26:58 GMT
    < Etag: 846fa9d298be05e5f598703f0c3d6f51
    < X-Timestamp: 1425900417.95553
    < Content-Type: application/octet-stream
    < X-Trans-Id: txf0b592c7e49b4475944f8-0054fd8549
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    <
    { [data not shown]
      0    23    0    23    0     0     53      0 --:--:-- --:--:-- --:--:--   234* 
    Connection #0 to host storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com left intact
    
    

Downloading a Large Object

Large objects contain data more than 5 GB. To download a large object, you must download the manifest object which returns all the segments concatenated as a single large object.

You can download a large object by using the following interface:
Interface Resources

File Transfer Manager CLI

See Downloading an Object in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

cURL Command Syntax

To download a static large object:

curl -v -X GET \
     -H "X-Auth-Token: token" \
     -o largeObject \
     accountURL/containerName/manifestFile \
   

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

To download just the manifest object (and not the entire large object), append the ?multipart-manifest=get query parameter to the GET request:

curl -v -X GET \
     -H "X-Auth-Token: token" \
     -o manifestFile \
     accountURL/containerName/manifestObjectName?multipart-manifest=get \
   

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X GET \
            -H "X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650" \
            -o myLargeObject \
            https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myLargeFile.manifest \
            

    The following is an example of the output of this command:

    > GET /v1/Storage-acme/myLargeFile.manifest HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650
    >
    < HTTP/1.1 200 OK
    < Etag: "6e9647a0cd268b9299e647d28f7027f7"
    < Accept-Ranges: bytes
    < Last-Modified: Mon, 20 Jan 2016 18:48:22 GMT
    < X-Object-Manifest: FirstContainer/segment_
    < X-Timestamp: 1453747701.91311
    < X-Trans-Id: tx9f77e1e8b7b74de18dc53-0056a8a3f5ga
    < Date: Wed, 20 Jan 2016 11:03:18 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1453747701.91311
    < Content-Type: application/zip;charset=UTF-8
    < Content-Length: 52428800
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X GET \
            -H "X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650" \
            -o myLargeObject \
            https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myLargeFile.manifest \
            

    The following is an example of the output of this command:

    > GET /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/myLargeFile.manifest HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tk5a58b7a8c34bb7b662523a59a5272650
    >
    < HTTP/1.1 200 OK
    < Etag: "6e9647a0cd268b9299e647d28f7027f7"
    < Accept-Ranges: bytes
    < Last-Modified: Mon, 20 Jan 2016 18:48:22 GMT
    < X-Object-Manifest: FirstContainer/segment_
    < X-Timestamp: 1453747701.91311
    < X-Trans-Id: tx9f77e1e8b7b74de18dc53-0056a8a3f5ga
    < Date: Wed, 20 Jan 2016 11:03:18 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1453747701.91311
    < Content-Type: application/zip;charset=UTF-8
    < Content-Length: 52428800
    

Downloading an Object Using a Temporary URL

You can create time-limited temporary URLs to provide secure, temporary access to download objects from Oracle Cloud Infrastructure Object Storage Classic.

To generate temporary URLs for objects, you must use a secret key that you specify beforehand either at the account level or at a container level. In either case, you can specify up to two keys.
  • You can use an account-level key to download objects from any container in your Oracle Cloud Infrastructure Object Storage Classic instance.
  • You can use a container-level key to download any object from that container.

Before You Begin

You can generate temporary URLs using the OpenStack Swift CLI or using a script written in any programming language. This document includes an example that uses the OpenStack Swift CLI and another example that uses a Python script.

Install the following software on a local host:

Procedure

  1. Set a key to secure the temporary URLs. You can set keys at the account level and for a specific container, and use any one of those keys to generate temporary URLs.

    • To set a key for the account, run the following cURL command:

      curl -X POST \
           -H 'X-Auth-Token: token' \
           -H 'X-Account-Meta-Temp-URL-Key: key' \
           accountURL
      • token is the authentication token obtained from Oracle Cloud Infrastructure Object Storage Classic.
      • accountURL is the REST endpoint URL for your service instance.
      • key is any arbitrary string of your choice.
      Example:
      curl -X POST \
           -H 'X-Auth-Token: AUTH_tk6b7d5b0d94e653217ee0898d43613a07' \
           -H 'X-Account-Meta-Temp-URL-Key: tempkey' \
           https://acme.storage.oraclecloud.com/v1/Storage-acme
    • To set a key for a container, run the following cURL command: 
      curl -X POST \
           -H 'X-Auth-Token: token' \
           -H 'X-Container-Meta-Temp-URL-Key: key' \
           accountURL/containerName
      • token is the authentication token obtained from Oracle Cloud Infrastructure Object Storage Classic.
      • accountURL is the REST endpoint URL for your service instance.
      • key is any arbitrary string of your choice.
      • containerName is the name of the container from which you want to download objects.
      Example:
      curl -X POST \
           -H 'X-Auth-Token: AUTH_tk6b7d5b0d94e653217ee0898d43613a07' \
           -H 'X-Container-Meta-Temp-URL-Key: tempkey1' \
           https://acme.storage.oraclecloud.com/v1/Storage-acme/myFirstContainer
  2. You can generate temporary URLs using the OpenStack Swift CLI or using a script written in any programming language.

    To generate a temporary URL using the OpenStack Swift CLI, complete the following steps:

    1. Run the following command:

      swift tempurl GET seconds /v1/Storage-identityDomainName/containerName/objectName key
      • seconds is the number of seconds that the temporary URL should be valid from the time it is generated.
      • identityDomainName is the identity domain name of your Oracle Cloud Infrastructure Object Storage Classic account.
      • containerName is the name of the container.
      • objectName is the name of the object that needs to be downloaded using the temporary URL.
      • key is the value that you assigned earlier to the X-Account-Meta-Temp-URL-Key header or X-Container-Meta-Temp-URL-Key header.
      Example:
      swift tempurl GET 300 /v1/Storage-acme/FirstContainer/tempobject tempkey

      Output:

      /v1/Storage-acme/FirstContainer/tempobject?temp_url_sig=555417815bf1288b46c6c2ae9fc2f90a437a3110&temp_url_expires=1467281788

      The output contains the path of the object (/v1/Storage-acme/FirstContainer/tempobject) and the following additional query parameters:
      • temp_url_sig: A cryptographic signature of the URL
      • temp_url_expires: The date and time when the URL will expire, in the UNIX Epoch format.
    2. (Optional) If you generated a temporary URL for a container-terminated path, the URL so generated would not contain any object name. You must insert the name of the required object between the container name and "?" in the URL, as shown in the following example:

      /v1/containerName/objectName?temp_url_sig=value&temp_url_expires=value

    3. Note that the temporary URL generated by the OpenStack Swift CLI is not the full URL. Construct the full URL by prefixing the account URL to the generated path, as follows:

      https://acme.storage.oraclecloud.com/v1/Storage-acme/containerName/objectName?temp_url_sig=value&temp_url_expires=value
      Example:
      https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/tempobject?temp_url_sig=555417815bf1288b46c6c2ae9fc2f90a437a3110&temp_url_expires=1467281788
  3. Alternatively (instead of using the OpenStack Swift CLI), you can generate a temporary URL for an object by using an HMAC-SHA1 signature created using Python or any other programming language.

    The HMAC-SHA1 signature must include the following:
    • GET method
    • Date and time when the URL will expire
    • Key: The value that you assigned earlier to the X-Account-Meta-Temp-URL-Key header or X-Container-Meta-Temp-URL-Key header.
    • Path of the object that needs to be downloaded using the temporary URL:

      /v1/Storage-identityDomainName/containerName/objectName

      Note that you can terminate the path at a container instead of specifying an object name. The resulting temporary URL can be used to download any object in the specified container. Here's the syntax for a container-terminated path: /v1/Storage-identityDomainName/containerName

    Example:

    Sample Cloud account with the following details:
    • Account name: acme
    • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
    • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

      Note:

      The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.

    The REST Endpoint URL for the sample Cloud account is used in the examples in this section. To use the REST Endpoint (Permanent) URL, replace https://acme.storage.oraclecloud.com/v1/Storage-acme with https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365.

    The following sample Python code snippet generates a temporary URL, using input that you provide.

    # USER INPUT: Specify the following parameters:
    serviceInstanceName = 'Storage' # Leave as is unless your service instance has a different name
    identityDomainName = 'acme' # Name of your identity domain
    container = 'myContainer' # Container that has the objects you need the tempURL for
    key = 'mykey' # X-Container-Meta-Temp-Url-Key or X-Account-Meta-Temp-Url-Key value
    object = 'myObject' # Object name that you need the tempURL for. This is optional if a container-level key is used.
    urlDuration = 300 # Seconds for which the temp URL should work
    serviceRestEndpoint = 'https://acme.storage.oraclecloud.com/v1/Storage-acme' # REST endpoint URL of your service instance
    
    # CODE TO GENERATE THE TEMPORARY URL: Don't change anything in this section
    import hmac
    from hashlib import sha1
    from time import time
    path = '/v1/' + serviceInstanceName + '-' + identityDomainName + '/' + container + '/' + object
    expires = int(time() + urlDuration)
    hmac_body = '%s\n%s\n%s' % ('GET', expires, path)
    sig = hmac.new(key, hmac_body, sha1).hexdigest()
    url = serviceRestEndpoint + '/' + container + '/' + object +'?temp_url_sig=' + sig + '&temp_url_expires=' + str(expires)
    print(url)
    1. Copy this Python code snippet to a plain text file.
    2. In the USER INPUT section of the code, enter appropriate values for all the parameters, as described in the comments in the code.
    3. Save the file, and note the file name (say, tempURL.py).
    4. Run the Python script:

      python tempURL.py

      The script generates and displays the temporary URL for the object or container that you specified.

      Example:

      • Temporary URL for an object: https://acme.storage.oraclecloud.com/v1/Storage-acme/containerName/objectName?temp_url_sig=value&temp_url_expires=value
      • Temporary URL for a container: https://acme.storage.oraclecloud.com/v1/containerName?temp_url_sig=value&temp_url_expires=value

        Note:

        To use the container-terminated temporary URL to download an object, you must insert the object name between the container name and “?” in the URL, as shown in the following example:

        https://acme.storage.oraclecloud.com/v1/Storage-acme/containerName/objectName?temp_url_sig=value&temp_url_expires=value

  4. Give the temporary URL to the users who need to download the object.

Deleting Objects

When an object is deleted, the object and its metadata will be removed permanently.

Deleting a Single Object

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can perform this task.

You can delete an object in a container by using the following interfaces:
Interface Resources

Web Console

(Not available on Oracle Cloud at Customer)
See Deleting a Single Object Using the Web Console.

RESTful API

See Delete Object in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic.

Java Library

See deleteObject in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See deleteObject in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See Deleting Objects in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

Note:

You can schedule deletion of objects at a specified time in the future or after a specified period of time has elapsed, by using the X-Delete-At or X-Delete-After header. See Scheduling Automatic Deletion of Objects.

Deleting a Single Object Using the Web Console

(Not available on Oracle Cloud at Customer)
  1. Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
  2. Select the container that has the object you want to delete.

    The objects in the container are displayed.

  3. Identify the object that you want to delete.
  4. From the Actions drop-down list for the object, select Delete.

    The following message appears:

    Are you sure want to delete this object?

  5. Click OK.

    The object is deleted from the container.

Deleting a Single Object Using the REST API

cURL Command Syntax

curl -v -X DELETE \
     -H "X-Auth-Token: token" \
     accountURL/containerName/objectName

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

HTTP Response Codes

cURL Command Examples

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X DELETE \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myObject2
    

    The following is an example of the output of this command:

    > DELETE /v1/Storage-acme/FirstContainer/myObject2 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    >
    < HTTP/1.1 204 No Content
    < Date: Mon, 09 Mar 2015 11:40:23 GMT
    < Content-Length: 0
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: tx47aef42f16c44bd9a72cb-0054fd86a7
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X DELETE \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject2
    

    The following is an example of the output of this command:

    > DELETE /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject2 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    >
    < HTTP/1.1 204 No Content
    < Date: Mon, 09 Mar 2015 11:40:23 GMT
    < Content-Length: 0
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: tx47aef42f16c44bd9a72cb-0054fd86a7
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    

Deleting a Large Object

Large objects contain data more than 5 GB.

cURL Command Syntax

To delete a static large object, send a DELETE request and add the query parameter ?multipart-manifest=delete to delete the manifest object and all the segment files.

Note:

To delete a static large object from an Archive container, delete each segment file and the manifest object individually. (Not available on Oracle Cloud at Customer)
curl -v -X DELETE \
     -H "X-Auth-Token: token" \
     accountURL/containerName/manifestFile?multipart-manifest=delete \
   

Note:

When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container should be encoded as my%20container, where %20 is the HTML encoding for the space character. Similarly, my Über Container should be encoded as my%20%C3%9Cber%20Container, where %20 represents the space character and %C3%9C is the Ü character.

cURL Command Examples

The following are cURL command examples to delete a static large object.

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X DELETE \
            -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
            https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myLargeFile.manifest?multipart-manifest=delete \
            

    The following is an example of the output of this command:

    > DELETE /v1/Storage-acme/myLargeFile.manifest?multipart-manifest=delete
    > User-Agent: curl/7.29.0
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    >
    < HTTP/1.1 204 No Content
    < X-Trans-Id: txa590ad2c5ce54317bd02e-0056a8a5d5ga
    < Date: Wed, 20 Jan 2016 11:11:17 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1453893077.47202
    < Content-Type: text/html;charset=UTF-8
    <
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X DELETE \
            -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
            https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myLargeFile.manifest?multipart-manifest=delete \
            

    The following is an example of the output of this command:

    > DELETE /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/myLargeFile.manifest?multipart-manifest=delete
    > User-Agent: curl/7.29.0
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    >
    < HTTP/1.1 204 No Content
    < X-Trans-Id: txa590ad2c5ce54317bd02e-0056a8a5d5ga
    < Date: Wed, 20 Jan 2016 11:11:17 GMT
    < Connection: keep-alive
    < X-Last-Modified-Timestamp: 1453893077.47202
    < Content-Type: text/html;charset=UTF-8
    <
    

Deleting Multiple Objects in a Single Operation

Multiple objects can be deleted in a single operation.

Note:

  • This feature is not supported for Archive containers.

  • You can delete up to 10,000 objects in a single operation.

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can perform this task.

To bulk-delete objects:

Sample Cloud account with the following details –
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.

The REST Endpoint URL for the sample Cloud account is used in the steps below. To use the REST Endpoint (Permanent) URL, replace https://acme.storage.oraclecloud.com/v1/Storage-acme with https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365.

  1. Create a plain text file that lists each object you want to delete.

    Each line in the plain-text file should be in the format container/object, as shown in the following example:

    $ cat objects_to_delete.txt
    
    myContainer1/myObject1 
    myContainer1/myObject2 
    myContainer2/myObjectN 
    myContainer3/myObjectX
    

    Note:

    The plain-text file that you create can list objects in multiple containers.

    To quickly build such a file, send a GET call to the container that has the objects you want to delete, pipe the output of the GET call to a sed command that prefixes the container name to each object name, and then redirect the edited output to a text file.

    Example command:

    $ curl -X GET 
           -H "X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831" 
           "https://acme.storage.oraclecloud.com/v1/Storage-acme/myContainer" 
           | sed 's/^/myContainer\//' 
           > objects_to_delete.txt
    
    • myContainer is the name of the container that has the objects to be deleted. Replace this with the name of your container.
    • objects_to_delete is the plain text file in which the objects that must be deleted are listed.
    • Note the ‘escaped’ forward slash (\/ ) that’s added after the container name. It’s necessary to demarcate the container and object name in each line in the text file.
  2. Send a DELETE request to the account URL.
    • Set Content-Type to text/plain.
    • Include the bulk-delete parameter.

    To delete the objects listed in the file objects_to_delete.txt that you created in the previous step:

    $ curl -v -s -X DELETE 
           -H "X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831" 
           -H "Content-Type: text/plain" 
           -T objects_to_delete.txt 
           "https://acme.storage.oraclecloud.com/v1/Storage-acme/?bulk-delete"
    

    The following is an example of the output of this command

    > DELETE /v1/Storage-acme/?bulk-delete HTTP/1.1
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkcc14bdc52d571f70991b68907098f831
    > Content-Type: text/plain
    > Content-Length: 75
    
    < HTTP/1.1 200 OK
    < Date: Thu, 12 Dec 2013 14:56:53 GMT
    < Content-Type: text/plain
    < Transfer-Encoding: chunked
    
    Number Deleted: 3
    Number Not Found: 0
    Response Body: 
    Response Status: 200 OK
    Errors:
    

    Note:

    • For the result of the operation, look at the response body (not the returned status code).
    • In the response body, if Number Deleted doesn’t match the count of lines in the text file that you specified, then some objects weren’t found or deleted. Check for the objects that remain in the container and delete them as required.
You can delete multiple objects in a single operation by using the following interfaces:
Interface Resources

RESTful API

See Bulk Operations in OpenStack Object Storage Service API Reference.

File Transfer Manager API

See deleteObjects in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

Copying Objects

An object can be copied to another object within the same or another container. There is no need to download the object and then upload it again; the copying operation is performed entirely on the server.

A user with any of the following roles can perform this task:
  • Service Administrator role
  • A role that is specified in the X-Container-Read ACL of the source container and in the X-Container-Write ACL of the target container

The following restrictions apply:

  • You can copy static large objects between containers. You can copy the segments directly, but you must re-create the manifest. You cannot use the existing manifest as it points to the old segments, which may have been deleted.
  • You cannot copy objects to other accounts.
You can copy objects by using the following interfaces:
Interface Resources

RESTful API

See Copy Object in OpenStack Object Storage Service API Reference

File Transfer Manager CLI

See Copying an Object in n Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See CopyObjectRequestConfig in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

cURL Command Syntax

curl -v -X PUT \
     -H "X-Auth-Token: token" \
     -H "X-Copy-From: /srcContainer/srcObject" \
     -H "Content-Length: 0" \
     accountURL/dstContainer/dstObject

or

curl -v -X COPY \
     -H "X-Auth-Token: token" \
     -H "Destination: /dstContainer/dstObject" \
     accountURL/srcContainer/srcObject
  • token is the authentication token obtained earlier from Oracle Cloud Infrastructure Object Storage Classic. See Authenticating Access When Using the REST API.
  • srcContainer is the name of the container that contains the object to be copied.
  • srcObject is the name of the object to be copied.
  • For the syntax of accountURL, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources.
  • dstContainer is the name of the container to which the object should be copied. This should be an existing container. In other words, the COPY operation won’t create the destination container.
  • dstObject is the name of the object to be created as a result of the COPY operation.

HTTP Response Codes

cURL Command Examples

The following commands copy /container1/object1 to /container2/object1.

Sample Cloud account with the following details:
  • Account name: acme
  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme
  • REST Endpoint URL (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

    Note:

    The REST Endpoint URL (Permanent) URL is displayed for the accounts created after November 2017.
  • Using the REST Endpoint URL obtained from the REST Endpoint field:
    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "X-Copy-From: /container1/object1" \
         -H "Content-Length: 0"
         https://acme.storage.oraclecloud.com/v1/Storage-acme/container2/object1
    

    or

    curl -v -X COPY \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "Destination: /container2/object1" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/container1/object1

    The following is an example of the output of this command:

    > PUT /v1/Storage-acme/Container2/object1 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: acme.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    > X-Copy-From: /Container1/object1
    > Content-Length: 0
    >
    < HTTP/1.1 201 Created
    < Date: Mon, 09 Mar 2015 11:58:23 GMT
    < Content-Length: 0
    < X-Object-Meta-Language: english
    < X-Copied-From-Last-Modified: Mon, 09 Mar 2015 11:46:34 GMT
    < X-Copied-From: Container1/object1
    < Last-Modified: Mon, 09 Mar 2015 11:58:24 GMT
    < Etag: 846fa9d298be05e5f598703f0c3d6f51
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: txecc0da22db8542c099ed0-0054fd8ade
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "X-Copy-From: /container1/object1" \
         -H "Content-Length: 0"
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/container2/object1
    

    or

    curl -v -X COPY \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "Destination: /container2/object1" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/container1/object1

    The following is an example of the output of this command:

    > PUT /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/Container2/object1 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com
    > Accept: */*
    > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
    > X-Copy-From: /Container1/object1
    > Content-Length: 0
    >
    < HTTP/1.1 201 Created
    < Date: Mon, 09 Mar 2015 11:58:23 GMT
    < Content-Length: 0
    < X-Object-Meta-Language: english
    < X-Copied-From-Last-Modified: Mon, 09 Mar 2015 11:46:34 GMT
    < X-Copied-From: Container1/object1
    < Last-Modified: Mon, 09 Mar 2015 11:58:24 GMT
    < Etag: 846fa9d298be05e5f598703f0c3d6f51
    < Content-Type: text/html; charset=UTF-8
    < X-Trans-Id: txecc0da22db8542c099ed0-0054fd8ade
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Language: en
    

Encrypting Objects

You can encrypt objects by using the following interfaces:
Interface Resources

Java Library

See:

File Transfer Manager API

See EncryptedFileTransferManager in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

File Transfer Manager CLI

See:

Using the Java Library

The Java library can encrypt objects as they are being stored to Oracle Cloud Infrastructure Object Storage Classic. All encryption happens within the Java library; no encryption happens within the service. The REST API does not support this.

Any user with the Service Administrator role or a role that is specified in the X-Container-Write ACL of the container can perform this task.

When you use the client-side encryption feature of the Java library, for every object that you create in Oracle Cloud Infrastructure Object Storage Classic, a unique symmetric key is generated. The Java library uses the symmetric key to encrypt your data before storing it. In addition, you must provide and manage an asymmetric key pair. After encrypting your data, the Java library encrypts the symmetric key as an envelope key by using the asymmetric key pair. Note that you can rotate a previously used key pair for a new key pair without downloading and re-encrypting each object. The envelope key is stored as metadata alongside the object data.

When you use the Java library to access such encrypted objects, the envelope key is first retrieved and decrypted by using the asymmetric key pair that you provide. The resulting symmetric key is then used to decrypt the object data.

You can restrict access to client-side encrypted objects. For example, if you have write access to a container but not to the asymmetric key pair, you can remove the envelope key metadata from an object. So the object data becomes unrecoverable, even if you have access to the asymmetric key pair.

When using the Java library's encryption feature, note the following:

  • Only 2048 bit RSA key pairs are supported.
  • Only object data is encrypted, not object metadata.
  • Segmented objects cannot be encrypted.
  • Nonencrypted objects cannot be downloaded while using the encryption feature.

For more information, see EncryptedCloudStorage in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic.

Using FTM CLI

The FTM CLI enables client-side encryption of data that you want to store on Oracle Cloud Infrastructure Object Storage Classic. The FTM CLI on the client encrypts files before they are transferred to the cloud service. Files are encrypted when they are transferred to the cloud as well as when they are at rest on the cloud. The FTM CLI allows client-side encryption and decryption of static large objects (SLOs) but not dynamic large objects (DLOs). See About Client-Side File Encryption in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic.