// This file is autogenerated, DO NOT EDIT
// cluster/reroute.asciidoc:200

[source, python]
----
resp = client.cluster.reroute(
    commands=[
        {
            "move": {
                "index": "test",
                "shard": 0,
                "from_node": "node1",
                "to_node": "node2"
            }
        },
        {
            "allocate_replica": {
                "index": "test",
                "shard": 1,
                "node": "node3"
            }
        }
    ],
)
print(resp)
----
