Skip to content

Instantly share code, notes, and snippets.

@yodlegists
Last active June 18, 2016 02:24
Show Gist options
  • Select an option

  • Save yodlegists/9823e6418cee1cc1f2b5440b3040d510 to your computer and use it in GitHub Desktop.

Select an option

Save yodlegists/9823e6418cee1cc1f2b5440b3040d510 to your computer and use it in GitHub Desktop.
running restore process
def recover_snapshot(client, snapshot):
payload = {
"ignore_unavailable": True,
"rename_pattern": "(.+)",
"rename_replacement": "prod_$1",
"include_aliases": False,
"index_settings": {
"index.number_of_replicas": 1
}
}
# This will hang until the restore process is complete
params = {'request_timeout': 86400}
return client.snapshot.restore(REPOSITORY, snapshot, payload, wait_for_completion=True, master_timeout="1d", params=params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment