# Interface: S3-API
## Configuration of LeoGateway

Update LeoGateway's protocol configuration to `s3` in your [LeoGateway configuration](https://github.com/leo-project/leofs/blob/1.3.2.1/apps/leo_gateway/priv/leo_gateway.conf)

```ini
## --------------------------------------------------------------------
## GATEWAY Protocol
## --------------------------------------------------------------------
## Gateway Protocol to use: [s3 | rest | embed | nfs]
protocol = s3
```

## S3 API Implementation Status
### Object Operation

| No | API | Status |
|----|-----|--------|
| 1  | DELETE Object | Yes |
| 2  | Delete Multiple Objects | Yes |
| 3  | GET Object | Yes |
| 4  | GET Object ACL | Plans to support with v1.5 |
| 5  | GET Object torrent | No |
| 6  | HEAD Object | Yes |
| 7  | POST Object | Yes |
| 8  | PUT Object | Yes |
| 9  | PUT Object ACL | Plans to support with v1.5 |
| 10 | PUT Object - Copy | Yes |
| 11 | Initiate Multipart Upload | Yes |
| 12 | Upload Part | Yes |
| 13 | Upload Part - Copy | Yes |
| 14 | Complete Multipart Upload | Yes |
| 15 | Abort Multipart Upload | Yes |
| 16 | List Parts | No |

### Bucket Operation

| No | API | Status |
|----|-----|--------|
| 1 | DELETE Bucket | Yes |
| 2 | DELETE Bucket life cycle | No |
| 3 | DELETE Bucket policy | No |
| 4 | DELETE Bucket website | No |
| 5 | GET Bucket (List Objects) | Yes |
| 6 | GET Bucket ACL | Yes |
| 7 | GET Bucket life cycle | No |
| 8 | GET Bucket policy | No |
| 9 | GET Bucket location | Yes |
| 10 | GET Bucket logging | No |
| 11 | GET Bucket notification | No |
| 12 | GET Bucket Object versions | Plan to support with v2.0 |
| 13 | GET Bucket requestPayment | No |
| 14 | GET Bucket versioning | Plan to support with v2.0 |
| 15 | GET Bucket website | No |
| 16 | HEAD Bucket | Yes |
| 17 | List Multipart Uploads | No |
| 18 | PUT Bucket | Yes |
| 19 | PUT Bucket ACL | Yes |
| 20 | PUT Bucket life cycle | No |
| 21 | PUT Bucket policy | No |
| 22 | PUT Bucket logging | No |
| 23 | PUT Bucket notification | No |
| 24 | PUT Bucket requestPayment | No |
| 24 | PUT Bucket versioning | Plan to support with v2.0 |
| 25 | PUT Bucket website | No |

## Amazon S3 Interface
### Amazon S3 Official Documentation

* [AWS Documentation / Amazon Simple Storage Service (S3) / Developer Guide / What Is Amazon S3?](https://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html)

### How to determine the name of Bucket

* [Virtual Hosting of Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html)
* Values used for determining the name:
	* S3 uses a HTTP host header or a path segment in the HTTP request line
	* How S3 determines what to use depends on a domain name

#### 1. https://s3.amazonaws.com/bucket/path_to_file

In this case, a bucket's name is the first segment of a path.


| Name | Value |
|------|-------|
| Request line | GET /bucket/path_to_file HTTP/1.1 |
| Host header| Host: s3.amazonaws.com |


#### 2. https://www.example.com.s3.amazonaws.com/path_to_file

In this case, the name of the bucket is the part of the domain name before `.s3.amazonaws.com`.

| Name | Value |
|------|-------|
| Request line | GET /path_to_file HTTP/1.1 |
| Host header| Host: www.example.com.s3.amazonaws.com |


#### 3. https://www.example.com/path_to_file

In this case, a bucket's name is equal to the `FQDN`.

| Name | Value |
|------|-------|
| Request line | GET /path_to_file HTTP/1.1 |
| Host header | Host header |

The argument of LeoFSâ€™ `whereis` OR `purge` commands should be "www.example.com/path_to_file".


### Naming Rule of a Bucket

We recommend as a best practice that you always use DNS-compliant bucket names regardless of the region in which you create the bucket.

* Bucket names can be as long as between 3 and 255 characters.
* Bucket names can contain lowercase letters, numbers, periods (.), dashes (-) and underscores (_).
* Bucket names must not be formatted as an IP address (e.g., 192.168.5.4).
* Bucket name cannot start and end with periods (.), dashes (-) and underscores (_).

## S3 Clients

* [AWS SDKs](https://aws.amazon.com/tools/)
* [Dragon Disk, A cloud Storage client](http://www.s3-client.com/)
* [S3cmd, Command Line S3 Client and Backup for Linux and Mac](http://s3tools.org/s3cmd)


## Related Links

* [For Administrators / Settings / LeoGateway Settings](/admin/settings/leo_gateway.md)
