Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Update view reduce function

PUT /spaces/{sid}/views/{view_name}/reduce

This method replaces the existing view reduce function code with the request body.

The reduce functions are defined as JavaScript functions which are executed on the database backend.

This operation requires space_manage_views privilege.

Example cURL requests

Update space view

curl -H "X-Auth-Token: $TOKEN" -X PUT \
-H "Content-type: application/javascript" \
-d "@./my_improved_reduce_fun.js" \
https://$HOST/api/v3/oneprovider/spaces/$SPACE_ID/views/$VIEW_NAME/reduce

Path parameters

Parameter Type & Description
sid required
string

Space Id in which view exist.

view_name required
string

Name of the view.

Request body

application/javascript

The view reduce function.

No schema provided.

Request Examples

Shell
cat view.js | oneprovider-rest-cli updateViewReduceFunction sid=$SPACE_ID view_name=$VIEW_NAME -

Responses

application/json
204

View reduce function updated successfully.

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