diff --git a/output/schema/schema.json b/output/schema/schema.json index 8f1f63942b..480a0f2344 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -7582,12 +7582,24 @@ "description": "Gets stats for anomaly detection job model snapshot upgrades that are in progress.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html", "name": "ml.get_model_snapshot_upgrade_stats", - "request": null, + "privileges": { + "cluster": [ + "monitor_ml" + ] + }, + "request": { + "name": "Request", + "namespace": "ml.get_model_snapshot_upgrade_stats" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "ml.get_model_snapshot_upgrade_stats" + }, "responseMediaType": [ "application/json" ], + "since": "7.16.0", "stability": "stable", "urls": [ { @@ -115429,7 +115441,7 @@ "name": "CategorizationStatus", "namespace": "ml._types" }, - "specLocation": "ml/_types/Model.ts#L71-L74" + "specLocation": "ml/_types/Model.ts#L80-L83" }, { "kind": "interface", @@ -120657,7 +120669,7 @@ "name": "MemoryStatus", "namespace": "ml._types" }, - "specLocation": "ml/_types/Model.ts#L76-L80" + "specLocation": "ml/_types/Model.ts#L85-L89" }, { "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-job-resource.html#ml-apimodelplotconfig", @@ -120950,7 +120962,7 @@ } } ], - "specLocation": "ml/_types/Model.ts#L47-L69" + "specLocation": "ml/_types/Model.ts#L56-L78" }, { "kind": "interface", @@ -121080,7 +121092,72 @@ } } ], - "specLocation": "ml/_types/Model.ts#L24-L45" + "specLocation": "ml/_types/Model.ts#L25-L46" + }, + { + "kind": "interface", + "name": { + "name": "ModelSnapshotUpgrade", + "namespace": "ml._types" + }, + "properties": [ + { + "name": "job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "snapshot_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "state", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SnapshotUpgradeState", + "namespace": "ml._types" + } + } + }, + { + "name": "node", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "DiscoveryNode", + "namespace": "ml._types" + } + } + }, + { + "name": "assignment_explanation", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ml/_types/Model.ts#L48-L54" }, { "kind": "interface", @@ -121409,6 +121486,28 @@ ], "specLocation": "ml/_types/Rule.ts#L52-L65" }, + { + "kind": "enum", + "members": [ + { + "name": "loading_old_state" + }, + { + "name": "saving_new_state" + }, + { + "name": "stopped" + }, + { + "name": "failed" + } + ], + "name": { + "name": "SnapshotUpgradeState", + "namespace": "ml._types" + }, + "specLocation": "ml/_types/Model.ts#L91-L96" + }, { "kind": "interface", "name": { @@ -126069,6 +126168,105 @@ }, "specLocation": "ml/get_jobs/MlGetJobsResponse.ts#L23-L28" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Retrieves usage information for anomaly detection job model snapshot upgrades.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "ml.get_model_snapshot_upgrade_stats" + }, + "path": [ + { + "description": "Identifier for the anomaly detection job.", + "name": "job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "description": "A numerical character string that uniquely identifies the model snapshot. You can get information for multiple\nsnapshots by using a comma-separated list or a wildcard expression. You can get all snapshots by using `_all`,\nby specifying `*` as the snapshot ID, or by omitting the snapshot ID.", + "name": "snapshot_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [ + { + "description": "Specifies what to do when the request:\n\n - Contains wildcard expressions and there are no jobs that match.\n - Contains the _all string or no identifiers and there are no matches.\n - Contains wildcard expressions and there are only partial matches.\n\nThe default value is true, which returns an empty jobs array when there are no matches and the subset of results\nwhen there are partial matches. If this parameter is false, the request returns a 404 status code when there are\nno matches or only partial matches.", + "name": "allow_no_match", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsRequest.ts#L23-L57" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "model_snapshot_upgrades", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ModelSnapshotUpgrade", + "namespace": "ml._types" + } + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "ml.get_model_snapshot_upgrade_stats" + }, + "specLocation": "ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsResponse.ts#L23-L28" + }, { "attachedBehaviors": [ "CommonQueryParameters" diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index a2f6f4cb77..5e61894b16 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1371,7 +1371,7 @@ }, "ml.get_model_snapshot_upgrade_stats": { "request": [ - "Missing request & response" + "Request: should not have a body" ], "response": [] }, diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 733e7111ed..c259bc66b5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11912,6 +11912,14 @@ export interface MlModelSnapshot { timestamp: long } +export interface MlModelSnapshotUpgrade { + job_id: Id + snapshot_id: Id + state: MlSnapshotUpgradeState + node: MlDiscoveryNode + assignment_explanation: string +} + export interface MlOutlierDetectionParameters { compute_feature_influence?: boolean feature_influence_threshold?: double @@ -11953,6 +11961,8 @@ export interface MlRuleCondition { value: double } +export type MlSnapshotUpgradeState = 'loading_old_state' | 'saving_new_state' | 'stopped' | 'failed' + export interface MlTimingStats { elapsed_time: integer iteration_time?: integer @@ -12480,6 +12490,17 @@ export interface MlGetJobsResponse { jobs: MlJob[] } +export interface MlGetModelSnapshotUpgradeStatsRequest extends RequestBase { + job_id: Id + snapshot_id?: Id + allow_no_match?: boolean +} + +export interface MlGetModelSnapshotUpgradeStatsResponse { + count: long + model_snapshot_upgrades: MlModelSnapshotUpgrade[] +} + export interface MlGetModelSnapshotsRequest extends RequestBase { job_id: Id snapshot_id?: Id diff --git a/specification/ml/_types/Model.ts b/specification/ml/_types/Model.ts index 980e66db8a..bb2f888ce0 100644 --- a/specification/ml/_types/Model.ts +++ b/specification/ml/_types/Model.ts @@ -20,6 +20,7 @@ import { ByteSize, Id, VersionString } from '@_types/common' import { integer, long } from '@_types/Numeric' import { Time } from '@_types/Time' +import { DiscoveryNode } from '@ml/_types/DiscoveryNode' export class ModelSnapshot { /** An optional description of the job. */ @@ -44,6 +45,14 @@ export class ModelSnapshot { timestamp: long } +export class ModelSnapshotUpgrade { + job_id: Id + snapshot_id: Id + state: SnapshotUpgradeState + node: DiscoveryNode + assignment_explanation: string +} + export class ModelSizeStats { bucket_allocation_failures_count: long job_id: Id @@ -78,3 +87,10 @@ export enum MemoryStatus { soft_limit, hard_limit } + +export enum SnapshotUpgradeState { + loading_old_state, + saving_new_state, + stopped, + failed +} diff --git a/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsRequest.ts b/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsRequest.ts new file mode 100644 index 0000000000..c614fd456a --- /dev/null +++ b/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsRequest.ts @@ -0,0 +1,57 @@ +/* + * 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' + +/** + * Retrieves usage information for anomaly detection job model snapshot upgrades. + * @rest_spec_name ml.get_model_snapshot_upgrade_stats + * @since 7.16.0 + * @stability stable + * @cluster_privileges monitor_ml + */ +export interface Request extends RequestBase { + path_parts: { + /** + * Identifier for the anomaly detection job. + */ + job_id: Id + /** + * A numerical character string that uniquely identifies the model snapshot. You can get information for multiple + * snapshots by using a comma-separated list or a wildcard expression. You can get all snapshots by using `_all`, + * by specifying `*` as the snapshot ID, or by omitting the snapshot ID. + */ + snapshot_id?: Id + } + query_parameters: { + /** + * Specifies what to do when the request: + * + * - Contains wildcard expressions and there are no jobs that match. + * - Contains the _all string or no identifiers and there are no matches. + * - Contains wildcard expressions and there are only partial matches. + * + * The default value is true, which returns an empty jobs array when there are no matches and the subset of results + * when there are partial matches. If this parameter is false, the request returns a 404 status code when there are + * no matches or only partial matches. + */ + allow_no_match?: boolean + } +} diff --git a/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsResponse.ts b/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsResponse.ts new file mode 100644 index 0000000000..145c96b75b --- /dev/null +++ b/specification/ml/get_model_snapshot_upgrade_stats/MlGetModelSnapshotUpgradeStatsResponse.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 { long } from '@_types/Numeric' +import { ModelSnapshotUpgrade } from '@ml/_types/Model' + +export class Response { + body: { + count: long + model_snapshot_upgrades: ModelSnapshotUpgrade[] + } +}