Skip to content

Add indices.simulate_index_template Request #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 150 additions & 5 deletions output/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5212,10 +5212,17 @@
"description": "Simulate matching the given index name against the index templates in the system",
"docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html",
"name": "indices.simulate_index_template",
"request": null,
"request": {
"name": "IndicesSimulateIndexTemplateRequest",
"namespace": "indices.simulate_index_template"
},
"requestBodyRequired": false,
"response": null,
"stability": "stable",
"response": {
"name": "IndicesSimulateIndexTemplateResponse",
"namespace": "indices.simulate_index_template"
},
"since": "7.9.0",
"stability": "TODO",
"urls": [
{
"methods": [
Expand Down Expand Up @@ -70432,6 +70439,110 @@
}
]
},
{
"attachedBehaviors": [
"CommonQueryParameters"
],
"body": {
"kind": "properties",
"properties": [
{
"name": "index_patterns",
"required": false,
"type": {
"kind": "array_of",
"value": {
"kind": "instance_of",
"type": {
"name": "IndexName",
"namespace": "_types"
}
}
}
},
{
"name": "composed_of",
"required": false,
"type": {
"kind": "array_of",
"value": {
"kind": "instance_of",
"type": {
"name": "Name",
"namespace": "_types"
}
}
}
},
{
"description": "Any overlapping templates that would have matched, but have lower priority",
"name": "overlapping",
"required": false,
"type": {
"kind": "array_of",
"value": {
"kind": "instance_of",
"type": {
"name": "OverlappingIndexTemplate",
"namespace": "indices.simulate_index_template"
}
}
}
},
{
"name": "template",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "TemplateMapping",
"namespace": "indices._types"
}
}
}
]
},
"inherits": {
"type": {
"name": "RequestBase",
"namespace": "_types"
}
},
"kind": "request",
"name": {
"name": "IndicesSimulateIndexTemplateRequest",
"namespace": "indices.simulate_index_template"
},
"path": [
{
"description": "The name of the index (it must be a concrete index name)",
"name": "name",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "Name",
"namespace": "_types"
}
}
}
],
"query": []
},
{
"inherits": {
"type": {
"name": "AcknowledgedResponseBase",
"namespace": "_types"
}
},
"kind": "interface",
"name": {
"name": "IndicesSimulateIndexTemplateResponse",
"namespace": "indices.simulate_index_template"
},
"properties": []
},
{
"attachedBehaviors": [
"CommonQueryParameters"
Expand Down Expand Up @@ -92728,6 +92839,40 @@
}
]
},
{
"kind": "interface",
"name": {
"name": "OverlappingIndexTemplate",
"namespace": "indices.simulate_index_template"
},
"properties": [
{
"name": "name",
"required": true,
"type": {
"kind": "instance_of",
"type": {
"name": "Name",
"namespace": "_types"
}
}
},
{
"name": "index_patterns",
"required": false,
"type": {
"kind": "array_of",
"value": {
"kind": "instance_of",
"type": {
"name": "IndexName",
"namespace": "_types"
}
}
}
}
]
},
{
"kind": "interface",
"name": {
Expand Down Expand Up @@ -124592,8 +124737,8 @@
"value": {
"kind": "instance_of",
"type": {
"name": "string",
"namespace": "internal"
"name": "Name",
"namespace": "_types"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion output/schema/validation-errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
},
"indices.simulate_index_template": {
"request": [
"Missing request & response"
"Endpoint has \"@stability: TODO"
],
"response": []
},
Expand Down
20 changes: 19 additions & 1 deletion output/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7025,6 +7025,19 @@ export interface IndicesShrinkIndicesShrinkResponse extends AcknowledgedResponse
index: IndexName
}

export interface IndicesSimulateIndexTemplateIndicesSimulateIndexTemplateRequest extends RequestBase {
name?: Name
body?: {
index_patterns?: IndexName[]
composed_of?: Name[]
overlapping?: IndicesSimulateIndexTemplateOverlappingIndexTemplate[]
template?: IndicesTemplateMapping
}
}

export interface IndicesSimulateIndexTemplateIndicesSimulateIndexTemplateResponse extends AcknowledgedResponseBase {
}

export interface IndicesSplitIndicesSplitRequest extends RequestBase {
index: IndexName
target: IndexName
Expand Down Expand Up @@ -9593,6 +9606,11 @@ export interface MlOverallBucketJobInfo {
max_anomaly_score: double
}

export interface IndicesSimulateIndexTemplateOverlappingIndexTemplate {
name: Name
index_patterns?: IndexName[]
}

export interface MlPage {
from: integer
size: integer
Expand Down Expand Up @@ -13179,7 +13197,7 @@ export interface TaskListTasksTaskStatus {

export interface IndicesTemplateMapping {
aliases: Record<IndexName, IndicesAlias>
index_patterns: string[]
index_patterns: Name[]
mappings: MappingTypeMapping
order: integer
settings: Record<string, any>
Expand Down
4 changes: 2 additions & 2 deletions specification/indices/_types/TemplateMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

import { Dictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import { IndexName, VersionNumber } from '@_types/common'
import { IndexName, Name, VersionNumber } from '@_types/common'
import { TypeMapping } from '@_types/mapping/TypeMapping'
import { integer } from '@_types/Numeric'
import { Alias } from './Alias'

export class TemplateMapping {
aliases: Dictionary<IndexName, Alias>
index_patterns: string[]
index_patterns: Name[]
mappings: TypeMapping
order: integer
settings: Dictionary<string, UserDefinedValue>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { TemplateMapping } from '@indices/_types/TemplateMapping'
import { RequestBase } from '@_types/Base'
import { IndexName, Name, WaitForActiveShards } from '@_types/common'

/**
* @rest_spec_name indices.simulate_index_template
* @since 7.9.0
* @stability TODO
*/
export interface IndicesSimulateIndexTemplateRequest extends RequestBase {
path_parts?: {
/** Index or template name to simulate */
name?: Name
}
body?: {
index_patterns?: IndexName[]
composed_of?: Name[]
/** Any overlapping templates that would have matched, but have lower priority */
overlapping?: OverlappingIndexTemplate[]
template?: TemplateMapping
}
}

export class OverlappingIndexTemplate {
name: Name
index_patterns?: IndexName[]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { AcknowledgedResponseBase } from '@_types/Base'

// TODO must be changed to HttpStatusCodeResponse once
// https://github.com/elastic/elastic-client-generator/pull/373 is merged.
export class IndicesSimulateIndexTemplateResponse extends AcknowledgedResponseBase {}