// This file is autogenerated, DO NOT EDIT
// indices/put-component-template.asciidoc:196

[source, python]
----
resp = client.cluster.put_component_template(
    name="template_1",
    template={
        "settings": {
            "number_of_shards": 1
        },
        "aliases": {
            "alias1": {},
            "alias2": {
                "filter": {
                    "term": {
                        "user.id": "kimchy"
                    }
                },
                "routing": "shard-1"
            },
            "{index}-alias": {}
        }
    },
)
print(resp)
----
