Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Create view

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

This method creates or replaces an existing view with a new one.

This operation requires space_manage_views privilege.

Example cURL requests

Create space view

curl -H "X-Auth-Token: $TOKEN" -X PUT \
-H "Content-type: application/javascript" \
-d "@./my_improved_view1.js" \
https://$HOST/api/v3/oneprovider/spaces/$SPACE_ID/views/$VIEW_NAME?spatial=false&providers[]=$PROVIDER_ID_1&providers[]=$PROVIDER_ID_2

Path parameters

Parameter Type & Description
sid required
string

Space Id in which view will be created.

view_name required
string

Name of the view.

Query parameters

Parameter Type & Description
spatial
boolean

Specifies whether view is spatial or not.

update_min_changes
integer

Minimum number of document changes to trigger re-viewing.

replica_update_min_changes
integer

Minimum number of document changes to trigger re-viewing of a replica view.

providers[]
array

Providers which will create view.

Request body

application/javascript

The view map function.

No schema provided.

Request Examples

Shell
cat view.js | oneprovider-rest-cli createSpaceView sid=$SPACE_ID view_name=$VIEW_NAME 'providers[]=$PROVIDER_ID_1' 'providers[]=$PROVIDER_ID_2' -

Responses

application/json
204

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