S3

Basic Operations

S3 Shares may be created, read, updated, and destroyed via the API. Since the S3 protocol requires a root user and root password to access the data, we allow those values to be specified during creation. Similarly, since minio will serve up the filesystem at a port on the system, users are also able to designate which port they would like minio to utilize.

List S3 Shares

Request Object

+ URL
  /api/v2/s3/list

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

Sending this should get you back a valid response, if you’ve sent correct credentials.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
   {
    "somesharename": {
        "path": "/Pool1/FS1",
        "enabled": true,
        "port": "9000",
        "user": "root",
        "rootUser": "222222",
        "rootPassword": "**********3334",
        "raw": "[Unit]\nDescription=Minio Export Daemon for: somesharename s3 share\nAfter=network-online.target\n[Service]\nEnvironmentFile=/etc/minio/minio.conf.d/s3-somesharename\nExecStart=/usr/bin/minio gateway nas ${PATH} --address=:${PORT}\nRestart=on-abort\nUser=root\n[Install]\nWantedBy=multi-user.target"
     }
   }

Get S3 Shares

Send this request to recieve the details of a specific S3 share on the OpenDrives system.

Permissions

This route exposes the root password of the s3 share you have created. As such, it requires the s3:manage permissions to access the data stored here.

Request Object

+ URL
  /api/v2/s3/$SHARE_NAME/details

+ Method
  GET

+ Parameters
  share name (string, required, URL param) - the name of the share you would like to view

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

+ Headers
  Access-Control-Allow-Origin: *
  Content-Type: application/string; charset=utf-8

+ Body
  {
    "shareName": "somesharename",
    "path": "/Pool1/FS1",
    "enabled": true,
    "port": "9000",
    "rootUser": "222222",
    "rootPassword": "33333334",
    "user": "root",
    "raw": "[Unit]\nDescription=Minio Export Daemon for: somesharename s3 share\nAfter=network-online.target\n[Service]\nEnvironmentFile=/etc/minio/minio.conf.d/s3-somesharename\nExecStart=/usr/bin/minio gateway nas ${PATH} --address=:${PORT}\nRestart=on-abort\nUser=root\n[Install]\nWantedBy=multi-user.target",
    "conf": "MINIO_ROOT_USER = 222222\nMINIO_ROOT_PASSWORD = 33333334\nPATH = /Pool1/FS1\nPORT = 9000\n"
  }

Create S3 Shares

Any number of S3 shares can be created for any filepath on your OpenDrives system. We recommend only using one share per filesystem, unless your situation specifically requires multiple shares.

We do not alter any of the existing permissions on a share’s filesystem.

Request Object

+ URL
  /api/v2/s3/create

+ Method
  POST

+ Parameters
  shareName (string, required, Body) - the name you would like to give this share
  path (string, required, Body) - the path of the filesystem you would like to export as s3
  port (string, required, Body) - the port you would like this share to be available at
  rootUser (string, required, Body) - the AWS S3 compliant root user(access key) you would like to use for the share. If your root user does not meet aws' minimum standards the service will not start.
  rootPassword (string, required, Body) - the AWS S3 compliant root password(secret key) you would like to use for the share. If your secret does not meet aws' minimum standards the service will not start.

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "shareName": "myshare",
    "path": "/Pool1/FS1",
    "port": "9010",
    "rootUser": "22334565454",
    "rootPassword": "77556455856"
  }

Response Object

+ Headers
  Access-Control-Allow-Origin: *
  Content-Type: application/string; charset=utf-8

+ Body
  {
    "shareName": "myshare",
    "serviceName": "s3-myshare.service",
    "raw": "[Unit]\nDescription=Minio Export Daemon for: myshare s3 share\nAfter=network-online.target\n[Service]\nEnvironmentFile=/etc/minio/minio.conf.d/s3-myshare\nExecStart=/usr/bin/minio gateway nas ${PATH} --address=:${PORT}\nRestart=on-abort\nUser=root\n[Install]\nWantedBy=multi-user.target"
  }

Update S3 Share

S3 shares can be edited in the same fashion they are created by using this route. In this route, you could change the root user and or root password of your s3 share.

Request Object

+ URL
  /api/v2/s3/$SHARE_NAME/update

+ Method
  POST

+ Parameters
  share name (string, required, URL param) - the name of the share you would like to edit
  rootUser (string, optional, Body) - the AWS S3 compliant root user(access key) you would like to use for the share. If your root user does not meet aws' minimum standards the service will not start.
  rootPassword (string, optional, Body) - the AWS S3 compliant root password(secret key) you would like to use for the share. If your secret does not meet aws' minimum standards the service will not start.

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "rootUser": "222525325352",
    "rootPassword": "225325253252"
  }

Response Object

If this is successful, you will recieve a response with the S3 share name and service name, as well as the raw text of the environment file that stores your root user and root password.

+ Headers
  Access-Control-Allow-Origin: *
  Content-Type: application/string; charset=utf-8

+ Body
  {
    "shareName": "myshare",
    "serviceName": "s3-myshare.service",
    "raw": "MINIO_ROOT_USER = 222525325352\nMINIO_ROOT_PASSWORD = 225325253252\nPATH = /Pool1/FS1\nPORT = 9010\n"
  }

Delete S3 Shares

Using this route, you will be able to delete an S3 share from your system. This action will delete the service that controls your s3 share and the environment file associated to that service. It will not alter the filesystem we were serving out as S3. Be careful though, there is no confirmation required and this action is final.

Request Object

+ URL
  /api/:version/s3/$SHARE_NAME/delete

+ Method
  POST

+ Headers
  Content-Type: application/string; charset=utf-8
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Parameters
  shareName (string, required, URL param) - the name you would like to give this share

+ Body
 {}

Response Object

+ Headers
  Access-Control-Allow-Origin: *
  Content-Type: application/string; charset=utf-8

+ Body
  "Successfully deleted s3-myshare."