diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 1385ef2e8d..4238df504c 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -17993,6 +17993,209 @@ "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": { + "type": "object", + "properties": { + "start_time": { + "$ref": "#/components/schemas/_types:DateTime" + }, + "start_time_millis": { + "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" + }, + "complete": { + "type": "boolean" + }, + "total_indices_in_data_stream": { + "type": "number" + }, + "total_indices_requiring_upgrade": { + "type": "number" + }, + "successes": { + "type": "number" + }, + "in_progress": { + "type": "array", + "items": { + "$ref": "#/components/schemas/migrate.get_reindex_status:StatusInProgress" + } + }, + "pending": { + "type": "number" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/migrate.get_reindex_status:StatusError" + } + }, + "exception": { + "type": "string" + } + }, + "required": [ + "start_time_millis", + "complete", + "total_indices_in_data_stream", + "total_indices_requiring_upgrade", + "successes", + "in_progress", + "pending", + "errors" + ] + } + } + } + } + }, + "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.reindex:MigrateReindex" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + } + } + } + } + }, + "x-state": "Technical preview" + } + }, "/_migration/deprecations": { "get": { "tags": [ @@ -76073,6 +76276,83 @@ "_index" ] }, + "migrate.create_from:CreateFrom": { + "type": "object", + "properties": { + "mappings_override": { + "$ref": "#/components/schemas/_types.mapping:TypeMapping" + }, + "settings_override": { + "$ref": "#/components/schemas/indices._types:IndexSettings" + } + } + }, + "migrate.get_reindex_status:StatusInProgress": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "total_doc_count": { + "type": "number" + }, + "reindexed_doc_count": { + "type": "number" + } + }, + "required": [ + "index", + "total_doc_count", + "reindexed_doc_count" + ] + }, + "migrate.get_reindex_status:StatusError": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "index", + "message" + ] + }, + "migrate.reindex:MigrateReindex": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/migrate.reindex:ModeEnum" + }, + "source": { + "$ref": "#/components/schemas/migrate.reindex:SourceIndex" + } + }, + "required": [ + "mode", + "source" + ] + }, + "migrate.reindex:ModeEnum": { + "type": "string", + "enum": [ + "upgrade" + ] + }, + "migrate.reindex:SourceIndex": { + "type": "object", + "properties": { + "index": { + "$ref": "#/components/schemas/_types:IndexName" + } + }, + "required": [ + "index" + ] + }, "migration.deprecations:Deprecation": { "type": "object", "properties": { @@ -95187,6 +95467,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": { @@ -102811,6 +103117,28 @@ }, "style": "form" }, + "migrate.create_from#source": { + "in": "path", + "name": "source", + "description": "The source index or data stream name", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:IndexName" + }, + "style": "simple" + }, + "migrate.create_from#dest": { + "in": "path", + "name": "dest", + "description": "The destination index or data stream name", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:IndexName" + }, + "style": "simple" + }, "migration.deprecations#index": { "in": "path", "name": "index", @@ -108314,6 +108642,16 @@ }, "required": true }, + "migrate.create_from": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/migrate.create_from:CreateFrom" + } + } + }, + "required": true + }, "ml.delete_expired_data": { "content": { "application/json": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index dd3b98c3c4..8c3ad80575 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -96030,6 +96030,19 @@ }, "specLocation": "license/_types/License.ts#L23-L33" }, + { + "kind": "enum", + "members": [ + { + "name": "upgrade" + } + ], + "name": { + "name": "ModeEnum", + "namespace": "migrate.reindex" + }, + "specLocation": "migrate/reindex/MigrateReindexRequest.ts#L51-L53" + }, { "kind": "enum", "members": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 81a4ff3473..105c2830b1 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -10075,6 +10075,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": { @@ -153836,6 +153993,562 @@ }, "specLocation": "logstash/put_pipeline/LogstashPutPipelineResponse.ts#L22-L24" }, + { + "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": "interface", + "name": { + "name": "CreateFrom", + "namespace": "migrate.create_from" + }, + "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/create_from/MigrateCreateFromRequest.ts#L45-L54" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "create_from", + "value": { + "kind": "instance_of", + "type": { + "name": "CreateFrom", + "namespace": "migrate.create_from" + } + } + }, + "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": "IndexName", + "namespace": "_types" + } + } + }, + { + "description": "The destination index or data stream name", + "name": "dest", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "migrate/create_from/MigrateCreateFromRequest.ts#L25-L43" + }, + { + "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": "properties", + "properties": [ + { + "name": "start_time", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } + }, + { + "name": "start_time_millis", + "required": true, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "EpochTime", + "namespace": "_types" + } + } + }, + { + "name": "complete", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "total_indices_in_data_stream", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "total_indices_requiring_upgrade", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "successes", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "in_progress", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "StatusInProgress", + "namespace": "migrate.get_reindex_status" + } + } + } + }, + { + "name": "pending", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "errors", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "StatusError", + "namespace": "migrate.get_reindex_status" + } + } + } + }, + { + "name": "exception", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "migrate.get_reindex_status" + }, + "specLocation": "migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts#L23-L36" + }, + { + "kind": "interface", + "name": { + "name": "StatusError", + "namespace": "migrate.get_reindex_status" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "message", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts#L44-L47" + }, + { + "kind": "interface", + "name": { + "name": "StatusInProgress", + "namespace": "migrate.get_reindex_status" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "total_doc_count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "reindexed_doc_count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + } + ], + "specLocation": "migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts#L38-L42" + }, + { + "kind": "interface", + "name": { + "name": "MigrateReindex", + "namespace": "migrate.reindex" + }, + "properties": [ + { + "description": "Reindex mode. Currently only 'upgrade' is supported.", + "name": "mode", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ModeEnum", + "namespace": "migrate.reindex" + } + } + }, + { + "description": "The source index or data stream (only data streams are currently supported).", + "name": "source", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SourceIndex", + "namespace": "migrate.reindex" + } + } + } + ], + "specLocation": "migrate/reindex/MigrateReindexRequest.ts#L36-L45" + }, + { + "kind": "enum", + "members": [ + { + "name": "upgrade" + } + ], + "name": { + "name": "ModeEnum", + "namespace": "migrate.reindex" + }, + "specLocation": "migrate/reindex/MigrateReindexRequest.ts#L51-L53" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "value", + "codegenName": "reindex", + "value": { + "kind": "instance_of", + "type": { + "name": "MigrateReindex", + "namespace": "migrate.reindex" + } + } + }, + "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": { + "name": "SourceIndex", + "namespace": "migrate.reindex" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + } + ], + "specLocation": "migrate/reindex/MigrateReindexRequest.ts#L47-L49" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index e9c754de1c..37f3fe182d 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13881,6 +13881,74 @@ export interface LogstashPutPipelineRequest extends RequestBase { export type LogstashPutPipelineResponse = boolean +export interface MigrateCancelReindexRequest extends RequestBase { + index: Indices +} + +export type MigrateCancelReindexResponse = AcknowledgedResponseBase + +export interface MigrateCreateFromCreateFrom { + mappings_override?: MappingTypeMapping + settings_override?: IndicesIndexSettings +} + +export interface MigrateCreateFromRequest extends RequestBase { + source: IndexName + dest: IndexName + body?: MigrateCreateFromCreateFrom +} + +export interface MigrateCreateFromResponse { + acknowledged: boolean + index: IndexName + shards_acknowledged: boolean +} + +export interface MigrateGetReindexStatusRequest extends RequestBase { + index: Indices +} + +export interface MigrateGetReindexStatusResponse { + start_time?: DateTime + start_time_millis: EpochTime + complete: boolean + total_indices_in_data_stream: integer + total_indices_requiring_upgrade: integer + successes: integer + in_progress: MigrateGetReindexStatusStatusInProgress[] + pending: integer + errors: MigrateGetReindexStatusStatusError[] + exception?: string +} + +export interface MigrateGetReindexStatusStatusError { + index: string + message: string +} + +export interface MigrateGetReindexStatusStatusInProgress { + index: string + total_doc_count: long + reindexed_doc_count: long +} + +export interface MigrateReindexMigrateReindex { + mode: MigrateReindexModeEnum + source: MigrateReindexSourceIndex +} + +export type MigrateReindexModeEnum = 'upgrade' + +export interface MigrateReindexRequest extends RequestBase { + body?: MigrateReindexMigrateReindex +} + +export type MigrateReindexResponse = AcknowledgedResponseBase + +export interface MigrateReindexSourceIndex { + index: IndexName +} + export interface MigrationDeprecationsDeprecation { details?: string level: MigrationDeprecationsDeprecationLevel diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index d4727944ed..42ab7af978 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -304,6 +304,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/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..f4f7983830 --- /dev/null +++ b/specification/migrate/create_from/MigrateCreateFromRequest.ts @@ -0,0 +1,54 @@ +/* + * 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 { RequestBase } from '@_types/Base' +import { IndexName } from '@_types/common' +import { TypeMapping } from '@_types/mapping/TypeMapping' + +/** + * 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: IndexName + /** The destination index or data stream name */ + dest: IndexName + } + /** @codegen_name create_from */ + body: CreateFrom +} + +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/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..87eec3f916 --- /dev/null +++ b/specification/migrate/get_reindex_status/MigrateGetReindexStatusResponse.ts @@ -0,0 +1,47 @@ +/* + * 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 { integer, long } from '@_types/Numeric' +import { DateTime, EpochTime, UnitMillis } from '@_types/Time' + +export class Response { + body: { + start_time?: DateTime + start_time_millis: EpochTime + complete: boolean + total_indices_in_data_stream: integer + total_indices_requiring_upgrade: integer + successes: integer + in_progress: Array + pending: integer + errors: Array + exception?: string + } +} + +export class StatusInProgress { + index: string + total_doc_count: long + reindexed_doc_count: long +} + +export class StatusError { + index: string + message: string +} diff --git a/specification/migrate/reindex/MigrateReindexRequest.ts b/specification/migrate/reindex/MigrateReindexRequest.ts new file mode 100644 index 0000000000..e3db0d852a --- /dev/null +++ b/specification/migrate/reindex/MigrateReindexRequest.ts @@ -0,0 +1,53 @@ +/* + * 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 { IndexName } from '@_types/common' + +/** + * "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 +} + +export class MigrateReindex { + /** + * Reindex mode. Currently only 'upgrade' is supported. + */ + mode: ModeEnum + /** + * The source index or data stream (only data streams are currently supported). + */ + source: SourceIndex +} + +export class SourceIndex { + index: IndexName +} + +enum ModeEnum { + upgrade +} 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 +}