diff --git a/output/schema/schema.json b/output/schema/schema.json index 8da975684a..c41cbde9d2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -23720,17 +23720,34 @@ }, { "availability": { - "stack": { + "serverless": { "stability": "stable", - "visibility": "public" + "visibility": "private" + }, + "stack": { + "since": "8.18.0", + "stability": "stable" } }, - "description": "Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-set-upgrade-mode.html", + "description": "Set upgrade_mode for transform indices.\nSets a cluster wide upgrade_mode setting that prepares transform\nindices for an upgrade.\nWhen upgrading your cluster, in some circumstances you must restart your\nnodes and reindex your transform indices. In those circumstances,\nthere must be no transforms running. You can close the transforms,\ndo the upgrade, then open all the transforms again. Alternatively,\nyou can use this API to temporarily halt tasks associated with the transforms\nand prevent new transforms from opening. You can also use this API\nduring upgrades that do not require you to reindex your transform\nindices, though stopping transforms is not a requirement in that case.\nYou can see the current value for the upgrade_mode setting by using the get\ntransform info API.", + "docId": "transform-set-upgrade-mode", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode", + "extPreviousVersionDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/8.18/transform-set-upgrade-mode.html", "name": "transform.set_upgrade_mode", - "request": null, + "privileges": { + "cluster": [ + "manage_transform" + ] + }, + "request": { + "name": "Request", + "namespace": "transform.set_upgrade_mode" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "transform.set_upgrade_mode" + }, "responseMediaType": [ "application/json" ], @@ -264849,6 +264866,80 @@ }, "specLocation": "transform/schedule_now_transform/ScheduleNowTransformResponse.ts#L21-L24" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Set upgrade_mode for transform indices.\nSets a cluster wide upgrade_mode setting that prepares transform\nindices for an upgrade.\nWhen upgrading your cluster, in some circumstances you must restart your\nnodes and reindex your transform indices. In those circumstances,\nthere must be no transforms running. You can close the transforms,\ndo the upgrade, then open all the transforms again. Alternatively,\nyou can use this API to temporarily halt tasks associated with the transforms\nand prevent new transforms from opening. You can also use this API\nduring upgrades that do not require you to reindex your transform\nindices, though stopping transforms is not a requirement in that case.\nYou can see the current value for the upgrade_mode setting by using the get\ntransform info API.", + "examples": { + "TransformSetUpgradeModeExample1": { + "method_request": "POST _transform/set_upgrade_mode?enabled=true" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "transform.set_upgrade_mode" + }, + "path": [], + "query": [ + { + "description": "When `true`, it enables `upgrade_mode` which temporarily halts all\ntransform tasks and prohibits new transform tasks from\nstarting.", + "name": "enabled", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The time to wait for the request to be completed.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "transform/set_upgrade_mode/TransformSetUpgradeModeRequest.ts#L23-L64" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "result", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "name": { + "name": "Response", + "namespace": "transform.set_upgrade_mode" + }, + "specLocation": "transform/set_upgrade_mode/TransformSetUpgradeModeResponse.ts#L22-L25" + }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 2eddac6211..a9a44b4387 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -22532,6 +22532,13 @@ export interface TransformScheduleNowTransformRequest extends RequestBase { export type TransformScheduleNowTransformResponse = AcknowledgedResponseBase +export interface TransformSetUpgradeModeRequest extends RequestBase { + enabled?: boolean + timeout?: Duration +} + +export type TransformSetUpgradeModeResponse = AcknowledgedResponseBase + export interface TransformStartTransformRequest extends RequestBase { transform_id: Id timeout?: Duration diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 6e4281cd88..2ed3d0f3f0 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -908,6 +908,7 @@ terminate-processor,https://www.elastic.co/docs/reference/enrich-processor/termi test-grok-pattern,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-test-grok-pattern,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/test-grok-pattern.html, time-value,https://github.com/elastic/elasticsearch/blob/current/libs/core/src/main/java/org/elasticsearch/core/TimeValue.java,, time-zone-id,https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html,, +transform-set-upgrade-mode,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/transform-set-upgrade-mode.html, trim-processor,https://www.elastic.co/docs/reference/enrich-processor/trim-processor,, update-by-query,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/update-by-query-api,, update-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/update-dfanalytics.html, diff --git a/specification/transform/set_upgrade_mode/TransformSetUpgradeModeRequest.ts b/specification/transform/set_upgrade_mode/TransformSetUpgradeModeRequest.ts new file mode 100644 index 0000000000..a6918ca012 --- /dev/null +++ b/specification/transform/set_upgrade_mode/TransformSetUpgradeModeRequest.ts @@ -0,0 +1,64 @@ +/* + * 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 { Duration } from '@_types/Time' + +/** + * Set upgrade_mode for transform indices. + * Sets a cluster wide upgrade_mode setting that prepares transform + * indices for an upgrade. + * When upgrading your cluster, in some circumstances you must restart your + * nodes and reindex your transform indices. In those circumstances, + * there must be no transforms running. You can close the transforms, + * do the upgrade, then open all the transforms again. Alternatively, + * you can use this API to temporarily halt tasks associated with the transforms + * and prevent new transforms from opening. You can also use this API + * during upgrades that do not require you to reindex your transform + * indices, though stopping transforms is not a requirement in that case. + * You can see the current value for the upgrade_mode setting by using the get + * transform info API. + * @rest_spec_name transform.set_upgrade_mode + * @availability stack since=8.18.0 stability=stable + * @availability serverless stability=stable visibility=private + * @cluster_privileges manage_transform + * @doc_id transform-set-upgrade-mode + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_transform/set_upgrade_mode' + methods: ['POST'] + } + ] + query_parameters: { + /** + * When `true`, it enables `upgrade_mode` which temporarily halts all + * transform tasks and prohibits new transform tasks from + * starting. + * @server_default false + */ + enabled?: boolean + /** + * The time to wait for the request to be completed. + * @server_default 30s + */ + timeout?: Duration + } +} diff --git a/specification/transform/set_upgrade_mode/TransformSetUpgradeModeResponse.ts b/specification/transform/set_upgrade_mode/TransformSetUpgradeModeResponse.ts new file mode 100644 index 0000000000..9e7bdb91cd --- /dev/null +++ b/specification/transform/set_upgrade_mode/TransformSetUpgradeModeResponse.ts @@ -0,0 +1,25 @@ +/* + * 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 { + /** @codegen_name result */ + body: AcknowledgedResponseBase +} diff --git a/specification/transform/set_upgrade_mode/examples/request/TransformSetUpgradeModeExample1.yaml b/specification/transform/set_upgrade_mode/examples/request/TransformSetUpgradeModeExample1.yaml new file mode 100644 index 0000000000..135117bdf1 --- /dev/null +++ b/specification/transform/set_upgrade_mode/examples/request/TransformSetUpgradeModeExample1.yaml @@ -0,0 +1 @@ +method_request: POST _transform/set_upgrade_mode?enabled=true