Merge pull request #11928 from szroland/#11897
Create Snapshot: remove _create from POST path to match PUT Closes #11928
This commit is contained in:
commit
4649650ab2
|
@ -40,7 +40,7 @@ public class RestCreateSnapshotAction extends BaseRestHandler {
|
||||||
public RestCreateSnapshotAction(Settings settings, RestController controller, Client client) {
|
public RestCreateSnapshotAction(Settings settings, RestController controller, Client client) {
|
||||||
super(settings, controller, client);
|
super(settings, controller, client);
|
||||||
controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);
|
controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);
|
||||||
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_create", this);
|
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"methods": ["PUT", "POST"],
|
"methods": ["PUT", "POST"],
|
||||||
"url": {
|
"url": {
|
||||||
"path": "/_snapshot/{repository}/{snapshot}",
|
"path": "/_snapshot/{repository}/{snapshot}",
|
||||||
"paths": ["/_snapshot/{repository}/{snapshot}", "/_snapshot/{repository}/{snapshot}/_create"],
|
"paths": ["/_snapshot/{repository}/{snapshot}"],
|
||||||
"parts": {
|
"parts": {
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
@ -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 }
|
Loading…
Reference in New Issue