Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get file distribution

GET /data/{id}/distribution

Returns information about a specific file distribution among different storage providers. Each provider is associated with a list of byte ranges (specified as a list of pairs [offset, size]), which describe which blocks of given file are stored at this provider.

Example cURL requests

Get file distribution

curl -X GET -H "X-Auth-Token: $TOKEN" \
"https://$HOST/api/v3/oneprovider/data/$FILE_ID/distribution"

[
  {
    "blocks": [ [ 0, 4 ], [ 10, 20 ] ],
    "providerId": "57ecb305-a097-4243-bd03-a995e78ab206"
  },
  {
    "blocks": [ [ 5, 9 ] ],
    "providerId": "7dedd2c7-dc58-4e62-925e-94663faa70fc"
  }
]

Path parameters

Parameter Type & Description
id required
string

The Id of the file

Request Examples

Shell
oneprovider-rest-cli getFileDistribution id=$FILE_ID

Responses

application/json
200

The list of file blocks stored at each provider.

No schema provided.

Example

application/json
[
  {
    "providerId": "b4687585-57d5-4edb-a192-0f3b1cab636b",
    "blocks": [
      [
        0,
        4
      ],
      [
        10,
        20
      ]
    ]
  },
  {
    "providerId": "a0274289-6f8a-482f-86f8-4a518760749c",
    "blocks": [
      [
        1024,
        2048
      ],
      [
        4096,
        1048576
      ]
    ]
  }
]
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."
}