Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Create a new harvester for the current user

POST /user/harvesters

Creates a new harvester as current user. The user automaticaly becomes the harvesters' member.

This operation can be invoked on behalf of the current user only.

Example cURL requests

Create new user harvester

curl -u admin:password -H "Content-type: application/json" -X POST \
-X POST -d '{ "name" : "new_harvester", "endpoint" : "example.elastic.com:9200", "harvestingBackendType" : "elasticsearch_harvesting_backend"  \
"config" : { "typeMapping": [ { "id": 0, "name": "Type 1" }, { "id": 1, "name": "Type 1" } ],
             "externalHelpLink": "http://example.com/some_help_page",
             "refreshDataTimeout": 1000 }, \
https://$HOST/api/v3/onezone/user/harvesters

Request body

application/json

New harvester parameters.

PropertyType & Description
name
string

The name of the harvester.

harvestingBackendType
string

Type of external harvesting backend that will provide persistence and analytics for harvested metadata. Can be chosen from predefined backends and optionally custom ones configured by Onezone admins. Can be omitted if default harvester backend is set up in Onezone.

harvestingBackendEndpoint
string

Endpoint where the specified harvesting backend can be reached by Onezone to feed incoming metadata and perform queries. Can be omitted if default harvester backend is set up in Onezone.

guiPluginConfig
object (HarvesterGuiPluginConfig)

Custom JSON configuration passed to harvester GUI plugin.

guiPluginConfig required
object

Request Examples

application/json
{
  "name": "My private harvester",
  "harvestingBackendType": "elasticsearch_harvesting_backend",
  "harvestingBackendEndpoint": "example.elastic.com:9200",
  "guiPluginConfig": {
    "typeMapping": [
      {
        "id": 0,
        "name": "Type 1"
      },
      {
        "id": 1,
        "name": "Type 1"
      }
    ],
    "externalHelpLink": "http://example.com/some_help_page",
    "refreshDataTimeout": 1000
  }
}

Responses

application/json
201

URI of the created harvester in form https://$HOST/api/onezone/v3/user/harvesters/{id} is returned in the response Location header.

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."
  }
}