# Using python client to create snapshot fails - create a whole cluster snapshot

**URL:** <https://discuss.elastic.co/t/using-python-client-to-create-snapshot-fails-create-a-whole-cluster-snapshot/157396>\
**Category:** Elasticsearch\
**Created:** [November 19, 2018, 4:19pm UTC](https://discuss.elastic.co/t/using-python-client-to-create-snapshot-fails-create-a-whole-cluster-snapshot/157396 "2018-11-19T16:19:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [November 19, 2018, 4:19pm UTC](https://discuss.elastic.co/t/using-python-client-to-create-snapshot-fails-create-a-whole-cluster-snapshot/157396/1 "2018-11-19T16:19:45Z")

</div>

hi all,  
I'm trying to create the snapshot of a specific index using the python client.

the last executed command is:

`es.snapshot.create(repository=repo,snapshot=snapshotname,wait_for_completion="true",body=settingsSnap)`

where

`settingsSnap`

is:

> settingsSnap\< = {  
> "settings": {  
> "indices": indexarray,  
> "ignore\_unavailable": "true",  
> "include\_global\_state": "true"  
> }  
> }

if I try to print out the value of `settingsSnap`, I face:

> {'settings': {'indices': 'cribiscom\_x\_mydocs\_entries\_201712', 'ignore\_unavailable': 'true', 'include\_global\_state': 'true'}}

so it should be ok. unfortunately, when I try to exec that command, it starts to create the snapshot of the whole cluster with all the existing indices. can anyone help me?

---

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [November 20, 2018, 8:42am UTC](https://discuss.elastic.co/t/using-python-client-to-create-snapshot-fails-create-a-whole-cluster-snapshot/157396/2 "2018-11-20T08:42:29Z")

</div>

my fault. the correct `settings` value must be:

```
settingsSnap = {
        "indices": sindex,
        "ignore_unavailable": "true",
        "include_global_state": "true"
    }
```

---

<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:** [December 18, 2018, 8:42am UTC](https://discuss.elastic.co/t/using-python-client-to-create-snapshot-fails-create-a-whole-cluster-snapshot/157396/3 "2018-12-18T08:42:37Z")

</div>

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