From e08cfc552ff0324f1d8688c5303895c9caf0a6f2 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 24 Mar 2025 16:39:49 +0400 Subject: [PATCH 1/2] Add ml.get_transform_stats issues in response --- output/openapi/elasticsearch-openapi.json | 36 ++++++ .../elasticsearch-serverless-openapi.json | 36 ++++++ output/schema/schema-serverless.json | 104 +++++++++++++++++- output/schema/schema.json | 104 +++++++++++++++++- output/typescript/types.ts | 9 ++ .../transform/get_transform_stats/types.ts | 18 ++- 6 files changed, 296 insertions(+), 11 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 6c45fd480d..8dac7119b6 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -94153,12 +94153,48 @@ "properties": { "status": { "$ref": "#/components/schemas/_types:HealthStatus" + }, + "issues": { + "description": "If a non-healthy status is returned, contains a list of issues of the transform.", + "type": "array", + "items": { + "$ref": "#/components/schemas/transform.get_transform_stats:TransformHealthIssue" + } } }, "required": [ "status" ] }, + "transform.get_transform_stats:TransformHealthIssue": { + "type": "object", + "properties": { + "type": { + "description": "The type of the issue", + "type": "string" + }, + "issue": { + "description": "A description of the issue", + "type": "string" + }, + "details": { + "description": "Details about the issue", + "type": "string" + }, + "count": { + "description": "Number of times this issue has occurred since it started", + "type": "number" + }, + "first_occurrence": { + "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" + } + }, + "required": [ + "type", + "issue", + "count" + ] + }, "transform.get_transform_stats:TransformIndexerStats": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index ef165f4ddf..30b9e3cc1e 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -58201,12 +58201,48 @@ "properties": { "status": { "$ref": "#/components/schemas/_types:HealthStatus" + }, + "issues": { + "description": "If a non-healthy status is returned, contains a list of issues of the transform.", + "type": "array", + "items": { + "$ref": "#/components/schemas/transform.get_transform_stats:TransformHealthIssue" + } } }, "required": [ "status" ] }, + "transform.get_transform_stats:TransformHealthIssue": { + "type": "object", + "properties": { + "type": { + "description": "The type of the issue", + "type": "string" + }, + "issue": { + "description": "A description of the issue", + "type": "string" + }, + "details": { + "description": "Details about the issue", + "type": "string" + }, + "count": { + "description": "Number of times this issue has occurred since it started", + "type": "number" + }, + "first_occurrence": { + "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" + } + }, + "required": [ + "type", + "issue", + "count" + ] + }, "transform.get_transform_stats:TransformIndexerStats": { "type": "object", "properties": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index aa66f92b23..c90fdfc086 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -143772,7 +143772,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L85-L92" + "specLocation": "transform/get_transform_stats/types.ts#L101-L108" }, { "kind": "interface", @@ -143866,7 +143866,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L76-L83" + "specLocation": "transform/get_transform_stats/types.ts#L92-L99" }, { "kind": "interface", @@ -143931,7 +143931,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L48-L54" + "specLocation": "transform/get_transform_stats/types.ts#L64-L70" }, { "kind": "interface", @@ -143950,9 +143950,103 @@ "namespace": "_types" } } + }, + { + "description": "If a non-healthy status is returned, contains a list of issues of the transform.", + "name": "issues", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "TransformHealthIssue", + "namespace": "transform.get_transform_stats" + } + } + } + } + ], + "specLocation": "transform/get_transform_stats/types.ts#L44-L49" + }, + { + "kind": "interface", + "name": { + "name": "TransformHealthIssue", + "namespace": "transform.get_transform_stats" + }, + "properties": [ + { + "description": "The type of the issue", + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "A description of the issue", + "name": "issue", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Details about the issue", + "name": "details", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Number of times this issue has occurred since it started", + "name": "count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "The timestamp this issue occurred for for the first time", + "name": "first_occurrence", + "required": false, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "kind": "instance_of", + "type": { + "name": "EpochTime", + "namespace": "_types" + } + } } ], - "specLocation": "transform/get_transform_stats/types.ts#L44-L46" + "specLocation": "transform/get_transform_stats/types.ts#L51-L62" }, { "kind": "interface", @@ -144194,7 +144288,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L56-L74" + "specLocation": "transform/get_transform_stats/types.ts#L72-L90" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 8671596959..022a9f4260 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -226284,7 +226284,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L76-L83" + "specLocation": "transform/get_transform_stats/types.ts#L92-L99" }, { "kind": "interface", @@ -226360,7 +226360,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L85-L92" + "specLocation": "transform/get_transform_stats/types.ts#L101-L108" }, { "kind": "request", @@ -226494,6 +226494,85 @@ }, "specLocation": "transform/get_transform_stats/GetTransformStatsResponse.ts#L23-L25" }, + { + "kind": "interface", + "name": { + "name": "TransformHealthIssue", + "namespace": "transform.get_transform_stats" + }, + "properties": [ + { + "description": "The type of the issue", + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "A description of the issue", + "name": "issue", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Details about the issue", + "name": "details", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Number of times this issue has occurred since it started", + "name": "count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "The timestamp this issue occurred for for the first time", + "name": "first_occurrence", + "required": false, + "type": { + "kind": "instance_of", + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "UnitMillis", + "namespace": "_types" + } + } + ], + "type": { + "name": "EpochTime", + "namespace": "_types" + } + } + } + ], + "specLocation": "transform/get_transform_stats/types.ts#L51-L62" + }, { "kind": "interface", "name": { @@ -226734,7 +226813,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L56-L74" + "specLocation": "transform/get_transform_stats/types.ts#L72-L90" }, { "kind": "interface", @@ -226799,7 +226878,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L48-L54" + "specLocation": "transform/get_transform_stats/types.ts#L64-L70" }, { "kind": "interface", @@ -226908,9 +226987,24 @@ "namespace": "_types" } } + }, + { + "description": "If a non-healthy status is returned, contains a list of issues of the transform.", + "name": "issues", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "TransformHealthIssue", + "namespace": "transform.get_transform_stats" + } + } + } } ], - "specLocation": "transform/get_transform_stats/types.ts#L44-L46" + "specLocation": "transform/get_transform_stats/types.ts#L44-L49" }, { "kind": "request", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ce67705ca0..c97e28b914 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20964,6 +20964,14 @@ export interface TransformGetTransformStatsResponse { transforms: TransformGetTransformStatsTransformStats[] } +export interface TransformGetTransformStatsTransformHealthIssue { + type: string + issue: string + details?: string + count: integer + first_occurrence?: EpochTime +} + export interface TransformGetTransformStatsTransformIndexerStats { delete_time_in_ms?: EpochTime documents_indexed: long @@ -21004,6 +21012,7 @@ export interface TransformGetTransformStatsTransformStats { export interface TransformGetTransformStatsTransformStatsHealth { status: HealthStatus + issues?: TransformGetTransformStatsTransformHealthIssue[] } export interface TransformPreviewTransformRequest extends RequestBase { diff --git a/specification/transform/get_transform_stats/types.ts b/specification/transform/get_transform_stats/types.ts index 9e65cf5333..1dcbd41c82 100644 --- a/specification/transform/get_transform_stats/types.ts +++ b/specification/transform/get_transform_stats/types.ts @@ -19,7 +19,7 @@ import { HealthStatus, Id } from '@_types/common' import { NodeAttributes } from '@_types/Node' -import { double, long } from '@_types/Numeric' +import { double, integer, long } from '@_types/Numeric' import { DateTime, DurationValue, @@ -42,7 +42,23 @@ export class TransformStats { } export class TransformStatsHealth { + /* Health status of this transform. */ status: HealthStatus + /** If a non-healthy status is returned, contains a list of issues of the transform. */ + issues?: TransformHealthIssue[] +} + +export class TransformHealthIssue { + /** The type of the issue */ + type: string + /** A description of the issue */ + issue: string + /** Details about the issue */ + details?: string + /** Number of times this issue has occurred since it started */ + count: integer + /** The timestamp this issue occurred for for the first time */ + first_occurrence?: EpochTime } export class TransformProgress { From dd179e45ba87d8d07e22017407fa9176a5abc526 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 26 Mar 2025 15:37:38 +0400 Subject: [PATCH 2/2] Add missing DateTime fields They are used when `?human` is passed. --- output/openapi/elasticsearch-openapi.json | 11 ++++- .../elasticsearch-serverless-openapi.json | 11 ++++- output/schema/schema-serverless.json | 47 ++++++++++++++++--- output/schema/schema.json | 47 ++++++++++++++++--- output/typescript/types.ts | 5 +- .../transform/get_transform/types.ts | 3 +- .../transform/get_transform_stats/types.ts | 4 +- 7 files changed, 109 insertions(+), 19 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 8dac7119b6..823f0a1f95 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -93825,6 +93825,9 @@ "create_time": { "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" }, + "create_time_string": { + "$ref": "#/components/schemas/_types:DateTime" + }, "description": { "description": "Free text description of the transform.", "type": "string" @@ -94078,7 +94081,7 @@ "changes_last_detected_at": { "type": "number" }, - "changes_last_detected_at_date_time": { + "changes_last_detected_at_string": { "$ref": "#/components/schemas/_types:DateTime" }, "last": { @@ -94092,6 +94095,9 @@ }, "last_search_time": { "type": "number" + }, + "last_search_time_string": { + "$ref": "#/components/schemas/_types:DateTime" } }, "required": [ @@ -94187,6 +94193,9 @@ }, "first_occurrence": { "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" + }, + "first_occurence_string": { + "$ref": "#/components/schemas/_types:DateTime" } }, "required": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 30b9e3cc1e..cde3760643 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -57876,6 +57876,9 @@ "create_time": { "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" }, + "create_time_string": { + "$ref": "#/components/schemas/_types:DateTime" + }, "description": { "description": "Free text description of the transform.", "type": "string" @@ -58126,7 +58129,7 @@ "changes_last_detected_at": { "type": "number" }, - "changes_last_detected_at_date_time": { + "changes_last_detected_at_string": { "$ref": "#/components/schemas/_types:DateTime" }, "last": { @@ -58140,6 +58143,9 @@ }, "last_search_time": { "type": "number" + }, + "last_search_time_string": { + "$ref": "#/components/schemas/_types:DateTime" } }, "required": [ @@ -58235,6 +58241,9 @@ }, "first_occurrence": { "$ref": "#/components/schemas/_types:EpochTimeUnitMillis" + }, + "first_occurence_string": { + "$ref": "#/components/schemas/_types:DateTime" } }, "required": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index c90fdfc086..9c62b401fb 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -143013,6 +143013,17 @@ } } }, + { + "name": "create_time_string", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } + }, { "description": "Free text description of the transform.", "name": "description", @@ -143153,7 +143164,7 @@ } } ], - "specLocation": "transform/get_transform/types.ts#L33-L61" + "specLocation": "transform/get_transform/types.ts#L33-L62" }, { "kind": "interface", @@ -143717,7 +143728,7 @@ } }, { - "name": "changes_last_detected_at_date_time", + "name": "changes_last_detected_at_string", "required": false, "type": { "kind": "instance_of", @@ -143770,9 +143781,20 @@ "namespace": "_types" } } + }, + { + "name": "last_search_time_string", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } } ], - "specLocation": "transform/get_transform_stats/types.ts#L101-L108" + "specLocation": "transform/get_transform_stats/types.ts#L102-L110" }, { "kind": "interface", @@ -143866,7 +143888,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L92-L99" + "specLocation": "transform/get_transform_stats/types.ts#L93-L100" }, { "kind": "interface", @@ -143931,7 +143953,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L64-L70" + "specLocation": "transform/get_transform_stats/types.ts#L65-L71" }, { "kind": "interface", @@ -144044,9 +144066,20 @@ "namespace": "_types" } } + }, + { + "name": "first_occurence_string", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } } ], - "specLocation": "transform/get_transform_stats/types.ts#L51-L62" + "specLocation": "transform/get_transform_stats/types.ts#L51-L63" }, { "kind": "interface", @@ -144288,7 +144321,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L72-L90" + "specLocation": "transform/get_transform_stats/types.ts#L73-L91" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 022a9f4260..67acc4be38 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -226050,6 +226050,17 @@ } } }, + { + "name": "create_time_string", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } + }, { "description": "Free text description of the transform.", "name": "description", @@ -226190,7 +226201,7 @@ } } ], - "specLocation": "transform/get_transform/types.ts#L33-L61" + "specLocation": "transform/get_transform/types.ts#L33-L62" }, { "kind": "interface", @@ -226284,7 +226295,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L92-L99" + "specLocation": "transform/get_transform_stats/types.ts#L93-L100" }, { "kind": "interface", @@ -226305,7 +226316,7 @@ } }, { - "name": "changes_last_detected_at_date_time", + "name": "changes_last_detected_at_string", "required": false, "type": { "kind": "instance_of", @@ -226358,9 +226369,20 @@ "namespace": "_types" } } + }, + { + "name": "last_search_time_string", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } } ], - "specLocation": "transform/get_transform_stats/types.ts#L101-L108" + "specLocation": "transform/get_transform_stats/types.ts#L102-L110" }, { "kind": "request", @@ -226569,9 +226591,20 @@ "namespace": "_types" } } + }, + { + "name": "first_occurence_string", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "DateTime", + "namespace": "_types" + } + } } ], - "specLocation": "transform/get_transform_stats/types.ts#L51-L62" + "specLocation": "transform/get_transform_stats/types.ts#L51-L63" }, { "kind": "interface", @@ -226813,7 +226846,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L72-L90" + "specLocation": "transform/get_transform_stats/types.ts#L73-L91" }, { "kind": "interface", @@ -226878,7 +226911,7 @@ } } ], - "specLocation": "transform/get_transform_stats/types.ts#L64-L70" + "specLocation": "transform/get_transform_stats/types.ts#L65-L71" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index c97e28b914..758939ce87 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20919,6 +20919,7 @@ export interface TransformGetTransformResponse { export interface TransformGetTransformTransformSummary { authorization?: MlTransformAuthorization create_time?: EpochTime + create_time_string?: DateTime description?: string dest: ReindexDestination frequency?: Duration @@ -20944,11 +20945,12 @@ export interface TransformGetTransformStatsCheckpointStats { export interface TransformGetTransformStatsCheckpointing { changes_last_detected_at?: long - changes_last_detected_at_date_time?: DateTime + changes_last_detected_at_string?: DateTime last: TransformGetTransformStatsCheckpointStats next?: TransformGetTransformStatsCheckpointStats operations_behind?: long last_search_time?: long + last_search_time_string?: DateTime } export interface TransformGetTransformStatsRequest extends RequestBase { @@ -20970,6 +20972,7 @@ export interface TransformGetTransformStatsTransformHealthIssue { details?: string count: integer first_occurrence?: EpochTime + first_occurence_string?: DateTime } export interface TransformGetTransformStatsTransformIndexerStats { diff --git a/specification/transform/get_transform/types.ts b/specification/transform/get_transform/types.ts index a97902bac1..3ceb41563f 100644 --- a/specification/transform/get_transform/types.ts +++ b/specification/transform/get_transform/types.ts @@ -28,7 +28,7 @@ import { SyncContainer } from '@transform/_types/Transform' import { Id, Metadata, VersionString } from '@_types/common' -import { Duration, EpochTime, UnitMillis } from '@_types/Time' +import { DateTime, Duration, EpochTime, UnitMillis } from '@_types/Time' export class TransformSummary { /** @@ -37,6 +37,7 @@ export class TransformSummary { authorization?: TransformAuthorization /** The time the transform was created. */ create_time?: EpochTime + create_time_string?: DateTime /** Free text description of the transform. */ description?: string /** The destination for the transform. */ diff --git a/specification/transform/get_transform_stats/types.ts b/specification/transform/get_transform_stats/types.ts index 1dcbd41c82..5e57632acf 100644 --- a/specification/transform/get_transform_stats/types.ts +++ b/specification/transform/get_transform_stats/types.ts @@ -59,6 +59,7 @@ export class TransformHealthIssue { count: integer /** The timestamp this issue occurred for for the first time */ first_occurrence?: EpochTime + first_occurence_string?: DateTime } export class TransformProgress { @@ -100,9 +101,10 @@ export class CheckpointStats { export class Checkpointing { changes_last_detected_at?: long - changes_last_detected_at_date_time?: DateTime + changes_last_detected_at_string?: DateTime last: CheckpointStats next?: CheckpointStats operations_behind?: long last_search_time?: long + last_search_time_string?: DateTime }