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


(Roger) #1

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?


(Roger) #2

my fault. the correct settings value must be:

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