Executing a snapshot
In the previous recipe, we defined a repository. Now you can create snapshots of indices. For every repository, it's possible to define multiple snapshots.
Getting ready
You need a working ElasticSearch cluster and the repository created in the previous recipe.
How to do it...
To manage a snapshot, we will perform the following:
- To create a snapshot called
snap_1
for the indicestest
andtest1
, the HTTP method is PUT and the curl command is:curl -XPUT "localhost:9200/_snapshot/my_backup/snap_1?wait_for_completion=true" -d '{ "indices": " test-index,test-2", "ignore_unavailable": "true", "include_global_state": false }'
The result will be as follows:
{ "snapshot" : { "snapshot" : "snap_1", "indices" : [ "test-index" ], "state" : "SUCCESS", "start_time" : "2014-11-13T21:40:45.406Z", ...