Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Evict existing replicas by view Deprecated

DELETE /replicas-view/{view_name}

This enpoint is deprecated, please use this one.

Queries the specified view and evicts the resulting list of replicas in specified provider. This operation is asynchronous. Optional argument migration_provider_id can be used to specify where the repliace has to be replicated before being evicted from this provider.

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_query_views and space_schedule_eviction when scheduling eviction
  • space_query_views, space_schedule_eviction and space_schedule_replication when scheduling migration

Example cURL requests

Evicts 100 replicas (skipping the first 200) returned by view within specified space from specific provider

curl -X DELETE -H "X-Auth-Token: $TOKEN" -H 'Content-type: application/json' \
"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 from which the replica will be evicted. By default the replicas will be evicted in the provider handling this REST call.

migration_provider_id
string

The Id of the provider to which the replicas should be synchronized before being evicted.

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 Examples

Shell
oneprovider-rest-cli evictReplicasByView space_id=$SPACE_ID view_name=$VIEW_NAME key=value1

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