Skip to content

Commit aa9cedc

Browse files
Add a REST spec for the create API (#20924)
The create request now requires that an ID be present. Currently the clients hard code a create method, but we should just add a create REST spec so this method can be autogenerated.
1 parent fe0c99e commit aa9cedc

File tree

1 file changed

+75
-0
lines changed
  • rest-api-spec/src/main/resources/rest-api-spec/api

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"create": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html",
4+
"methods": ["PUT"],
5+
"url": {
6+
"path": "/{index}/{type}/{id}/_create",
7+
"paths": ["/{index}/{type}/{id}/_create"],
8+
"parts": {
9+
"id": {
10+
"type" : "string",
11+
"required" : true,
12+
"description" : "Document ID"
13+
},
14+
"index": {
15+
"type" : "string",
16+
"required" : true,
17+
"description" : "The name of the index"
18+
},
19+
"type": {
20+
"type" : "string",
21+
"required" : true,
22+
"description" : "The type of the document"
23+
}
24+
},
25+
"params": {
26+
"wait_for_active_shards": {
27+
"type" : "string",
28+
"description" : "Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"
29+
},
30+
"parent": {
31+
"type" : "string",
32+
"description" : "ID of the parent document"
33+
},
34+
"refresh": {
35+
"type" : "enum",
36+
"options": ["true", "false", "wait_for"],
37+
"description" : "If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."
38+
},
39+
"routing": {
40+
"type" : "string",
41+
"description" : "Specific routing value"
42+
},
43+
"timeout": {
44+
"type" : "time",
45+
"description" : "Explicit operation timeout"
46+
},
47+
"timestamp": {
48+
"type" : "time",
49+
"description" : "Explicit timestamp for the document"
50+
},
51+
"ttl": {
52+
"type" : "time",
53+
"description" : "Expiration time for the document"
54+
},
55+
"version" : {
56+
"type" : "number",
57+
"description" : "Explicit version number for concurrency control"
58+
},
59+
"version_type": {
60+
"type" : "enum",
61+
"options" : ["internal", "external", "external_gte", "force"],
62+
"description" : "Specific version type"
63+
},
64+
"pipeline" : {
65+
"type" : "string",
66+
"description" : "The pipeline id to preprocess incoming documents with"
67+
}
68+
}
69+
},
70+
"body": {
71+
"description" : "The document",
72+
"required" : true
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)