Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Query harvester index

POST /harvesters/{id}/indices/{idx}/query

Performs query to index {idx} in harvester {id}.

This operation does not require any privileges when the harvester is public otherwise being member of the harvester is required. For administrators who do not have to be members of this harvester, oz_harvesters_view privilege is required.

Request body and response depend on selected harvester_plugin. Below examples are for elasticsearch_plugin.

Example cURL requests

query harvester index

curl -u username:password -H "Content-type: application/json" -X POST \
-d '{ "method" : "get", "path" : "resource_id"}'
 https://$HOST/api/v3/onezone/harvesters/$HARVESTER_ID/indices/$INDEX_ID/query

Path parameters

Parameter Type & Description
id required
string

Harvester Id.

idx required
string

Index Id.

Request body

application/json
PropertyType & Description
method
string

Method of request to Elasticsearch.

Enum:
postget
path
string

Resource path relative to index

body
any

Body of request to Elasticsearch.

Request Examples

application/json
{
  "method": "get",
  "path": "entry_id?stored_fields=tags,counter"
}

Responses

application/json
200

Results of the query on given index.

PropertyType & Description
headers
object

Headers of the Elasticseach response.

code
integer

Status code of the Elasticsearch response.

body
string

Body of the Elasticsearch response.

Example

application/json
{
  "headers": {
    "content-type": "application/json; charset=UTF-8",
    "content-length": "142"
  },
  "code": 404,
  "body": "{\"_index\":\"ngi1mdnly2i5od\",\"_type\":\"_doc\",\"_id\":\"awda\",\"found\":false}"
}
400

Invalid request.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
401

Authentication error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
403

Authorization error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
404

Resource not found.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
500

Internal server Error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}