|
9 years ago | |
---|---|---|
.. | ||
src | 6d3c9b074c Remove support for the `multi_field` type. | 9 years ago |
.gitignore | 971e7bc341 Initial commit (blank repository) | 12 years ago |
README.markdown | 9c0f655674 [API] changed all the links in json specs to the new site | 10 years ago |
build.gradle | c86100f636 Switch build system to Gradle | 10 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",
"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").