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

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

const response1 = await client.cluster.putComponentTemplate({
  name: "ct2",
  template: {
    settings: {
      "index.number_of_replicas": 0,
    },
    mappings: {
      properties: {
        "@timestamp": {
          type: "date",
        },
      },
    },
  },
});
console.log(response1);

const response2 = await client.indices.putIndexTemplate({
  name: "final-template",
  index_patterns: ["my-index-*"],
  composed_of: ["ct1", "ct2"],
  priority: 5,
});
console.log(response2);

const response3 = await client.indices.simulateIndexTemplate({
  name: "my-index-000001",
  index_template: null,
});
console.log(response3);
----
