mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 14:05:27 +00:00
[DOC] Improved the example in README and small edits
This commit is contained in:
parent
57be0827e9
commit
4de673d3b0
@ -9,25 +9,27 @@ Example for the ["Create Index"](http://www.elasticsearch.org/guide/reference/ap
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"indices.create": {
|
"indices.create": {
|
||||||
"documentation": "http://elasticsearch.org/guide/reference/mapping/",
|
"documentation": "http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/",
|
||||||
|
|
||||||
"methods": ["PUT", "POST"],
|
"methods": ["PUT", "POST"],
|
||||||
|
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/{index}",
|
"path": "/{index}",
|
||||||
|
|
||||||
"paths": ["/{index}"],
|
"paths": ["/{index}"],
|
||||||
|
|
||||||
"parts": {
|
"parts": {
|
||||||
"index": {}
|
"index": {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true,
|
||||||
|
"description" : "The name of the index"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"params": {
|
"params": {
|
||||||
"index": {},
|
"timeout": {
|
||||||
"timeout": {}
|
"type" : "time",
|
||||||
|
"description" : "Explicit operation timeout"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"body": {
|
"body": {
|
||||||
|
"description" : "The configuration for the index (`settings` and `mappings`)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,12 +41,12 @@ The specification contains:
|
|||||||
* Link to the documentation at <http://elasticsearch.org>
|
* Link to the documentation at <http://elasticsearch.org>
|
||||||
* List of HTTP methods for the endpoint
|
* List of HTTP methods for the endpoint
|
||||||
* URL specification: path, parts, parameters
|
* URL specification: path, parts, parameters
|
||||||
* Whether body is allowed for the endpoint or not
|
* Whether body is allowed for the endpoint or not and its description
|
||||||
|
|
||||||
The `methods` and `url.paths` elements list all possible HTTP methods and URLs for the endpoint;
|
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.
|
it is the responsibility of the developer to use this information for a sensible API on the target platform.
|
||||||
|
|
||||||
The repository also contains a utility script in Ruby which will scan and parse the Elasticsearch source code
|
The repository contains a utility script in Ruby which will scan and parse the Elasticsearch source code
|
||||||
to extract the information from the Java source files. Run `bundle install` and then `thor help api:generate:spec`.
|
to extract the information from the Java source files. Run `bundle install` and then `thor help api:generate:spec`.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
Loading…
x
Reference in New Issue
Block a user