Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Replicate files by view Deprecated

POST /replicas-view/{view_name}

This enpoint is deprecated, please use this one.

Queries the specified view and replicates the resulting list of files to specified provider. This operation is asynchronous and it can take a long time depending on the size of the data to move.

This operation supports custom view query attributes as provided by Couchbase.

Additionally, Couchbase spatial queries are possible using the bbox query parameter. These queries are possible on views which emit values conforming to the GeoJSON format.

This operation requires space_schedule_replication and space_query_views privileges.

Example cURL requests

Replicate files returned by view within specified space to any provider

curl -X POST -H "X-Auth-Token: $TOKEN" \
"https://$HOST/api/v3/oneprovider/replicas-view/$VIEW_NAME?space_id=$SPACE_ID"


{ "transferId": "4f674576-4c63-443b-b3d5-2f74a40724a0"}

Replicate 100 files (skipping the first 200) returned by view within specified space to any provider with URL callback

curl -X POST -H "X-Auth-Token: $TOKEN" \
-H 'Content-type: application/json' -d '{ "url": "http://example.com/transfer_complete" }' \
"https://$HOST/api/v3/oneprovider/replicas-view/$VIEW_NAME?space_id=$SPACE_ID&provider_id=$PROVIDER_ID&skip=200&limit=100"


{ "transferId": "b3c85b99-44db-4277-8c66-2ccd50888565" }

Path parameters

Parameter Type & Description
view_name required
string

Name of the view.

Query parameters

Parameter Type & Description
space_id required
string

Space Id in which view exist.

provider_id
string

The Id of the provider to which the files will be replicated. By default the files will be replicated to the provided handling this REST call.

descending
boolean

Return the documents in descending order (by key).

key
string

Return only documents that match the specified key. Key must be specified as a JSON value.

limit
integer

Limit the number of the returned documents to the specified number.

skip
integer

Skip this number of records before starting to return the results.

startkey
string

Return records with a value equal to or greater than the specified key. Key must be specified as a JSON value.

startkey_docid
string

Return records starting with the specified document Id.

endkey
string

Stop returning records when the specified key is reached. Key must be specified as a JSON value.

endkey_docid
string

Stop returning records when the specified document Id is reached.

inclusive_end
boolean

Specifies whether the specified end key is included in the result. Note: Do not use inclusive_end with key or keys.

stale
string

Allow records from a stale view to be used. Allowed values are ok, update_after or false.

bbox
string

Specify the bounding box for a spatial query (e.g. ?bbox=-180,-90,0,0)

spatial
boolean

Enable spatial type of query. When querying the file-popularity view, the start_range and end_range constraints should be specified as 6-dimensional arrays, with the following fields: [SizeLowerLimit, LastOpenHoursEpochLowerLimit, TotalOpenLowerLimit, HoursOpenAvgLowerLimit, DayOpenAvgLowerLimit, MonthOpenAvgLowerLimit].

start_range
string

Array specifying the range in spatial queries (e.g. start_range=[1,0,0,0,0,0]).

end_range
string

Array specifying the range in spatial queries (e.g. end_range=[null,null,null,null,null,null]).

Request body

application/json

This parameter allows the user to specify a REST callback URL which will be called when the transfer is complete

PropertyType & Description
url
string

The URL which should be called, when requested action completed.

Request Examples

application/json
{
  "url": "http://monitoring.example.com:8080/notifications"
}

Responses

application/json
201

The replication request was accepted and the result is the transfer Id, which can be used for monitoring the transfer status.

PropertyType & Description
transferId
string

Transfer 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."
}