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 -H "X-Auth-Token: $TOKEN" -X GET "https://$HOST/api/v3/oneprovider/data/$FILE_ID/distribution"

[
    {
        "blocks": [ [ 0, 4 ], [ 10, 20 ] ],
        "providerId": "a0b1d2e6ad583ba1b14caf3b71bc6129ch4f74"
    },
    {
        "blocks": [ [ 5, 9 ] ],
        "providerId": "b107606a22f006b82f6f665a9e6f116cch0500"
    }
]

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.

Property
Type & 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.

Property
Type & 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.

Property
Type & 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.

Property
Type & 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."
}