Skip to content

Commit d4c35c8

Browse files
authored
Add indices.simulate_index_template Request (#380)
1 parent 06e9e23 commit d4c35c8

File tree

6 files changed

+242
-9
lines changed

6 files changed

+242
-9
lines changed

output/schema/schema.json

Lines changed: 150 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5212,10 +5212,17 @@
52125212
"description": "Simulate matching the given index name against the index templates in the system",
52135213
"docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html",
52145214
"name": "indices.simulate_index_template",
5215-
"request": null,
5215+
"request": {
5216+
"name": "IndicesSimulateIndexTemplateRequest",
5217+
"namespace": "indices.simulate_index_template"
5218+
},
52165219
"requestBodyRequired": false,
5217-
"response": null,
5218-
"stability": "stable",
5220+
"response": {
5221+
"name": "IndicesSimulateIndexTemplateResponse",
5222+
"namespace": "indices.simulate_index_template"
5223+
},
5224+
"since": "7.9.0",
5225+
"stability": "TODO",
52195226
"urls": [
52205227
{
52215228
"methods": [
@@ -70432,6 +70439,110 @@
7043270439
}
7043370440
]
7043470441
},
70442+
{
70443+
"attachedBehaviors": [
70444+
"CommonQueryParameters"
70445+
],
70446+
"body": {
70447+
"kind": "properties",
70448+
"properties": [
70449+
{
70450+
"name": "index_patterns",
70451+
"required": false,
70452+
"type": {
70453+
"kind": "array_of",
70454+
"value": {
70455+
"kind": "instance_of",
70456+
"type": {
70457+
"name": "IndexName",
70458+
"namespace": "_types"
70459+
}
70460+
}
70461+
}
70462+
},
70463+
{
70464+
"name": "composed_of",
70465+
"required": false,
70466+
"type": {
70467+
"kind": "array_of",
70468+
"value": {
70469+
"kind": "instance_of",
70470+
"type": {
70471+
"name": "Name",
70472+
"namespace": "_types"
70473+
}
70474+
}
70475+
}
70476+
},
70477+
{
70478+
"description": "Any overlapping templates that would have matched, but have lower priority",
70479+
"name": "overlapping",
70480+
"required": false,
70481+
"type": {
70482+
"kind": "array_of",
70483+
"value": {
70484+
"kind": "instance_of",
70485+
"type": {
70486+
"name": "OverlappingIndexTemplate",
70487+
"namespace": "indices.simulate_index_template"
70488+
}
70489+
}
70490+
}
70491+
},
70492+
{
70493+
"name": "template",
70494+
"required": false,
70495+
"type": {
70496+
"kind": "instance_of",
70497+
"type": {
70498+
"name": "TemplateMapping",
70499+
"namespace": "indices._types"
70500+
}
70501+
}
70502+
}
70503+
]
70504+
},
70505+
"inherits": {
70506+
"type": {
70507+
"name": "RequestBase",
70508+
"namespace": "_types"
70509+
}
70510+
},
70511+
"kind": "request",
70512+
"name": {
70513+
"name": "IndicesSimulateIndexTemplateRequest",
70514+
"namespace": "indices.simulate_index_template"
70515+
},
70516+
"path": [
70517+
{
70518+
"description": "The name of the index (it must be a concrete index name)",
70519+
"name": "name",
70520+
"required": false,
70521+
"type": {
70522+
"kind": "instance_of",
70523+
"type": {
70524+
"name": "Name",
70525+
"namespace": "_types"
70526+
}
70527+
}
70528+
}
70529+
],
70530+
"query": []
70531+
},
70532+
{
70533+
"inherits": {
70534+
"type": {
70535+
"name": "AcknowledgedResponseBase",
70536+
"namespace": "_types"
70537+
}
70538+
},
70539+
"kind": "interface",
70540+
"name": {
70541+
"name": "IndicesSimulateIndexTemplateResponse",
70542+
"namespace": "indices.simulate_index_template"
70543+
},
70544+
"properties": []
70545+
},
7043570546
{
7043670547
"attachedBehaviors": [
7043770548
"CommonQueryParameters"
@@ -92728,6 +92839,40 @@
9272892839
}
9272992840
]
9273092841
},
92842+
{
92843+
"kind": "interface",
92844+
"name": {
92845+
"name": "OverlappingIndexTemplate",
92846+
"namespace": "indices.simulate_index_template"
92847+
},
92848+
"properties": [
92849+
{
92850+
"name": "name",
92851+
"required": true,
92852+
"type": {
92853+
"kind": "instance_of",
92854+
"type": {
92855+
"name": "Name",
92856+
"namespace": "_types"
92857+
}
92858+
}
92859+
},
92860+
{
92861+
"name": "index_patterns",
92862+
"required": false,
92863+
"type": {
92864+
"kind": "array_of",
92865+
"value": {
92866+
"kind": "instance_of",
92867+
"type": {
92868+
"name": "IndexName",
92869+
"namespace": "_types"
92870+
}
92871+
}
92872+
}
92873+
}
92874+
]
92875+
},
9273192876
{
9273292877
"kind": "interface",
9273392878
"name": {
@@ -124592,8 +124737,8 @@
124592124737
"value": {
124593124738
"kind": "instance_of",
124594124739
"type": {
124595-
"name": "string",
124596-
"namespace": "internal"
124740+
"name": "Name",
124741+
"namespace": "_types"
124597124742
}
124598124743
}
124599124744
}

output/schema/validation-errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@
470470
},
471471
"indices.simulate_index_template": {
472472
"request": [
473-
"Missing request & response"
473+
"Endpoint has \"@stability: TODO"
474474
],
475475
"response": []
476476
},

output/typescript/types.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7025,6 +7025,19 @@ export interface IndicesShrinkIndicesShrinkResponse extends AcknowledgedResponse
70257025
index: IndexName
70267026
}
70277027

7028+
export interface IndicesSimulateIndexTemplateIndicesSimulateIndexTemplateRequest extends RequestBase {
7029+
name?: Name
7030+
body?: {
7031+
index_patterns?: IndexName[]
7032+
composed_of?: Name[]
7033+
overlapping?: IndicesSimulateIndexTemplateOverlappingIndexTemplate[]
7034+
template?: IndicesTemplateMapping
7035+
}
7036+
}
7037+
7038+
export interface IndicesSimulateIndexTemplateIndicesSimulateIndexTemplateResponse extends AcknowledgedResponseBase {
7039+
}
7040+
70287041
export interface IndicesSplitIndicesSplitRequest extends RequestBase {
70297042
index: IndexName
70307043
target: IndexName
@@ -9593,6 +9606,11 @@ export interface MlOverallBucketJobInfo {
95939606
max_anomaly_score: double
95949607
}
95959608

9609+
export interface IndicesSimulateIndexTemplateOverlappingIndexTemplate {
9610+
name: Name
9611+
index_patterns?: IndexName[]
9612+
}
9613+
95969614
export interface MlPage {
95979615
from: integer
95989616
size: integer
@@ -13179,7 +13197,7 @@ export interface TaskListTasksTaskStatus {
1317913197

1318013198
export interface IndicesTemplateMapping {
1318113199
aliases: Record<IndexName, IndicesAlias>
13182-
index_patterns: string[]
13200+
index_patterns: Name[]
1318313201
mappings: MappingTypeMapping
1318413202
order: integer
1318513203
settings: Record<string, any>

specification/indices/_types/TemplateMapping.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
import { Dictionary } from '@spec_utils/Dictionary'
2121
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
22-
import { IndexName, VersionNumber } from '@_types/common'
22+
import { IndexName, Name, VersionNumber } from '@_types/common'
2323
import { TypeMapping } from '@_types/mapping/TypeMapping'
2424
import { integer } from '@_types/Numeric'
2525
import { Alias } from './Alias'
2626

2727
export class TemplateMapping {
2828
aliases: Dictionary<IndexName, Alias>
29-
index_patterns: string[]
29+
index_patterns: Name[]
3030
mappings: TypeMapping
3131
order: integer
3232
settings: Dictionary<string, UserDefinedValue>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { TemplateMapping } from '@indices/_types/TemplateMapping'
21+
import { RequestBase } from '@_types/Base'
22+
import { IndexName, Name, WaitForActiveShards } from '@_types/common'
23+
24+
/**
25+
* @rest_spec_name indices.simulate_index_template
26+
* @since 7.9.0
27+
* @stability TODO
28+
*/
29+
export interface IndicesSimulateIndexTemplateRequest extends RequestBase {
30+
path_parts?: {
31+
/** Index or template name to simulate */
32+
name?: Name
33+
}
34+
body?: {
35+
index_patterns?: IndexName[]
36+
composed_of?: Name[]
37+
/** Any overlapping templates that would have matched, but have lower priority */
38+
overlapping?: OverlappingIndexTemplate[]
39+
template?: TemplateMapping
40+
}
41+
}
42+
43+
export class OverlappingIndexTemplate {
44+
name: Name
45+
index_patterns?: IndexName[]
46+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { AcknowledgedResponseBase } from '@_types/Base'
21+
22+
// TODO must be changed to HttpStatusCodeResponse once
23+
// https://github.com/elastic/elastic-client-generator/pull/373 is merged.
24+
export class IndicesSimulateIndexTemplateResponse extends AcknowledgedResponseBase {}

0 commit comments

Comments
 (0)