@@ -7,30 +7,32 @@ Their purpose is to formalize and standardize the API, to facilitate development
7
7
Example for the [ "Create Index"] ( http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/ ) API:
8
8
9
9
``` json
10
- {
11
- "indices.create" : {
12
- "documentation" : " http://elasticsearch.org/guide/reference/mapping/" ,
13
-
14
- "methods" : [" PUT" , " POST" ],
15
-
16
- "url" : {
17
- "path" : " /{index}" ,
18
-
19
- "paths" : [" /{index}" ],
20
-
21
- "parts" : {
22
- "index" : {}
23
- },
24
-
25
- "params" : {
26
- "index" : {},
27
- "timeout" : {}
28
- }
29
- },
30
- "body" : {
10
+ {
11
+ "indices.create" : {
12
+ "documentation" : " http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index/" ,
13
+ "methods" : [" PUT" , " POST" ],
14
+ "url" : {
15
+ "path" : " /{index}" ,
16
+ "paths" : [" /{index}" ],
17
+ "parts" : {
18
+ "index" : {
19
+ "type" : " string" ,
20
+ "required" : true ,
21
+ "description" : " The name of the index"
22
+ }
23
+ },
24
+ "params" : {
25
+ "timeout" : {
26
+ "type" : " time" ,
27
+ "description" : " Explicit operation timeout"
31
28
}
32
29
}
30
+ },
31
+ "body" : {
32
+ "description" : " The configuration for the index (`settings` and `mappings`)"
33
33
}
34
+ }
35
+ }
34
36
```
35
37
36
38
The specification contains:
@@ -39,12 +41,12 @@ The specification contains:
39
41
* Link to the documentation at < http://elasticsearch.org >
40
42
* List of HTTP methods for the endpoint
41
43
* URL specification: path, parts, parameters
42
- * Whether body is allowed for the endpoint or not
44
+ * Whether body is allowed for the endpoint or not and its description
43
45
44
46
The ` methods ` and ` url.paths ` elements list all possible HTTP methods and URLs for the endpoint;
45
47
it is the responsibility of the developer to use this information for a sensible API on the target platform.
46
48
47
- The repository also contains a utility script in Ruby which will scan and parse the Elasticsearch source code
49
+ The repository contains a utility script in Ruby which will scan and parse the Elasticsearch source code
48
50
to extract the information from the Java source files. Run ` bundle install ` and then ` thor help api:generate:spec ` .
49
51
50
52
## License
0 commit comments