Delete and restore snapshot on AWS s3

Hi,

I'd like to understand how delete and restore functions work. I thought if you delete a snapshot from S3, you will not be able to restore it later, but I'm having some weird behaviour. For example, if I code the following lines from terminal:

// curl -XDELETE localhost:9200/_snapshot/repository-s3/snap1
// curl -XGET 'localhost:9200/_snapshot/repository-s3/_all?pretty=true'
// curl -XPOST localhost:9200/_snapshot/repository-s3/snap1
// curl -XGET 'localhost:9200/_snapshot/repository-s3/_all?pretty=true'

After deleting snap1, it doesnt shows when I made the GET call and it doesn't appear either on AWS s3, but after restoring snap1, it shows again on terminal and on AWS s3 too.

I thought the restore call only worked to restore specified snapshot to the cluster, but not in AWS s3 repository.

Does it make any sense?

Any help appreciated.

You seem to be describing this step as "restore", but it isn't. I think this is making a new snapshot called snap1. A restore looks like this:

POST /_snapshot/my_backup/snapshot_1/_restore

Note the /_restore on the end.

Thanks David for the provided explanation. I thought "PUT" and "POST" make the different between creating a new snapshot and restoring it, but I was wrong, It works exactly like you said, I have already checked it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.