Skip to content

Commit e2d76aa

Browse files
committed
remove _create from POST to match PUT path
1 parent c9f21a7 commit e2d76aa

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

core/src/main/java/org/elasticsearch/rest/action/admin/cluster/snapshots/create/RestCreateSnapshotAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class RestCreateSnapshotAction extends BaseRestHandler {
4040
public RestCreateSnapshotAction(Settings settings, RestController controller, Client client) {
4141
super(settings, controller, client);
4242
controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);
43-
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_create", this);
43+
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}", this);
4444
}
4545

4646
@Override

rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"methods": ["PUT", "POST"],
55
"url": {
66
"path": "/_snapshot/{repository}/{snapshot}",
7-
"paths": ["/_snapshot/{repository}/{snapshot}", "/_snapshot/{repository}/{snapshot}/_create"],
7+
"paths": ["/_snapshot/{repository}/{snapshot}"],
88
"parts": {
99
"repository": {
1010
"type": "string",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
setup:
3+
4+
- do:
5+
snapshot.create_repository:
6+
repository: test_repo1
7+
body:
8+
type: fs
9+
settings:
10+
location: "test_repo1"
11+
12+
- do:
13+
indices.create:
14+
index: test_index
15+
body:
16+
settings:
17+
number_of_shards: 1
18+
number_of_replicas: 1
19+
20+
- do:
21+
cluster.health:
22+
wait_for_status: yellow
23+
24+
---
25+
"Create a snapshot":
26+
27+
- do:
28+
snapshot.create:
29+
repository: test_repo1
30+
snapshot: test_snapshot
31+
wait_for_completion: true
32+
33+
- match: { snapshot.snapshot: test_snapshot }
34+
- match: { snapshot.state : SUCCESS }
35+
- match: { snapshot.shards.successful: 1 }
36+
- match: { snapshot.shards.failed : 0 }

0 commit comments

Comments
 (0)