Skip to content

Commit

Permalink
Adds to templates API (opensearch-project#1765)
Browse files Browse the repository at this point in the history
* Adds to templates API

Signed-off-by: Fanit Kolchina <[email protected]>

* Added get all templates

Signed-off-by: Fanit Kolchina <[email protected]>

Signed-off-by: Fanit Kolchina <[email protected]>
  • Loading branch information
kolchfa-aws authored Nov 1, 2022
1 parent 756fc58 commit 887ed47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions _opensearch/index-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -105,6 +106,7 @@ To list all index templates:

```json
GET _cat/templates
GET /_index_template
```

To find a template by its name:
Expand Down

0 comments on commit 887ed47

Please sign in to comment.