Merge pull request #11928 from szroland/#11897

Create Snapshot: remove _create from POST path to match PUT

Closes #11928
This commit is contained in:
Boaz Leskes 2015-06-30 12:16:22 +02:00
commit 4649650ab2
3 changed files with 38 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public class RestCreateSnapshotAction extends BaseRestHandler {
public RestCreateSnapshotAction(Settings settings, RestController controller, Client client) {
super(settings, controller, client);
controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_create", this);
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}", this);
}
@Override

View File

@ -4,7 +4,7 @@
"methods": ["PUT", "POST"],
"url": {
"path": "/_snapshot/{repository}/{snapshot}",
"paths": ["/_snapshot/{repository}/{snapshot}", "/_snapshot/{repository}/{snapshot}/_create"],
"paths": ["/_snapshot/{repository}/{snapshot}"],
"parts": {
"repository": {
"type": "string",

View File

@ -0,0 +1,36 @@
---
setup:
- do:
snapshot.create_repository:
repository: test_repo1
body:
type: fs
settings:
location: "test_repo1"
- do:
indices.create:
index: test_index
body:
settings:
number_of_shards: 1
number_of_replicas: 1
- do:
cluster.health:
wait_for_status: yellow
---
"Create a snapshot":
- do:
snapshot.create:
repository: test_repo1
snapshot: test_snapshot
wait_for_completion: true
- match: { snapshot.snapshot: test_snapshot }
- match: { snapshot.state : SUCCESS }
- match: { snapshot.shards.successful: 1 }
- match: { snapshot.shards.failed : 0 }