Replicate files by view Deprecated
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 |
| stale | string Allow records from a stale view to be used. Allowed values are |
| 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 | string Array specifying the range in spatial queries (e.g. |
| end_range | string Array specifying the range in spatial queries (e.g. |
Request body
This parameter allows the user to specify a REST callback URL which will be called when the transfer is complete
| Property | Type & Description |
|---|---|
url string The URL which should be called, when requested action completed. | |
Request Examples
{
"url": "http://monitoring.example.com:8080/notifications"
}Responses
The replication request was accepted and the result is the transfer Id, which can be used for monitoring the transfer status.
| Property | Type & Description |
|---|---|
transferId string Transfer Id. | |
Invalid request.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}