Create multiple containers and multiple objects

put

/v1/{account}

Creates multiple containers and / or multiple objects within those containers.

The top-level directories in the request payload archive will correspond to containers, with any missing containers being created as needed. Nested directories will be represented in object names.

Files within the payload archive will be stored as objects.

If the archive file specified in the request contains more than 10,000 top-level directories, then processing of the request will end after the first 10,000 containers are created.

Request

Path Parameters
account
Type: string
Required: true
The unique name for the account. An account is also known as the project or tenant.
Query Parameters
extract-archive
Type: string
Required: true
Indicates that this is a bulk create operation. The value of this parameter identifies the request payload archive format.

Valid values include tar, tar.gz, and tar.bz2.

temp_url_expires
Type: integer (timestamp)
Minimum Value: 0
The date and time in UNIX Epoch time stamp format when the signature for temporary URLs expires.

For example, 1440619048 is equivalent to Mon, Wed, 26 Aug 2015 19:57:28 GMT.

This parameter is required when using temporary URLS, but otherwise ignored.

temp_url_sig
Type: string
Used with temporary URLs to sign the request with an HMAC-SHA1 cryptographic signature that defines the allowed HTTP method, expiration date, full path to the object, and the secret key for the temporary URL.

This parameter is required when using temporary URLS, but otherwise ignored.

Header Parameters
Accept
Type: string
Indicates the response body format desired by the caller. For bulk operations, the available formats are text/plain, application/json, and application/xml.
Content-Disposition
Type: string
If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default.
Content-Encoding
Type: string
If set, the value of the Content-Encoding metadata.
Content-Length
Type: integer
Minimum Value: 0
Set to the length of the object content. Do not set if chunked transfer encoding is being used.
Content-Type
Type: string
Changes the MIME type for all objects created. If omitted, each object's MIME type will reflect that object's file extension.
ETag
Type: string
The MD5 checksum value of the request body. For example, the MD5 checksum value of the object content. You are strongly recommended to compute the MD5 checksum value of object content and include it in the request. This enables the Object Storage API to check the integrity of the upload. The value is not quoted.
Transfer-Encoding
Type: string
Set to chunked to enable chunked transfer encoding. If used, do not set the Content-Length header to a non-zero value.
X-Auth-Token
Type: string
Authentication token. Not specified if temp_url_sig and temp_url_expires are present. Otherwise, if you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL).
X-Delete-After
Type: integer
Minimum Value: 0
Minimum Value: > true
The number of seconds after which the system removes the object. Internally, the Object Storage system stores this value in the X-Delete-At metadata item.
X-Delete-At
Type: integer (timestamp)
Minimum Value: 0
The date and time in UNIX Epoch time stamp format when the system removes the object.

For example, 1440619048 is equivalent to Mon, Wed, 26 Aug 2015 19:57:28 GMT.

X-Object-Meta-{name}
Type: string
The object metadata, where {name} is the name of the metadata item.

You must specify an X-Object-Meta-{name} header for each metadata {name} item that you want to add or update.

Response

Supported Media Types
  • application/json
200 Response
A 200 response is always returned. Check the response body for details.
Body
Root Schema : /paths/~1v1~1{account}/put/responses/200/schema
Type: object
Nested Schema : /paths/~1v1~1{account}/put/responses/200/schema/properties/Errors
Type: array
List of all errors that occurred.

Examples

The following example shows how to create multiple containers (and objects within those containers) by uploading an archive file, which may contain multiple directories. A container is created for each top-level directory in the uploaded archive. An object is created for each file in the uploaded archive. Note that files at the top level are ignored. The name of each created object represents its full directory path.

  1. Create a local archive (.tar, .tar.gz, or tar.bz2) of the files and directories to be stored.

    Here's a sample archive file:
    $ tar -tzf bulk-test.tar.gz
    
    folder1/file1
    folder1/subfolder2
    folder1/subfolder2/file2
    
  2. Upload the archive file.

    Specify the archive type by using the extract-archive request parameter.

    cURL Command

    curl -v -X PUT \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         "https://foo.storage.oraclecloud.com/v1/myservice-bar?extract-archive=tar.gz"
         -T bulk-test.tar.gz
    

    Sample Response

    Response Status: 201 Created
    Number Files Created: 2
    Errors:
    

    A container is created for each top-level directory in the uploaded archive. An object is created for each file in the uploaded archive. Note that files at the top level of the archive are ignored. The name of each created object represents its full directory path.

  3. Verify the bulk operation, by sending a GET request to the folder1 container.

    cURL Command

    curl -X GET \
         -H "X-Auth-Token: AUTH_tk1269e2899ecbc86b4402167c94bad149" \
         "https://foo.storage.oraclecloud.com/v1/myservice-bar/folder1"

    Sample Response

    The request should list the following objects:

    file1
    subfolder2/file2