// This file is autogenerated, DO NOT EDIT
// snapshot-restore/apis/create-snapshot-api.asciidoc:166

[source, python]
----
resp = client.snapshot.create(
    repository="my_repository",
    snapshot="snapshot_2",
    wait_for_completion=True,
    indices="index_1,index_2",
    ignore_unavailable=True,
    include_global_state=False,
    metadata={
        "taken_by": "user123",
        "taken_because": "backup before upgrading"
    },
)
print(resp)
----
