Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Add QoS requirement

POST /qos_requirements

Adds new QoS requirement for given file or directory. This triggers data replication (if needed) based on requirements defined in new QoS requirement.

For more information about QoS, please see this.

Example cURL requests

Add QoS requirement for file

curl -H "X-Auth-Token: $TOKEN" -X POST \
-H "Content-type: application/json" \
-d '{ "expression": "country=FR", "replicasNum": 2, "fileId": $FILE_ID }' \
"https://$HOST/api/v3/oneprovider/qos_requirements"

Request body

application/json

QoS requirement properties

PropertyType & Description
fileId
string

Id of file or directory requirement is going to be created for.

expression
string

Expression used to select storages on which file should be replicated.

replicasNum
integer

Number of required file replicas.

Request Examples

application/json
{
  "fileId": "00000000005CF4706775696423745F772D67686431633765446F4D76546D6F2D67575F3361737A7670486B477A7936587734507265584A7723394A4F355F5F396E4C31623031594576776E667431723230677767776C6B497031394E445F6E3868677873",
  "expression": "country=FR",
  "replicasNum": 2
}

Responses

application/json
201

The request has been accepted and the result is the QoS requirement Id (e.g. 'fc05cfc92eda7a054b835bc1ee4a1372'). Also URI of the QoS requirement in form https://$HOST/api/v3/oneprovider/qos_requirements/{qid} is returned in the response Location header.

PropertyType & Description
qosRequirementId
string

QoS requirement Id.

400

Invalid request.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
403

Forbidden request.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
404

File not found.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
500

Internal server error.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}