Get view
This method returns a JSON describing specific view.
This operation requires space_view_views privilege.
Example cURL requests
Get information about specific view
curl -H "X-Auth-Token: $TOKEN" \
-X GET https://$HOST/api/v3/oneprovider/spaces/$SPACE_ID/views/$VIEW_NAME
{
"spatial": false,
"mapFunction": "function (id, type, meta, ctx) {\\n if(type == \\'custom_metadata\\' && meta[\\'onexattr\\']) {\\n return [meta[\\'onexattr\\'], id];\\n }\\n return null;\\n }"
"reduceFunction": null,
"viewOptions": {
"update_min_changes": 100
},
"providers": [
"6b9bc70630547d925861a27e1f050dfe"
]
}
Path parameters
| Parameter | Type & Description |
|---|---|
| sid required | string Space Id in which view exist. |
| view_name required | string Name of the view. |
Request Examples
oneprovider-rest-cli getSpaceView sid=$SPACE_ID view_name=$VIEW_NAMEResponses
Information about view.
Whether given view is spatial or not.
View mapping function.
View reduce function or null if there is none.
viewOptions object (ViewOptions) Options specified during creation or update of view conforming to the
automated view update description.
Options specified during creation or update of view conforming to the automated view update description.
Minimum number of document changes to trigger re-viewing.
Minimum number of document changes to trigger re-viewing of a replica index.
List of providers on which view can be queried.
Example
{
"spatial": false,
"mapFunction": "function (id, type, meta, ctx) {\\n if(type == \\'custom_metadata\\' && meta[\\'onexattr\\']) {\\n return [meta[\\'onexattr\\'], id];\\n }\\n return null;\\n }",
"spaceId": "ee4ac5df-095c-4760-bee9-a9bd2f37e508",
"reduceFunction": "null,",
"viewOptions": {
"update_min_changes": 100
},
"providers": [
"6b9bc70630547d925861a27e1f050dfe"
]
}Invalid request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}