# File templates functional, but unable to retrieve via API

**URL:** https://discuss.elastic.co/t/file-templates-functional-but-unable-to-retrieve-via-api/9629
**Category:** Elasticsearch
**Created:** [November 8, 2012, 2:04pm UTC](https://discuss.elastic.co/t/file-templates-functional-but-unable-to-retrieve-via-api/9629 "2012-11-08T14:04:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Maher\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_maher_3/32/2014_2.png) [@Daniel\_Maher\_3](https://discuss.elastic.co/u/Daniel_Maher_3)
#### Post date: [November 8, 2012, 2:04pm UTC](https://discuss.elastic.co/t/file-templates-functional-but-unable-to-retrieve-via-api/9629/1 "2012-11-08T14:04:38Z")

</div>

Hello all,

I have deployed a number of file templates (config/template/\*.json)  
which are functional - as evidenced by the fact that newly created  
indices inherit their settings as expected - but for some reason I  
cannot retrieve any information about them via the API.

Excerpt from \_cluster/state :  
"metadata" : {  
"templates" : { },

And when attempting to GET one directly :  
$ curl -XGET "localhost:9200/\_template/compress"  
{}%

For reference :  
$ curl -s -XGET "localhost:9200/" | grep number  
"number" : "0.19.11",

Again, the templates _work_ - I just don't see them via the API. Is  
there some magic that is required here, or is this a potential bug (or  
am I just doing something wrong) ? 🙂

Thank you.

--  
dan (phrawzty).  
mozilla webops; european outpost.

--

---

<div class="post-metadata">

### Author: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [November 8, 2012, 4:15pm UTC](https://discuss.elastic.co/t/file-templates-functional-but-unable-to-retrieve-via-api/9629/2 "2012-11-08T16:15:24Z")

</div>

Hi Daniel,

The get index template api only returns index templates that are added  
via the put index template api.  
If you want to view an index template, you need the add an index  
template via the api.

Martijn

On 8 November 2012 15:04, Daniel Maher [dmaher@mozilla.com](mailto:dmaher@mozilla.com) wrote:

> Hello all,
> 
> I have deployed a number of file templates (config/template/\*.json) which  
> are functional - as evidenced by the fact that newly created indices inherit  
> their settings as expected - but for some reason I cannot retrieve any  
> information about them via the API.
> 
> Excerpt from \_cluster/state :  
> "metadata" : {  
> "templates" : { },
> 
> And when attempting to GET one directly :  
> $ curl -XGET "localhost:9200/\_template/compress"  
> {}%
> 
> For reference :  
> $ curl -s -XGET "localhost:9200/" | grep number  
> "number" : "0.19.11",
> 
> Again, the templates _work_ - I just don't see them via the API. Is there  
> some magic that is required here, or is this a potential bug (or am I just  
> doing something wrong) ? 🙂
> 
> Thank you.
> 
> --  
> dan (phrawzty).  
> mozilla webops; european outpost.
> 
> --

--  
Met vriendelijke groet,

Martijn van Groningen

--

---

<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: [July 6, 2017, 3:05am UTC](https://discuss.elastic.co/t/file-templates-functional-but-unable-to-retrieve-via-api/9629/3 "2017-07-06T03:05:19Z")

</div>


