FS3 API

Authentication

Login Swan Platform to get the authorization token which is used to acquire an access key pair for login FS3.

Acquire Access Key Pair

GET https://<access_url>/minio

This endpoint allows you to acquire an access key pair.

Headers

NameTypeDescription

Bearer Token

string

This token can be issued via Platform 'login' API.

{
    "data": {
        "access_key": "<access_key>",
        "access_url": "<access_url>",
        "secret_key": "<secret_key>"
    },
    "status": "success"
}

Login FS3

POST https://<access_url>/minio/webrpc

This endpoint allows you to acquire a token which is designed to do authorization before performing any actions for safety consideration.

Headers

NameTypeDescription

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.Login

params

array

Input 'username' which is 'access_key', and 'password' which is 'secret_key'.

{"jsonrpc":"2.0","result":{"token":"<bearer_token>","uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Bucket Management

Get Bucket List

POST https://<access_url>/minio/webrpc

This endpoint allows you to get a list of all buckets.

Headers

NameTypeDescription

User-Agent

string

Authorization

string

The bearer token is issued via 'login FS3' API.

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.ListBuckets

params

array

{"jsonrpc":"2.0","result":{"buckets":[{"name":"<example1>","creationDate":"2021-06-07T01:19:38.758964923Z"},{"name":"<example2>","creationDate":"2021-07-08T23:55:02.836502071Z"}],"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Create Bucket

POST https://<access_url>/minio/webrpc

This endpoint allows you to create a bucket.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.MakeBucket

params

array

input 'bucketName'

{"jsonrpc":"2.0","result":{"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Delete Bucket

POST https://<access_url>/minio/webrpc

This endpoint allows you to delete the bucket you selected.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.DeleteBucket

params

array

Input 'bucketName'

{"jsonrpc":"2.0","result":{"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Get Bucket Policy List

POST https://<access_url>/minio/webrpc

This endpoint allows you to get a list of policies of the bucket you selected.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.ListAllBucketPolicies

params

array

Input 'bucketName'

{"jsonrpc":"2.0","result":{"uiVersion":"2019-09-11T18:31:07Z","policies":[{"bucket":"<bucket_name>","prefix":"<policy_name>","policy":"<policy_type>"}]},"id":1}

Edit Bucket Policy

POST https://<access_url>/minio/webrpc

This endpoint allows you to add or remove a policy of the bucket you selected.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' Api.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.SetBucketPolicy

params

array

Input 'bucketName', 'policy', 'prefix'

{"jsonrpc":"2.0","result":{"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Backup Bucket to Filecoin - online deal

POST https://<access_url>/minio/deals/<bucket>

This endpoint allows you to backup the bucket you selected to Filecoin network as an online deal.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

MinerId

string

provider ID

Price

string

unit: fil

Duration

string

unit: epoch

VerifiedDeal

string

true/false

FastRetrieval

string

true/false

{
    "data": {
        "filename": "~/minio-data/test_deals.zip",
        "walletAddress": "h376xbytsd3jie6ermpw",
        "verifiedDeal": "false",
        "fastRetrieval": "true",
        "dataCid": "bafk2bza5dgw6pubjodkscqpg",
        "minerId": "t03354",
        "price": "0.000005",
        "duration": "518800",
        "dealCid": "bafyreicvqh7krdhdnpkqwokze",
        "timeStamp": "1629835134146540"
    },
    "status": "success",
    "message": "success"
}

Backup Bucket to Filecoin - offline deal

POST https://<access_url>/minio/offlinedeals/<bucket>

This endpoint allows you to backup the bucket you selected to Filecoin network as an offline deal.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

Task_Name

string

Task name you preferred.

Curated_Dataset

string

Description

string

Is_Public

string

The task is whether public or private. The possible values: 1, 0

Type

string

The deals in this task is whether regular or verified. the possible values: regular, verified.

Miner_Id

string

The provider you want to assign the task to. Required if is_public is set to 0.

Min_Price

string

Min price per Gib per epoch.

Max_Price

string

Max price per Gib per epoch.

Tags

string

Up to 5 tags.

Expire_Days

string

Auto_bid

string

The task is available to auto-bid or not. The possible values: 1, 0. Required if is_public is set to 1.

{
    "data": {
        "bucket_name": "test",
        "deals": {
            "data": {
                "taskname": "test-name",
                "filename": "be450523-52ed-44f9-9828-8e382c0d15c8.csv",
                "uuid": "d2d79d42-6f79-46fe-97bd-cd6f69c25116"
            },
            "status": "success",
            "message": "Task created successfully.A notification email has been sent to the storage provider"
        }
    },
    "status": "success",
    "message": "success"
}

Retrieve Bucket from Filecoin - online deal

GET https://<access_url>/minio/bucket/retrieve/<bucket>

This endpoint allows you to retrieve the bucket you selected from Filecoin network.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

{
    "data": {
        "bucket_name": "20210824",
        "deals": [
            {
                "data": {
                    "filename": "~/minio-data/test_deals.zip",
                    "walletAddress": "t3u7pum2vzyasg7cimkpnojqd3jie6erm",
                    "verifiedDeal": "false",
                    "fastRetrieval": "true",
                    "dataCid": "bafykbvgxdpej7neeoqsnvuzppme",
                    "minerId": "t03354",
                    "price": "0.000005",
                    "duration": "518700",
                    "dealCid": "bafyrekm3lmusljgmvyriqid6kcaoed5kni",
                    "timeStamp": "1629816006709676"
                },
                "status": "success",
                "message": "success"
            },
            {
                "data": {
                    "filename": "~/minio-data/test_deals.zip",
                    "walletAddress": "t3u7khtadjzfydxxdanojqd3jie6ermpw",
                    "verifiedDeal": "false",
                    "fastRetrieval": "true",
                    "dataCid": "bafykbnvz5rgs7obwbfztqrr4ahwjue",
                    "minerId": "t03354",
                    "price": "0.000005",
                    "duration": "518800",
                    "dealCid": "bafyrgigdm4ppqzwt4vufm4m3pmuvolnfe",
                    "timeStamp": "1629833844752891"
                },
                "status": "success",
                "message": "success"
            }
        ]
    },
    "status": "success",
    "message": "success"
}

Object Management

Get Objects List

POST https://<access_url>/minio/webrpc

This endpoint allows you to get a list of all objects of the bucket you selected.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.ListObjects

params

array

Input 'bucketName', 'prefix'

{"jsonrpc":"2.0","result":{"objects":[{"name":"example_file","lastModified":"2021-06-07T01:19:38.758964923Z","size":0,"contentType":"application/octet-stream"}],"writable":true,"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Upload Object

PUT https://<access_url>/minio/upload/<bucket>/<object>

This endpoint allows you to upload objects to the bucket you selected.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

x-amz-date

string

Request Body

NameTypeDescription

object

object

Select the file you desired to upload.

Get URL Token

POST https://<access_url>/minio/webrpc

This endpoint allows you to get a URL token for downloading objects.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.CreateURLToken

params

string

{"jsonrpc":"2.0","result":{"token":"<bearer_token>","uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Download Objects

GET https://<access_url>/minio/download/<bucket>/<object>

This endpoint allows you to download objects.

Path Parameters

NameTypeDescription

token

string

This token is issued via 'get URL Token' API.

Headers

NameTypeDescription

User-Agent

string

Delete Object

POST https://<access_url>/minio/webrpc

This endpoint allows you to delete the object you selected.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API

User-Agent

string

x-amz-date

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.RemoveObject

params

array

Input 'bucketName', 'objects'

{"jsonrpc":"2.0","result":{"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Share Object

POST https://<access_url>/minio/webrpc

This endpoint allows you to share the object you selected.

Headers

NameTypeDescription

User-Agent

string

Authorization

string

The bearer token is issued via 'login FS3' API.

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.PresignedGet

params

array

Input 'bucket', 'expiry', 'host', 'object'.

Backup Object to Filecoin - online deal

POST https://<access_url>/minio/deal/<bucket>/<object>

This endpoint allows you to backup the object you selected to Filecoin network.

Headers

NameTypeDescription

User-Agent

string

Authorization

string

The bearer token is issued via 'login FS3' API.

Request Body

NameTypeDescription

MinerId

string

provider ID

Price

string

unit: fil

Duration

string

unict: epochs

VerifiedDeal

string

true/false

FastRetrival

string

true/false

{
    "data": {
        "filename": "~/minio-data/test/waymo.zip",
        "walletAddress": "wabkhtadjzfydxxda2vzyasg7cimd3jie6ermpw",
        "verifiedDeal": "false",
        "fastRetrieval": "true",
        "dataCid": "bafykbzaceb5cfdrbg45khvhk4mza6",
        "minerId": "t03354",
        "price": "0.000005",
        "duration": "1036700",                    //epochs
        "dealCid": "bafyreicmqtttadqdksrqvunxhcgvfvb47m",
        "timeStamp": "1628025191856290"           //miliseconds
    },
    "status": "success",
    "message": "success"
}

Retrieve Object from Filecoin - online deal

GET https://<access_url>/minio/retrieve/<bucket>/<object>

This endpoint allows you to retrieve the object you selected from Filecoin network.

Headers

NameTypeDescription

User-Agent

string

Authorization

string

The bearer token is issued via 'login FS3' API.

{
    "data": {
        "file_name": "waymo.zip",
        "deals": [
            {
                "data": {
                    "filename": "~/minio-data/test/waymo.zip",
                    "walletAddress": "5wabkhtadjzfydxxdq66j4dubbhwpnojqd3jmpw",
                    "verifiedDeal": "false",
                    "fastRetrieval": "true",
                    "dataCid": "bafykbzaceb5cfdpdupjd4mza6",
                    "minerId": "t03354",
                    "price": "0.000005",
                    "duration": "1036700",
                    "dealCid": "bafyreicmm2g654",
                    "timeStamp": "1628025191856290"
                },
                "status": "success",
                "message": "success"
            },
            {
                "data": {
                    "filename": "~/minio-data/testre/waymo.zip",
                    "walletAddress": "5wabkhtadjzfydxxda2vzyasg7cimkcphswrq66j4dubbhwpnoj",
                    "verifiedDeal": "false",
                    "fastRetrieval": "true",
                    "dataCid": "bafykbzaceb5cfdpdupjd4mza6",
                    "minerId": "t03354",
                    "price": "0.000005",
                    "duration": "1036700",
                    "dealCid": "bafyreijg227wlo4bge76bcxk7cw",
                    "timeStamp": "1628026238100552"
                },
                "status": "success",
                "message": "success"
            }
        ]
    },
    "status": "success",
    "message": "success"
}

General Settings

Change Password

POST https://<access_url>/minio/webrpc

This endpoint allows you to change password.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.SetAuth

params

array

Input 'currentAccessKey', 'currentSecretKey', 'newAccessKey', 'newSecretKey'.

Get Storage Info

POST https://<access_url>/minio/webrpc

This endpoint allows you to get storage information.

Headers

NameTypeDescription

Authorization

string

The bearer token is issued via 'login FS3' API.

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.StorageInfo

params

string

{"jsonrpc":"2.0","result":{"storageInfo":{"Used":653465,"Total":7537270108160,"Available":4140889018368,"Backend":{"Type":1,"OnlineDisks":0,"OfflineDisks":0,"StandardSCData":0,"StandardSCParity":0,"RRSCData":0,"RRSCParity":0,"Sets":null}},"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Get Server Info

POST https://<access_url>/minio/webrpc

Headers

NameTypeDescription

Authorization

string

User-Agent

string

Request Body

NameTypeDescription

id

string

1

jsonrpc

string

2.0

method

string

web.ServerInfo

params

string

{"jsonrpc":"2.0","result":{"MinioVersion":"2019-09-11T18:33:15Z","MinioMemory":"Used: 6.8 MB | Allocated: 3.7 GB | Used-Heap: 6.8 MB | Allocated-Heap: 65 MB","MinioPlatform":"Host: 2f245ecded89 | OS: linux | Arch: amd64","MinioRuntime":"Version: go1.13 | CPUs: 24","MinioGlobalInfo":{"isBrowserEnabled":true,"isDistXL":false,"isEnvBrowser":false,"isEnvCreds":false,"isEnvRegion":false,"isSSL":false,"isWorm":false,"isXL":false,"serverRegion":""},"MinioUserInfo":{"isIAMUser":false},"uiVersion":"2019-09-11T18:31:07Z"},"id":1}

Last updated