# Using wait\_for\_completion with Snapshot deletes

**URL:** <https://discuss.elastic.co/t/using-wait-for-completion-with-snapshot-deletes/176271>\
**Category:** Elasticsearch\
**Created:** [April 10, 2019, 5:11pm UTC](https://discuss.elastic.co/t/using-wait-for-completion-with-snapshot-deletes/176271 "2019-04-10T17:11:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Tompkinson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_tompkinson/32/43878_2.png) [@Chris\_Tompkinson](https://discuss.elastic.co/u/Chris_Tompkinson)\
**Post date:** [April 10, 2019, 5:11pm UTC](https://discuss.elastic.co/t/using-wait-for-completion-with-snapshot-deletes/176271/1 "2019-04-10T17:11:55Z")

</div>

Hi,

I'm using Elasticsearch 6.3

When I use the Snapshots REST API to delete snapshots I have two problems.

Firstly when I run a delete the a snapshot it will sit and wait for the snapshot to be deleted, which can take quite a while and ideally I would like it to return accepted immediately, which feeds into my second problem that when I do wait for this response it will timeout and return an empty response.

e.g.

```
curl -i -X DELETE https://cluster/_snapshot/repository-name/snapshot-name
HTTP/2 504
date: Wed, 10 Apr 2019 16:55:57 GMT
content-type: application/json
cache-control: no-cache
{
  "message": "Request Timeout",
}

```

This would be solved using the wait\_for\_completion URL parameter but that is unrecognised for deletes

```
curl -X DELETE "cluster/_snapshot/repository-name/snapshot-name?wait_for_completion=false" | jq
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "request [/_snapshot/repository-name/snapshot-name] contains unrecognized parameter: [wait_for_completion]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "request [/_snapshot/repository-name/snapshot-name] contains unrecognized parameter: [wait_for_completion]"
  },
  "status": 400
}

```

Whats the best way for me to start the deletion of snapshots, so that I can trigger a delete without waiting for it to finish?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 8, 2019, 5:11pm UTC](https://discuss.elastic.co/t/using-wait-for-completion-with-snapshot-deletes/176271/2 "2019-05-08T17:11:56Z")

</div>

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