# PutComposableIndexTemplateRequest in Custom Plugin

**URL:** <https://discuss.elastic.co/t/putcomposableindextemplaterequest-in-custom-plugin/337625>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 5, 2023, 7:12am UTC](https://discuss.elastic.co/t/putcomposableindextemplaterequest-in-custom-plugin/337625 "2023-07-05T07:12:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_murat](https://avatars.discourse-cdn.com/v4/letter/_/e274bd/32.png) [@\_murat](https://discuss.elastic.co/u/_murat)\
**Post date:** [July 5, 2023, 7:12am UTC](https://discuss.elastic.co/t/putcomposableindextemplaterequest-in-custom-plugin/337625/1 "2023-07-05T07:12:14Z")

</div>

Hello! I have been working on a custom Elasticsearch plugin that should create an index template and its components when an Elasticsearch instance loads this plugin.

The only client that I can access is `NodeClient` and there is no way to create `PutComposableIndexTemplateRequest` as it is not available in the below dependency. (Maven)

```auto
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>7.17.6</version>
            <scope>provided</scope>
        </dependency>

```

I can create an index template with `client.admin().indices().putTemplate(...);` method but there is no way to use the `ComposableIndexTemplate` class with this client. If I need to add a dependency like `RestHighLevelClient`, then I must set the host and port parameters to connect the cluster with this client even though this plugin is already running in an Elasticsearch cluster. It seems weird for the custom plugins, from my point of view.

Should I add this high-level client as a dependency and define host/port parameters? Or is there another way to add components to the ES instance?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 2, 2023, 7:12am UTC](https://discuss.elastic.co/t/putcomposableindextemplaterequest-in-custom-plugin/337625/2 "2023-08-02T07:12:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
