// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.cluster.putComponentTemplate({
  name: "template_with_2_shards",
  template: {
    settings: {
      "index.number_of_shards": 2,
    },
  },
});
console.log(response);

const response1 = await client.cluster.putComponentTemplate({
  name: "template_with_3_shards",
  template: {
    settings: {
      "index.number_of_shards": 3,
    },
  },
});
console.log(response1);

const response2 = await client.indices.putIndexTemplate({
  name: "template_1",
  index_patterns: ["t*"],
  composed_of: ["template_with_2_shards", "template_with_3_shards"],
});
console.log(response2);
----
