diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 619db3f0ee..d11a8eb980 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -17565,6 +17565,161 @@ "x-state": "Added in 1.3.0" } }, + "/_migration/reindex/{index}/_cancel": { + "post": { + "tags": [ + "cancel_reindex" + ], + "summary": "This API cancels a migration reindex attempt for a data stream or index", + "operationId": "migrate-cancel-reindex", + "parameters": [ + { + "in": "path", + "name": "index", + "description": "The index or data stream name", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Indices" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + } + } + } + } + }, + "x-state": "Technical preview" + } + }, + "/_create_from/{source}/{dest}": { + "put": { + "tags": [ + "create_from" + ], + "summary": "This API creates a destination from a source index", + "description": "It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values.", + "operationId": "migrate-create-from", + "parameters": [ + { + "$ref": "#/components/parameters/migrate.create_from#source" + }, + { + "$ref": "#/components/parameters/migrate.create_from#dest" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/migrate.create_from" + }, + "responses": { + "200": { + "$ref": "#/components/responses/migrate.create_from#200" + } + }, + "x-state": "Technical preview" + }, + "post": { + "tags": [ + "create_from" + ], + "summary": "This API creates a destination from a source index", + "description": "It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values.", + "operationId": "migrate-create-from-1", + "parameters": [ + { + "$ref": "#/components/parameters/migrate.create_from#source" + }, + { + "$ref": "#/components/parameters/migrate.create_from#dest" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/migrate.create_from" + }, + "responses": { + "200": { + "$ref": "#/components/responses/migrate.create_from#200" + } + }, + "x-state": "Technical preview" + } + }, + "/_migration/reindex/{index}/_status": { + "get": { + "tags": [ + "get_reindex_status" + ], + "summary": "This API returns the status of a migration reindex attempt for a data stream or index", + "operationId": "migrate-get-reindex-status", + "parameters": [ + { + "in": "path", + "name": "index", + "description": "The index or data stream name", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Indices" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + } + } + } + } + }, + "x-state": "Technical preview" + } + }, + "/_migration/reindex": { + "post": { + "tags": [ + "reindex" + ], + "summary": "\"This API reindexes all legacy backing indices for a data stream", + "description": "It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task", + "operationId": "migrate-reindex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/migrate._types:MigrateReindex" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + } + } + } + } + }, + "x-state": "Technical preview" + } + }, "/_migration/deprecations": { "get": { "tags": [ @@ -75382,6 +75537,44 @@ "_index" ] }, + "migrate._types:CreateFrom": { + "type": "object", + "properties": { + "mappings_override": { + "$ref": "#/components/schemas/_types.mapping:TypeMapping" + }, + "settings_override": { + "$ref": "#/components/schemas/indices._types:IndexSettings" + } + } + }, + "migrate._types:MigrateReindex": { + "type": "object", + "properties": { + "mode": { + "description": "Reindex mode. Currently only 'upgrade' is supported.", + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/migrate._types:Index" + } + }, + "required": [ + "mode", + "source" + ] + }, + "migrate._types:Index": { + "type": "object", + "properties": { + "index": { + "$ref": "#/components/schemas/_types:Indices" + } + }, + "required": [ + "index" + ] + }, "migration.deprecations:Deprecation": { "type": "object", "properties": { @@ -94366,6 +94559,32 @@ } } }, + "migrate.create_from#200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + }, + "index": { + "$ref": "#/components/schemas/_types:IndexName" + }, + "shards_acknowledged": { + "type": "boolean" + } + }, + "required": [ + "acknowledged", + "index", + "shards_acknowledged" + ] + } + } + } + }, "migration.deprecations#200": { "description": "", "content": { @@ -101906,6 +102125,28 @@ }, "style": "form" }, + "migrate.create_from#source": { + "in": "path", + "name": "source", + "description": "The source index or data stream name", + "required": true, + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "migrate.create_from#dest": { + "in": "path", + "name": "dest", + "description": "The destination index or data stream name", + "required": true, + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "simple" + }, "migration.deprecations#index": { "in": "path", "name": "index", @@ -107361,6 +107602,16 @@ }, "required": true }, + "migrate.create_from": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/migrate._types:CreateFrom" + } + } + }, + "required": true + }, "ml.delete_expired_data": { "content": { "application/json": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 8fa956c181..1851429ad2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -9898,6 +9898,163 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "private" + }, + "stack": { + "since": "8.18.0", + "stability": "experimental" + } + }, + "description": "This API cancels a migration reindex attempt for a data stream or index", + "docId": "migrate", + "docTag": "cancel_reindex", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migrate-data-stream.html", + "name": "migrate.cancel_reindex", + "request": { + "name": "Request", + "namespace": "migrate.cancel_reindex" + }, + "requestBodyRequired": false, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "migrate.cancel_reindex" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "POST" + ], + "path": "/_migration/reindex/{index}/_cancel" + } + ] + }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "private" + }, + "stack": { + "since": "8.18.0", + "stability": "experimental" + } + }, + "description": "This API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values.", + "docId": "migrate", + "docTag": "create_from", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migrate-data-stream.html", + "name": "migrate.create_from", + "request": { + "name": "Request", + "namespace": "migrate.create_from" + }, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "migrate.create_from" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "PUT", + "POST" + ], + "path": "/_create_from/{source}/{dest}" + } + ] + }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "private" + }, + "stack": { + "since": "8.18.0", + "stability": "experimental" + } + }, + "description": "This API returns the status of a migration reindex attempt for a data stream or index", + "docId": "migrate", + "docTag": "get_reindex_status", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migrate-data-stream.html", + "name": "migrate.get_reindex_status", + "request": { + "name": "Request", + "namespace": "migrate.get_reindex_status" + }, + "requestBodyRequired": false, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "migrate.get_reindex_status" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "GET" + ], + "path": "/_migration/reindex/{index}/_status" + } + ] + }, + { + "availability": { + "stack": { + "since": "8.18.0", + "stability": "experimental" + } + }, + "description": "\"This API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task", + "docId": "migrate", + "docTag": "reindex", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migrate-data-stream.html", + "name": "migrate.reindex", + "request": { + "name": "Request", + "namespace": "migrate.reindex" + }, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "migrate.reindex" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "POST" + ], + "path": "/_migration/reindex" + } + ] + }, { "availability": { "stack": { @@ -152776,6 +152933,354 @@ }, "specLocation": "logstash/put_pipeline/LogstashPutPipelineResponse.ts#L22-L24" }, + { + "kind": "interface", + "name": { + "name": "CreateFrom", + "namespace": "migrate._types" + }, + "properties": [ + { + "description": "Mappings overrides to be applied to the destination index (optional)", + "name": "mappings_override", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TypeMapping", + "namespace": "_types.mapping" + } + } + }, + { + "description": "Settings overrides to be applied to the destination index (optional)", + "name": "settings_override", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexSettings", + "namespace": "indices._types" + } + } + } + ], + "specLocation": "migrate/_types/CreateFrom.ts#L23-L32" + }, + { + "kind": "interface", + "name": { + "name": "Index", + "namespace": "migrate._types" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Indices", + "namespace": "_types" + } + } + } + ], + "specLocation": "migrate/_types/MigrateReindex.ts#L33-L35" + }, + { + "kind": "interface", + "name": { + "name": "MigrateReindex", + "namespace": "migrate._types" + }, + "properties": [ + { + "description": "Reindex mode. Currently only 'upgrade' is supported.", + "name": "mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The source index or data stream (only data streams are currently supported).", + "name": "source", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Index", + "namespace": "migrate._types" + } + } + } + ], + "specLocation": "migrate/_types/MigrateReindex.ts#L22-L31" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "This API cancels a migration reindex attempt for a data stream or index", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "migrate.cancel_reindex" + }, + "path": [ + { + "description": "The index or data stream name", + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Indices", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "migrate/cancel_reindex/MigrateCancelReindexRequest.ts#L23-L37" + }, + { + "kind": "response", + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "name": { + "name": "Response", + "namespace": "migrate.cancel_reindex" + }, + "specLocation": "migrate/cancel_reindex/MigrateCancelReindexResponse.ts#L22-L24" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "create_from", + "value": { + "kind": "instance_of", + "type": { + "name": "CreateFrom", + "namespace": "migrate._types" + } + } + }, + "description": "This API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "migrate.create_from" + }, + "path": [ + { + "description": "The source index or data stream name", + "name": "source", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The destination index or data stream name", + "name": "dest", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "query": [], + "specLocation": "migrate/create_from/MigrateCreateFromRequest.ts#L23-L41" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "acknowledged", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + }, + { + "name": "shards_acknowledged", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "migrate.create_from" + }, + "specLocation": "migrate/create_from/MigrateCreateFromResponse.ts#L22-L28" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "This API returns the status of a migration reindex attempt for a data stream or index", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "migrate.get_reindex_status" + }, + "path": [ + { + "description": "The index or data stream name", + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Indices", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "migrate/get_reindex_status/MigrateGetReindexStatusRequest.ts#L23-L37" + }, + { + "kind": "response", + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "name": { + "name": "Response", + "namespace": "migrate.get_reindex_status" + }, + "specLocation": "migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts#L22-L24" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "reindex", + "value": { + "kind": "instance_of", + "type": { + "name": "MigrateReindex", + "namespace": "migrate._types" + } + } + }, + "description": "\"This API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "migrate.reindex" + }, + "path": [], + "query": [], + "specLocation": "migrate/reindex/MigrateReindexRequest.ts#L23-L34" + }, + { + "kind": "response", + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "name": { + "name": "Response", + "namespace": "migrate.reindex" + }, + "specLocation": "migrate/reindex/MigrateReindexResponse.ts#L22-L24" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index f8b9a2684d..8043ed27bf 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13826,6 +13826,50 @@ export interface LogstashPutPipelineRequest extends RequestBase { export type LogstashPutPipelineResponse = boolean +export interface MigrateCreateFrom { + mappings_override?: MappingTypeMapping + settings_override?: IndicesIndexSettings +} + +export interface MigrateIndex { + index: Indices +} + +export interface MigrateMigrateReindex { + mode: string + source: MigrateIndex +} + +export interface MigrateCancelReindexRequest extends RequestBase { + index: Indices +} + +export type MigrateCancelReindexResponse = AcknowledgedResponseBase + +export interface MigrateCreateFromRequest extends RequestBase { + source: string + dest: string + body?: MigrateCreateFrom +} + +export interface MigrateCreateFromResponse { + acknowledged: boolean + index: IndexName + shards_acknowledged: boolean +} + +export interface MigrateGetReindexStatusRequest extends RequestBase { + index: Indices +} + +export type MigrateGetReindexStatusResponse = AcknowledgedResponseBase + +export interface MigrateReindexRequest extends RequestBase { + body?: MigrateMigrateReindex +} + +export type MigrateReindexResponse = AcknowledgedResponseBase + export interface MigrationDeprecationsDeprecation { details?: string level: MigrationDeprecationsDeprecationLevel diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 7b06d87c01..88d9aa5f28 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -302,6 +302,7 @@ mapping-source-field,https://www.elastic.co/guide/en/elasticsearch/reference/{br mapping,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mapping.html mapping,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/mapping.html mean-reciprocal,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-rank-eval.html#_mean_reciprocal_rank +migrate,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migrate-data-stream.html migrate-index-allocation-filters,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migrate-index-allocation-filters.html migration-api-deprecation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/migration-api-deprecation.html migration-api-feature-upgrade,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/feature-migration-api.html diff --git a/specification/_json_spec/migrate.cancel_reindex.json b/specification/_json_spec/migrate.cancel_reindex.json new file mode 100644 index 0000000000..6ab0ee44eb --- /dev/null +++ b/specification/_json_spec/migrate.cancel_reindex.json @@ -0,0 +1,28 @@ +{ + "migrate.cancel_reindex": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "description": "This API cancels migration reindex attempt for a data stream or index" + }, + "stability": "experimental", + "visibility": "private", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_migration/reindex/{index}/_cancel", + "methods": ["POST"], + "parts": { + "index": { + "type": "string", + "description": "The index or data stream name" + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/migrate.create_from.json b/specification/_json_spec/migrate.create_from.json new file mode 100644 index 0000000000..edb5037f66 --- /dev/null +++ b/specification/_json_spec/migrate.create_from.json @@ -0,0 +1,36 @@ +{ + "migrate.create_from": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "description": "This API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values." + }, + "stability": "experimental", + "visibility": "private", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_create_from/{source}/{dest}", + "methods": ["PUT", "POST"], + "parts": { + "source": { + "type": "string", + "description": "The source index name" + }, + "dest": { + "type": "string", + "description": "The destination index name" + } + } + } + ] + }, + "body": { + "description": "The body contains the fields `mappings_override` and `settings_override`.", + "required": false + } + } +} diff --git a/specification/_json_spec/migrate.get_reindex_status.json b/specification/_json_spec/migrate.get_reindex_status.json new file mode 100644 index 0000000000..d5361ff1bb --- /dev/null +++ b/specification/_json_spec/migrate.get_reindex_status.json @@ -0,0 +1,28 @@ +{ + "migrate.get_reindex_status": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "description": "This API returns the status of a migration reindex attempt for a data stream or index" + }, + "stability": "experimental", + "visibility": "private", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_migration/reindex/{index}/_status", + "methods": ["GET"], + "parts": { + "index": { + "type": "string", + "description": "The index or data stream name" + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/migrate.reindex.json b/specification/_json_spec/migrate.reindex.json new file mode 100644 index 0000000000..2736f7ecd7 --- /dev/null +++ b/specification/_json_spec/migrate.reindex.json @@ -0,0 +1,26 @@ +{ + "migrate.reindex": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-stream-reindex.html", + "description": "This API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task" + }, + "stability": "experimental", + "visibility": "private", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_migration/reindex", + "methods": ["POST"] + } + ] + }, + "body": { + "description": "The body contains the fields `mode` and `source.index`, where the only mode currently supported is `upgrade`, and the `source.index` must be a data stream name", + "required": true + } + } +} diff --git a/specification/migrate/_types/CreateFrom.ts b/specification/migrate/_types/CreateFrom.ts new file mode 100644 index 0000000000..00f1e3c920 --- /dev/null +++ b/specification/migrate/_types/CreateFrom.ts @@ -0,0 +1,32 @@ +/* + * 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 { IndexSettings } from '@indices/_types/IndexSettings' +import { TypeMapping } from '@_types/mapping/TypeMapping' + +export class CreateFrom { + /** + * Mappings overrides to be applied to the destination index (optional) + */ + mappings_override?: TypeMapping + /** + * Settings overrides to be applied to the destination index (optional) + */ + settings_override?: IndexSettings +} diff --git a/specification/migrate/_types/MigrateReindex.ts b/specification/migrate/_types/MigrateReindex.ts new file mode 100644 index 0000000000..15863d9b02 --- /dev/null +++ b/specification/migrate/_types/MigrateReindex.ts @@ -0,0 +1,35 @@ +/* + * 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 { Indices } from '@_types/common' + +export class MigrateReindex { + /** + * Reindex mode. Currently only 'upgrade' is supported. + */ + mode: string + /** + * The source index or data stream (only data streams are currently supported). + */ + source: Index +} + +export class Index { + index: Indices +} diff --git a/specification/migrate/cancel_reindex/MigrateCancelReindexRequest.ts b/specification/migrate/cancel_reindex/MigrateCancelReindexRequest.ts new file mode 100644 index 0000000000..2d75a195fa --- /dev/null +++ b/specification/migrate/cancel_reindex/MigrateCancelReindexRequest.ts @@ -0,0 +1,37 @@ +/* + * 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 { RequestBase } from '@_types/Base' +import { Indices } from '@_types/common' + +/** + * This API cancels a migration reindex attempt for a data stream or index + * + * @rest_spec_name migrate.cancel_reindex + * @availability stack since=8.18.0 stability=experimental + * @availability serverless stability=experimental visibility=private + * @doc_id migrate + * @doc_tag cancel_reindex + */ +export interface Request extends RequestBase { + path_parts: { + /** The index or data stream name */ + index: Indices + } +} diff --git a/specification/migrate/cancel_reindex/MigrateCancelReindexResponse.ts b/specification/migrate/cancel_reindex/MigrateCancelReindexResponse.ts new file mode 100644 index 0000000000..7374da4a4c --- /dev/null +++ b/specification/migrate/cancel_reindex/MigrateCancelReindexResponse.ts @@ -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' + +export class Response { + body: AcknowledgedResponseBase +} diff --git a/specification/migrate/create_from/MigrateCreateFromRequest.ts b/specification/migrate/create_from/MigrateCreateFromRequest.ts new file mode 100644 index 0000000000..691f086a31 --- /dev/null +++ b/specification/migrate/create_from/MigrateCreateFromRequest.ts @@ -0,0 +1,41 @@ +/* + * 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 { RequestBase } from '@_types/Base' +import { CreateFrom } from '../_types/CreateFrom' + +/** + * This API creates a destination from a source index. It copies the mappings and settings from the source index while allowing request settings and mappings to override the source values. + * + * @rest_spec_name migrate.create_from + * @availability stack since=8.18.0 stability=experimental + * @availability serverless stability=experimental visibility=private + * @doc_id migrate + * @doc_tag create_from + */ +export interface Request extends RequestBase { + path_parts: { + /** The source index or data stream name */ + source: string + /** The destination index or data stream name */ + dest: string + } + /** @codegen_name create_from */ + body: CreateFrom +} diff --git a/specification/migrate/create_from/MigrateCreateFromResponse.ts b/specification/migrate/create_from/MigrateCreateFromResponse.ts new file mode 100644 index 0000000000..209a7ccdb4 --- /dev/null +++ b/specification/migrate/create_from/MigrateCreateFromResponse.ts @@ -0,0 +1,28 @@ +/* + * 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 { IndexName } from '@_types/common' + +export class Response { + body: { + acknowledged: boolean + index: IndexName + shards_acknowledged: boolean + } +} diff --git a/specification/migrate/get_reindex_status/MigrateGetReindexStatusRequest.ts b/specification/migrate/get_reindex_status/MigrateGetReindexStatusRequest.ts new file mode 100644 index 0000000000..c490e71a36 --- /dev/null +++ b/specification/migrate/get_reindex_status/MigrateGetReindexStatusRequest.ts @@ -0,0 +1,37 @@ +/* + * 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 { RequestBase } from '@_types/Base' +import { Indices } from '@_types/common' + +/** + * This API returns the status of a migration reindex attempt for a data stream or index + * + * @rest_spec_name migrate.get_reindex_status + * @availability stack since=8.18.0 stability=experimental + * @availability serverless stability=experimental visibility=private + * @doc_id migrate + * @doc_tag get_reindex_status + */ +export interface Request extends RequestBase { + path_parts: { + /** The index or data stream name */ + index: Indices + } +} diff --git a/specification/migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts b/specification/migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts new file mode 100644 index 0000000000..7374da4a4c --- /dev/null +++ b/specification/migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts @@ -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' + +export class Response { + body: AcknowledgedResponseBase +} diff --git a/specification/migrate/reindex/MigrateReindexRequest.ts b/specification/migrate/reindex/MigrateReindexRequest.ts new file mode 100644 index 0000000000..425e88c60d --- /dev/null +++ b/specification/migrate/reindex/MigrateReindexRequest.ts @@ -0,0 +1,34 @@ +/* + * 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 { RequestBase } from '@_types/Base' +import { MigrateReindex } from '../_types/MigrateReindex' + +/** + * "This API reindexes all legacy backing indices for a data stream. It does this in a persistent task. The persistent task id is returned immediately, and the reindexing work is completed in that task + * + * @rest_spec_name migrate.reindex + * @availability stack since=8.18.0 stability=experimental + * @doc_id migrate + * @doc_tag reindex + */ +export interface Request extends RequestBase { + /** @codegen_name reindex */ + body: MigrateReindex +} diff --git a/specification/migrate/reindex/MigrateReindexResponse.ts b/specification/migrate/reindex/MigrateReindexResponse.ts new file mode 100644 index 0000000000..7374da4a4c --- /dev/null +++ b/specification/migrate/reindex/MigrateReindexResponse.ts @@ -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' + +export class Response { + body: AcknowledgedResponseBase +}