|
|
6 rokov pred | |
|---|---|---|
| .. | ||
| src | ff99bc1d3f Remove per-type indexing stats (#47203) | 6 rokov pred |
| .gitignore | 971e7bc341 Initial commit (blank repository) | 12 rokov pred |
| README.markdown | 9166311622 Update the schema for the REST API specification (#42346) | 6 rokov pred |
| build.gradle | 323f312bbc Replace usages RandomizedTestingTask with built-in Gradle Test (#40978) | 6 rokov pred |
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":{
"url":"http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html"
},
"stability": "stable",
"url":{
"paths":[
{
"path":"/{index}",
"method":"PUT",
"parts":{
"index":{
"type":"string",
"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 specification follows the same backward compatibility guarantees as Elasticsearch.
The specification schema allows to codify API deprecations, either for an entire API, or for specific parts of the API, such as paths or parameters.
{
"api" : {
"deprecated" : {
"version" : "7.0.0",
"description" : "Reason API is being deprecated"
},
}
}
{
"api": {
"url": {
"paths": [
{
"path":"/{index}/{type}/{id}/_create",
"method":"PUT",
"parts":{
"id":{
"type":"string",
"description":"Document ID"
},
"index":{
"type":"string",
"description":"The name of the index"
},
"type":{
"type":"string",
"description":"The type of the document",
"deprecated":true
}
},
"deprecated":{
"version":"7.0.0",
"description":"Specifying types in urls has been deprecated"
}
}
]
}
}
}
{
"api": {
"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").