Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Add storage

POST /provider/storages

Adds additional storage resources to the provider.

Example cURL requests

Add storage

curl -H "X-Auth-Token: $TOKEN" -X POST https://$OP_PANEL_HOST/api/v3/onepanel/provider/storages \
-H "Content-Type: application/json" -d '{
    "My S3 Storage": {
        "type": "s3",
        "hostname": "https://iam.example.com:443",
        "bucketName": "bucket1.iam.example.com"
    },
    "My Posix Storage": {
        "type": "posix",
        "mountPoint": "/volumes/inexistent/path"
    }
}'

{
  "My S3 Storage": {
      "id": "f891d1ddf693232bbf0c11fe3cd9f7e7cheda9"
  },
  "My Posix Storage": {
      "error": {
          "id": "storageTestFailed",
          "description": "Failed to write test file on storage.",
          "details": {
              "operation": "write"
          }
      }
  }
}

Request body

application/json

The configuration details of storage resources to be added to the provider deployment. Must be an object with unique names for the storages as keys and their corresponding configuration (objects) as values - see the request body example.

No schema provided.

Request Examples

application/json
{
  "s3": {
    "type": "s3",
    "s3Hostname": "https://s3.example.com",
    "iamHostname": "iam.example.com",
    "bucketName": "bucket1.iam.example.com",
    "accessKey": "4efb70ad3e1fc8dd73c721b8f683b2e831503892",
    "secretKey": "fdeac26aedd3a179f9551d7007cc6a6273165782"
  },
  "posix": {
    "type": "posix",
    "mountPoint": "/mnt/posix/onedata-space"
  }
}

Responses

application/json
200

Response consists of map, where keys are names of storages passed in the request, and values respresent id of added storage.

No schema provided.

400

Invalid request. Response consists of map, where keys are names of storages passed in the request, and values respresent id of added storage, or an error describing why the storage has not been added.

No schema provided.

401

Unauthorized request.

403

Forbidden request.

500

Internal server error.

PropertyType & Description
error
object (ErrorDetails)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
503

Services needed to fulfill this request are not running.