Create view
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
The view map function.
No schema provided.
Request Examples
cat view.js | oneprovider-rest-cli createSpaceView sid=$SPACE_ID view_name=$VIEW_NAME 'providers[]=$PROVIDER_ID_1' 'providers[]=$PROVIDER_ID_2' -Responses
View created successfully.
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."
}