S3 Object Storage - Object Operations

Object Storage - Object Operations

DELETE Object

This operation allows you to remove the null version (if available) of an object and inserts a delete marker, which becomes the latest version of the object.

If there is no no null version, no object is removed.

Example Request

DELETE /file.txt HTTP/1.1

Host: bucket.s3.nl-ams.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date: 20190411T080553Z
Authorization: authorization string

Example Response

If the operation is successful no output will be returned.

HTTP/1.1 204 No Content

Date: Mon, 10 Jul 2017 19:44:09 GMT
x-amz-request-id: tx5af81e674dc94778896c8-005caef561
Connection: close

Note: You can also use aws s3api delete-object --bucket BucketName --key ObjectName. If bucket versioning is enabled, the output will contain the version ID of the delete marker.


DELETE Object tagging

This operation allows you to delete a tag set from a specified object.

Example Request

DELETE /exampleobject?tagging HTTP/1.1
Host: bucket.s3.nl-ams.scw.cloud
Date: Wed, 13 Mar 2019 12:00:00 GMT
Authorization: authorization string

If the operation is successful no output will be returned.

Example Response

HTTP/1.1 204 No Content
Date: Wed, 13 Mar 2019 12:00:00 GMT
Connection: close

GET Object

This operation allows you to retrieve objects from Scaleway Object Storage.

Example Request

GET /example.txt HTTP/1.1

Host: bucket.s3.nl-ams.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date: 20190411T081116Z
Authorization: authorization string

Example Response

HTTP/1.1 200 OK

Date: Thu, 11 Apr 2019 08:11:16 GMT
x-amz-request-id: tx00000000000000279f46e-005963d003-1268c-ams1
Content-Type: text/plain
Content-Length: 14
Accept-Ranges: bytes
VersionId: 1554970190808057
Last-Modified: Thu, 11 Apr 2019 08:09:50 GMT
Etag: d41d8cd98f00b204e9800998ecf8427e
Connection: close

Note: You can also use aws s3api get-object --bucket BucketName --key dir/ObjectNameLocation ObjectName. The name of the output file must be the last parameter in the command.


GET Object ACL

This operation allows you to return the access control list (ACL) of an object.

Example Request

GET /test.html?acl HTTP/1.1

Host: bucket.s3.nl-ams.scw.cloud.com
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date: 20190411T081550Z
Authorization: authorization string

Example Response

HTTP/1.1 200 OK

Date: Thu, 11 Apr 2019 08:15:51 GMT
x-amz-request-id: tx0e22d038acce4d35b0b07-005caef7b6
Content-Type: text/html; charset=UTF-8
Content-Length: 698
Connection: close

<?xml version='1.0' encoding='UTF-8'?>
<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Owner>
    <ID>04dcf44f-a6ca-4e69-a74c-f0c557d87d79:a6a05c73-fa53-46a4-9ea1-e53b4f62552<ID>
    <DisplayName>04dcf44f-a6ca-4e69-a74c-f0c557d87d79:04dcf44f-a6ca-4e69-a74c-f0c557d87d79</DisplayName>
      </Owner>
        <AccessControlList>
          <Grant>
            <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
              <ID>04dcf44f-a6ca-4e69-a74c-f0c557d87d79:04dcf44f-a6ca-4e69-a74c-f0c557d87d79< ID>
              <DisplayName>04dcf44f-a6ca-4e69-a74c-f0c557d87d79:04dcf44f-a6ca-4e69-a74c-f0c557d87d79</DisplayName>
            </Grantee>
          <Permission>FULL_CONTROL</Permission>
          </Grant>
        </AccessControlList>
</AccessControlPolicy>

Note: You can also use aws s3api get-object-acl --bucket BucketName --key ObjectName.


GET Object tagging

This operation returns the tag set of the specified object.

Example Request*

GET /example-object?tagging HTTP/1.1
Host: bucket.s3.nl-ams.scw.cloud
Date: Wed, 13 Mar 2019 12:00:00 GMT
Authorization: authorization string

Example Response

<?xml version="1.0" encoding="UTF-8"?>
<Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <TagSet>
      <Tag>
      <Key>Object Description</Key>
      <Value>Company Presentation</Value>
   </Tag>
   <Tag>
      <Key>Client</Key>
      <Value>Scaleway</Value>
      </Tag>
   </TagSet>
</Tagging>

HEAD Object

The HEAD operation retrieves metadata from an object without returning the object itself. This operation is useful if you’re only interested in an object’s metadata. To use HEAD, you must have READ access to the object.

Example Request

HEAD /myfile.txt HTTP/1.1
Host: bucket.s3.nl-ams.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Date: Thu, 11 Apr 2019 08:25:56 GMT
Authorization: authorization string

Example Response

HTTP/1.1 200 OK
x-amz-id-2: tx8cd3dff03f0f4be7aee3c-005caefb1e
x-amz-request-id: tx8cd3dff03f0f4be7aee3c-005caefb1e
Date: Thu, 11 Apr 2019 08:25:56 GMT
Last-Modified: Thu, 11 Apr 2019 08:15:33 GMT
ETag: d41d8cd98f00b204e9800998ecf8427e
Content-Length: 689
Content-Type: text/plain
Connection: close

Note: You can also use aws s3api head-object --bucket BucketName --key ObjectName.


OPTIONS Object

The OPTIONS operation allows a browser to send a preflight request to Object Storage to determine if the actual request is supported with the specific origin, HTTP method and headers.

When a browser sends this request, Object Storage evaluates the rules that are defined in the CORS configuration.

Example Request

OPTIONS /exampleobject HTTP/1.1
Host: bucketname.s3.nl-ams.scw.cloud
Origin: http://www.example.com
Access-Control-Request-Method: PUT

Example Response

HTTP/1.1 200 OK
Date: Mon, 19 Mar 2019 11:38:17 GMT
Access-Control-Allow-Origin: http://www.example.com
Access-Control-Allow-Methods: PUT
Access-Control-Expose-Headers: x-amz-request-id

POST Object

This operation allows you to add an object to a specified bucket using HTML forms. POST is an alternate form of PUT that enables browser-based uploads as a way of putting objects in buckets.

Example Request

POST /file.txt HTTP/1.1
Content-Length: 4
Host: bucket.s3.nl-ams.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Date: Thu, 11 Apr 2019 08:28:57 GMT
Authorization: authorization string
Content-Type: text/plain
Expect: the 100-continue HTTP status code

ObjectContent

Example Response

HTTP/1.1 100 Continue
HTTP/1.1 200 OK
x-amz-id-2: txd16e07b7d52a46f08eb62-005caef22f
x-amz-request-id: txd16e07b7d52a46f08eb62-005caef22f
x-amz-version-id: default
Date: Thu, 11 Apr 2019 08:28:58 GMT
ETag: d41d8cd98f00b204e9800998ecf8427e
Content-Length: 0
Connection: close

PUT Object

This operation allows you to add an object to a bucket.

Example Request

PUT /example.txt HTTP/1.1

Content-Length: 14
Content-Type: text/plain
Host: bucket.s3.nl-ams.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date: 20190411T075215Z
Authorization: authorization string

Example Response

HTTP/1.1 200 OK

Date: Thu, 11 Apr 2019 07:52:15 GMT
x-amz-request-id: txd16e07b7d52a46f08eb62-005caef22f
Content-Length: 0
Accept-Ranges: bytes
Last-Modified: Thu, 11 Apr 2019 07:52:15 GMT
Etag: d41d8cd98f00b204e9800998ecf8427e
Connection: close

Note: You can also use aws s3api put-object --bucket BucketName --key dir-1/ObjectName --body ObjectName.


PUT Object Copy

This operation allows you to create a new object from an existing one.

Example Request

This example copies my-image.jpg into the bucket newbucket, with the key name my-second-image.jpg.

PUT /my-second-image.jpg HTTP/1.1
Host: oldbucket.s3.nl-ams.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Date: Thu, 11 Apr 2019 08:41:12 GMT
x-amz-copy-source: /bucket/my-image.jpg
Authorization: authorization string

Example Response

HTTP/1.1 200 OK
x-amz-id-2: tx4464d513d86f498c8b7ad-005caefda8
x-amz-request-id: tx4464d513d86f498c8b7ad-005caefda8
Date: Thu, 11 Apr 2019 08:41:12 GMT
Connection: close

<CopyObjectResult>
   <LastModified>2019-04-11Z08:33:10</LastModified>
   <ETag>f3c8f2ac362e890999d282db06a34469</ETag>
 </CopyObjectResult>

Note: You can also use aws s3api copy-object --copy-source bucket-1/test.txt --key test.txt --bucket bucket-2.


PUT Object ACL

This operation allows you to use the acl subressource to set the access control list (ACL) permissions for an object that already exists in a bucket. The --acl subcommand possible values are:

  • private
  • public-read
  • public-read-write
  • authenticated-read
  • bucket-owner-read
  • bucket-owner-full-control

Example Request

PUT /demo.jpg?acl HTTP/1.1

acl=
host:bucket.s3.nl-ams.scw.cloud
x-amz-acl:public-read
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20190411T085423Z

Example Response

HTTP/1.1 200 OK

Date: Thu, 11 Apr 2019 08:54:23 GMT
x-amz-request-id: txf2d890e745114dc5ace62-005caf03f1
Content-Type: application/xml
Content-Length: 0
Connection: close

Note: You can also use aws s3api put-object-acl --bucket BucketName --key file.txt --acl private.


PUT Object tagging

This operation allows you to add a tag set to an existing object in a bucket.

Example Request

PUT object-key?tagging HTTP/1.1
Host: bucket.s3.nl-ams.scw.cloud
Content-Length: length
Content-MD5: 88jyrDYuiQmZ0oLbBqNEaQ==
x-amz-date: 20190313T091956Z
Authorization: authorization string
<Tagging>
   <TagSet>
      <Tag>
         <Key>Object Description</Key>
         <Value>Company Presentation</Value>
      </Tag>
      <Tag>
         <Key>Client</Key>
         <Value>Scaleway</Value>
      </Tag>
   </TagSet>
</Tagging>

Example Response

HTTP/1.1 200 OK
x-amz-id-2: tx9b476790a39c409d8b029-005caf01d5
x-amz-request-id: tx9b476790a39c409d8b029-005caf01d5
Date: Wed, 13 Mar 2019 09:20:19 GMT

Multipart

Multipart upload allows you to upload a single object as a set of parts. Each part is a contiguous portion of the object’s data. You can upload these object parts independently and in any order. If transmission of any part fails, you can retransmit that part without affecting other parts. After all parts of your object are uploaded, Scaleway Object Storage assembles these parts and creates the object.

Example Request

This operation initiates a multipart upload for the example-object object.

POST /example-object?uploads HTTP/1.1
Host: bucketname.s3.scw.cloud
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Date: Mon, 1 Nov 2018 12:34:56 GMT
Authorization: authorization string

Example Response

HTTP/1.1 200 OK
x-amz-id-2: tx4464d513d86f498c8b7ad-005caefda8
x-amz-request-id: tx4464d513d86f498c8b7ad-005caefda8
Date:  Mon, 1 Nov 2018 12:34:56 GMT
Content-Length: 197
Connection: keep-alive

<?xml version="1.0" encoding="UTF-8"?>
<InitiateMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Bucket>example-bucket</Bucket>
  <Key>example-object</Key>
  <UploadId>NjJmNmJhYTEtNjk1Ny00ZjJlLWJhYWUtMDg5YWMzNzFjYjQ3</UploadId>
</InitiateMultipartUploadResult>

Note: You can also use aws s3api create-multipart-upload --bucket my-bucket --key 'multipart/01'.

Generating the Authorization String

You can generate the authorization string, following the authorization string procedure.


Discover a New Cloud Experience

Deploy SSD Cloud Servers in seconds.