Create new index in harvester
Creates new index in given harvester.
This operation requires oz_harvesters_update admin privilege.
Example cURL requests
Create new index in harvester
curl -u username:password -H "Content-type: application/json" \
-X POST -d '{ "name" : "My study index", "guiPluginName" : "study"}\
https://$ZONE_HOST/api/v3/onezone/harvesters/$HARVESTER_ID/indices
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Harvester Id. |
Request body
Index properties.
The name of the index.
Mapping of index name to one recognized by gui plugin. Allows to specify this index to be used by GUI plugin to produce search results. Recognized gui index names are listed in gui plugin manifest.
Schema of the index provided as string (e.g. encoded JSON).
Specifies what types of file metadata should be harvested in this index. At least one type must be given.
Specifies what file details should be harvested alongside the metadata. Enabling metadataExistenceFlags will add boolean flags saying whether the file has any metadata of certain type. The fileName field may be utilized by the GUI plugin to improve the browsing experience.
If enabled, all harvesting errors (e.g. when the index rejects a payload due to non-matching schema) are stored as text in the index, which may be useful for later analysis.
If enabled, all payloads rejected by the harvesting backend will be automatically analysed for offending data (e.g. fields that do not match the schema), pruned and submitted again. This might slow down the harvesting process and cause nonconformant metadata to be lost.
Request Examples
{
"name": "My study index",
"guiPluginName": "study",
"schema": "{ \"mappings\": { \"properties\": { \"foo\": { \"type\": \"keyword\" } } } }",
"includeMetadata": [
"json",
"xattrs"
],
"includeFileDetails": [
"fileName",
"metadataExistenceFlags"
],
"includeRejectionReason": false,
"retryOnRejection": true
}Responses
URI of the created index in the form https://$ZONE_HOST/api/onezone/v3/harvesters/{id}/indices/{iid} is returned in the response Location header.
Invalid request.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}