diff --git a/output/schema/schema.json b/output/schema/schema.json index baff599416..8b17c6c0c3 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -7836,9 +7836,16 @@ "description": "Resets an existing anomaly detection job.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html", "name": "ml.reset_job", - "request": null, + "request": { + "name": "Request", + "namespace": "ml.reset_job" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "ml.reset_job" + }, + "since": "7.14.0", "stability": "stable", "urls": [ { @@ -105147,6 +105154,17 @@ } } }, + { + "name": "blocked", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "JobBlocked", + "namespace": "ml._types" + } + } + }, { "name": "create_time", "required": false, @@ -105361,6 +105379,55 @@ } ] }, + { + "kind": "interface", + "name": { + "name": "JobBlocked", + "namespace": "ml._types" + }, + "properties": [ + { + "name": "reason", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "JobBlockedReason", + "namespace": "ml._types" + } + } + }, + { + "name": "task_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TaskId", + "namespace": "_types" + } + } + } + ] + }, + { + "kind": "enum", + "members": [ + { + "name": "delete" + }, + { + "name": "reset" + }, + { + "name": "revert" + } + ], + "name": { + "name": "JobBlockedReason", + "namespace": "ml._types" + } + }, { "kind": "interface", "name": { @@ -114618,6 +114685,71 @@ "namespace": "ml.put_trained_model_alias" } }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "ml.reset_job" + }, + "path": [ + { + "description": "The ID of the job to reset.", + "name": "job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [ + { + "description": "Should this request wait until the operation has completed before returning.", + "name": "wait_for_completion", + "required": false, + "serverDefault": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "internal" + } + } + } + ] + }, + { + "body": { + "kind": "properties", + "properties": [] + }, + "inherits": { + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "ml.reset_job" + } + }, { "attachedBehaviors": [ "CommonQueryParameters" diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index c0987a5605..a504dc3d11 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1212,7 +1212,7 @@ }, "ml.reset_job": { "request": [ - "Missing request & response" + "Request: should not have a body" ], "response": [] }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 9ae7a47374..f5e1b4e448 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10695,6 +10695,7 @@ export interface MlJob { analysis_config: MlAnalysisConfig analysis_limits?: MlAnalysisLimits background_persist_interval?: Time + blocked?: MlJobBlocked create_time?: integer custom_settings?: MlCustomSettings daily_model_snapshot_retention_after_days?: long @@ -10716,6 +10717,13 @@ export interface MlJob { system_annotations_retention_days?: long } +export interface MlJobBlocked { + reason: MlJobBlockedReason + task_id?: TaskId +} + +export type MlJobBlockedReason = 'delete' | 'reset' | 'revert' + export interface MlJobConfig { allow_lazy_open?: boolean analysis_config: MlAnalysisConfig @@ -11791,6 +11799,14 @@ export interface MlPutTrainedModelAliasRequest extends RequestBase { export interface MlPutTrainedModelAliasResponse extends AcknowledgedResponseBase { } +export interface MlResetJobRequest extends RequestBase { + job_id: Id + wait_for_completion?: boolean +} + +export interface MlResetJobResponse extends AcknowledgedResponseBase { +} + export interface MlRevertModelSnapshotRequest extends RequestBase { job_id: Id snapshot_id: Id diff --git a/specification/ml/_types/Job.ts b/specification/ml/_types/Job.ts index a7fcf4a632..77170c85aa 100644 --- a/specification/ml/_types/Job.ts +++ b/specification/ml/_types/Job.ts @@ -21,7 +21,7 @@ import { AnalysisConfig, AnalysisLimits } from '@ml/_types/Analysis' import { ModelPlotConfig } from '@ml/_types/ModelPlot' import { Dictionary } from '@spec_utils/Dictionary' import { CustomSettings } from '@ml/_types/Settings' -import { Field, Id, IndexName, VersionString } from '@_types/common' +import { Field, Id, TaskId, IndexName, VersionString } from '@_types/common' import { double, integer, long } from '@_types/Numeric' import { DateString, Time } from '@_types/Time' import { DiscoveryNode } from './DiscoveryNode' @@ -48,6 +48,7 @@ export class Job { analysis_config: AnalysisConfig analysis_limits?: AnalysisLimits background_persist_interval?: Time + blocked?: JobBlocked create_time?: integer custom_settings?: CustomSettings daily_model_snapshot_retention_after_days?: long @@ -159,3 +160,14 @@ export class DataDescription { time_format?: string field_delimiter?: string } + +export class JobBlocked { + reason: JobBlockedReason + task_id?: TaskId +} + +export enum JobBlockedReason { + delete = 0, + reset = 1, + revert = 2 +} diff --git a/specification/ml/reset_job/MlResetJobRequest.ts b/specification/ml/reset_job/MlResetJobRequest.ts new file mode 100644 index 0000000000..52ef5f07d3 --- /dev/null +++ b/specification/ml/reset_job/MlResetJobRequest.ts @@ -0,0 +1,40 @@ +/* + * 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 { Id } from '@_types/common' + +/** + * @rest_spec_name ml.reset_job + * @since 7.14.0 + * @stability stable + */ +export interface Request extends RequestBase { + path_parts: { + /** The ID of the job to reset. */ + job_id: Id + } + query_parameters?: { + /** + * Should this request wait until the operation has completed before returning. + * @server_default true + */ + wait_for_completion?: boolean + } +} diff --git a/specification/ml/reset_job/MlResetJobResponse.ts b/specification/ml/reset_job/MlResetJobResponse.ts new file mode 100644 index 0000000000..0059ab53e4 --- /dev/null +++ b/specification/ml/reset_job/MlResetJobResponse.ts @@ -0,0 +1,22 @@ +/* + * 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 extends AcknowledgedResponseBase {}