|
6 years ago | |
---|---|---|
.. | ||
src | 17c73631c1 Update rare_term version skips, fix SetBackedScalingCuckooFilter javadoc | 6 years ago |
.gitignore | 971e7bc341 Initial commit (blank repository) | 12 years ago |
README.markdown | 61c34bbd92 Introduce stability description to the REST API specification (#38413) | 6 years ago |
build.gradle | 323f312bbc Replace usages RandomizedTestingTask with built-in Gradle Test (#40978) | 6 years ago |
This repository contains a collection of JSON files which describe the Elasticsearch HTTP API.
Their purpose is to formalize and standardize the API, to facilitate development of libraries and integrations.
Example for the "Create Index" API:
{
"indices.create": {
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html",
"stability": "stable",
"methods": ["PUT", "POST"],
"url": {
"paths": ["/{index}"],
"parts": {
"index": {
"type" : "string",
"required" : true,
"description" : "The name of the index"
}
},
"params": {
"timeout": {
"type" : "time",
"description" : "Explicit operation timeout"
}
}
},
"body": {
"description" : "The configuration for the index (`settings` and `mappings`)"
}
}
}
The specification contains:
indices.create
), which usually corresponds to the client callsstability
indicating the state of the API, has to be declared explicitly or YAML tests will fail
experimental
highly likely to break in the near future (minor/path), no bwc guarantees.
Possibly removed in the future.beta
less likely to break or be removed but still reserve the right to do sostable
No backwards breaking changes in a minorNOTE If an API is stable but it response should be treated as an arbitrary map of key values please notate this as followed
{
"api.name": {
"stability" : "stable",
"response": {
"treat_json_as_key_value" : true
}
}
}
The methods
and url.paths
elements list all possible HTTP methods and URLs for the endpoint;
it is the responsibility of the developer to use this information for a sensible API on the target platform.
The specification follows the same backward compatibility guarantees as Elasticsearch.
The spec allows for deprecations of:
{
"api" : {
"documentation": "...",
"deprecated" : {
"version" : "7.0.0",
"description" : "Reason API is being deprecated"
},
}
}
{
"api": {
"documentation": "",
"url": {
"paths": ["/_monitoring/bulk"],
"deprecated_paths" : [
{
"version" : "7.0.0",
"path" : "/_monitoring/{type}/bulk",
"description" : "Specifying types in urls has been deprecated"
}
]
}
}
}
Here paths
describes the preferred paths and deprecated_paths
indicates paths
that will still work but are now
deprecated.
{
"api": {
"documentation": "",
"methods": ["GET"],
"url": {
"params": {
"stored_fields": {
"type": "list",
"description" : "",
"deprecated" : {
"version" : "7.0.0",
"description" : "Reason parameter is being deprecated"
}
}
}
}
}
}
This software is licensed under the Apache License, version 2 ("ALv2").