Adds to templates API (#1765)

* Adds to templates API

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Added get all templates

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
This commit is contained in:
kolchfa-aws 2022-11-01 09:11:44 -04:00 committed by GitHub
parent 756fc5829e
commit 887ed470d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -10,10 +10,11 @@ Index templates let you initialize new indexes with predefined mappings and sett
### Create a template
To create an index template, use a POST request:
To create an index template, use a PUT or POST request:
```json
POST _index_template
PUT _index_template/<template name>
POST _index_template/<template name>
```
This command creates a template named `daily_logs` and applies it to any new index whose name matches the pattern `logs-2020-01-*` and also adds it to the `my_logs` alias:
@ -105,6 +106,7 @@ To list all index templates:
```json
GET _cat/templates
GET /_index_template
```
To find a template by its name: