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.
| Property | Type & Description | ||||
|---|---|---|---|---|---|
spatial boolean Whether given view is spatial or not. | |||||
mapFunction string View mapping function. | |||||
reduceFunction string 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.
| |||||
providers array of strings 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.
| 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."
}