Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get view

GET /spaces/{sid}/views/{view_name}

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

Shell
oneprovider-rest-cli getSpaceView sid=$SPACE_ID view_name=$VIEW_NAME

Responses

application/json
200

Information about view.

PropertyType & 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.

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 index.

providers
array of strings

List of providers on which view can be queried.

Example

application/json
{
  "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"
  ]
}
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."
}