Create or replace object
/v1/{account}/{container}/{object}
For information about copying objects, see Copying Objects in Using Oracle Cloud Infrastructure Object Storage Classic.
Request
-
account: string
The unique name for the account. An account is also known as the project or tenant.
-
container: string
The unique name for the container. The container name must be from 1 to 256 characters long and can start with any character and contain any pattern. Character set must be UTF-8. The container name cannot contain a slash (
/
) character because this character delimits the container and object name. For example,/account/container/object
. -
object: string
The unique name for the object.
-
multipart-manifest(optional): string
If
?multipart-manifest=put
, the object is a static large object manifest and the body contains the manifest. -
temp_url_expires(optional): 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 toMon, Wed, 26 Aug 2015 19:57:28 GMT
.This parameter is required when using temporary URLS, but otherwise ignored.
-
temp_url_sig(optional): 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.
-
Content-Disposition(optional): 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(optional): string
If set, the value of the
Content-Encoding
metadata. -
Content-Length(optional): integer
Minimum Value:
0
Set to the length of the object content. Do not set if chunked transfer encoding is being used. -
Content-Type(optional): string
Changes the MIME type for the object.
-
ETag(optional): 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.
-
If-None-Match(optional): string
In combination with
Expect: 100-Continue
, specify anIf-None-Match: *
header to query whether the server already has a copy of the object before any data is sent. -
Transfer-Encoding(optional): string
Set to
chunked
to enable chunked transfer encoding. If used, do not set theContent-Length
header to a non-zero value. -
X-Auth-Token(optional): string
Authentication token. Not specified if
temp_url_sig
andtemp_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-Copy-From(optional): string
If set, this is the name of an object used to create the new object by copying the
X-Copy-From
object. The value is in form{container}/{object}
. You must UTF-8-encode and then URL-encode the names of the container and object before you include them in the header.Using PUT with
X-Copy-From
has the same effect as using the COPY operation to copy an object. -
X-Delete-After(optional): 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 theX-Delete-At
metadata item. -
X-Delete-At(optional): 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 toMon, Wed, 26 Aug 2015 19:57:28 GMT
. -
X-Object-Meta-{name}(optional): 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. -
X-Worm-Expiration-At(optional): integer
Minimum Value:
1
The Epoch time in seconds before an object can be overwritten with a PUT or POST or deleted. If the container for this object has X-Worm-Expiration-Days specified, the Epoch time for this header must be greater than the current Epoch time plus the X-Worm-Expiration-Days (converted to Epoch time in seconds). -
X-Worm-Expiration-Days(optional): integer
Minimum Value:
1
Minimum number of days an object, once uploaded, must reside in a container before it can be overwritten with a PUT or POST or deleted.
Response
- application/json
201 Response
-
Content-Length: integer
Minimum Value:
0
Maximum Value:0
This value is zero (0) -
Content-Type: string
The MIME type of the object.
-
Date: string(date-time)
The transaction date and time.
The date and time stamp format is ISO 8601:
CCYY-MM-DDThh:mm:ss±hh:mm
For example,2015-08-27T09:49:58-05:00
.The
±hh:mm
value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is-05:00
.A
null
value indicates that the token never expires. -
ETag: string
For objects smaller than 5 GB, this value is the MD5 checksum of the uploaded object content. The value is not quoted.
If you supplied an
ETag
request header and the operation was successful, the values are the same.If you did not supply an
ETag
request header, check theETag
response header value against the object content you have just uploaded.For static large objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was uploaded. Also the value is enclosed in double-quotes. For dynamic large objects, the value is the MD5 checksum of the empty string.
-
Last-Modified: string(date-time)
The date and time when the object was last modified.
The date and time stamp format is ISO 8601:
CCYY-MM-DDThh:mm:ss±hh:mm
For example,2015-08-27T09:49:58-05:00
.The
±hh:mm
value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is-05:00
. -
X-Timestamp: integer(timestamp)
Minimum Value:
0
The date and time in UNIX Epoch time stamp format when the account, container, or object was initially created as a current version.For example,
1440619048
is equivalent toMon, Wed, 26 Aug 2015 19:57:28 GMT
. -
X-Trans-Id: string(uuid)
A unique transaction ID for this request. Your service provider might need this value if you report a problem.
400 Response
-
Content-Length: integer
Minimum Value:
1
This value is the length of the error text in the response body. -
Content-Type: string
This value is the MIME type of the error text in the response body.
-
Date: string(date-time)
The transaction date and time.
The date and time stamp format is ISO 8601:
CCYY-MM-DDThh:mm:ss±hh:mm
For example,2015-08-27T09:49:58-05:00
.The
±hh:mm
value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is-05:00
.A
null
value indicates that the token never expires. -
X-Trans-Id: string(uuid)
A unique transaction identifier for this request. Your service provider might need this value if you report a problem.
401 Response
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
403 Response
- A data center has not been selected for your service in Oracle Cloud My Services.
- The request was sent to an incorrect data center. For example, the data center for your service is Chicago (us2), but the request was sent to the URL corresponding to the Ashburn (us6) data center.
- You don't have the required permission to perform the operation on the specified container. For example, there may be a change in the roles assigned to your user or the access privileges defined for the container specified in the request.
- Violating a container or object level WORM policy by trying to PUT, POST, or DELETE an object that has not expired or trying to update an existing container level WORM policy.
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
404 Response
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
408 Response
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
411 Response
Transfer-Encoding
or a Content-Length
header-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
413 Response
- Object size greater than 5GB
- Additional object data exceeds the unused quota on the account
- (If container quotas are set) Additional object data or number of objects exceeds the unused quota on the container.
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
422 Response
ETag
header specified in the upload request doesn???t match the MD5 checksum of the HTTP response.-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
Examples
cURL Command
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 following example shows how to create an object in a container in your account in Oracle Cloud Infrastructure Object Storage Classic by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use-cURL.
-
Using the REST Endpoint URL obtained from the REST Endpoint field in the My Services dashboard:
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 a sample response of this command:
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 Content-Language: en
-
Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field in the My Services dashboard:
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 a sample response of this command:
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 Content-Language: en