|
10 years ago | |
---|---|---|
.. | ||
api | 6aec68cd29 Revert "[QUERY] Remove lowercase_expanded_terms and locale options" | 10 years ago |
test | 5788289a6d [TEST] Remove 'gtelte' feature from yaml tests | 10 years ago |
.gitignore | 971e7bc341 Initial commit (blank repository) | 12 years ago |
LICENSE.txt | 4d78026ef1 Updated copyright years to include 2015 | 10 years ago |
README.markdown | f47fb6b1cf fix mention of Apache License, version 2. | 11 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.elasticsearch.org/guide/reference/api/admin-indices-create-index/",
"methods": ["PUT", "POST"],
"url": {
"path": "/{index}",
"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 callsThe 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 repository contains some utilities in the utils
directory:
thor api:generate:spec
will generate the basic JSON specification from Java source codethor api:generate:code
generates Ruby source code and tests from the specs, and can be extended
to generate assets in another programming languageRun bundle install
and then thor list
in the utils folder.
The full command to generate the api spec is:
thor api:spec:generate --output=myfolder --elasticsearch=/path/to/es
This software is licensed under the Apache License, version 2 ("ALv2").