How to create index template or pipeline in an es plugin

Hi, is there any example to create index template or pipeline in an es plugin?

you can create a class in Plugin.createComponents, that uses the Client handed over in the arguments to create an index template or an pipeline.

Note that you may need to deal with retries (or implement this class as a cluster state listener) to make sure you only add those, when they are not added yet and when your node is part of a cluster.

Many Thanks, I will have a try.