Skip to content

Commit 6c98e77

Browse files
Validate 'ml.update_job' (#523)
Co-authored-by: delvedor <[email protected]>
1 parent 0506294 commit 6c98e77

File tree

6 files changed

+325
-10
lines changed

6 files changed

+325
-10
lines changed

output/schema/schema.json

Lines changed: 260 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8136,7 +8136,7 @@
81368136
"namespace": "ml.update_job"
81378137
},
81388138
"since": "5.5.0",
8139-
"stability": "TODO",
8139+
"stability": "stable",
81408140
"urls": [
81418141
{
81428142
"methods": [
@@ -101314,6 +101314,29 @@
101314101314
}
101315101315
},
101316101316
{
101317+
"attachedBehaviors": [
101318+
"AdditionalProperties"
101319+
],
101320+
"behaviors": [
101321+
{
101322+
"generics": [
101323+
{
101324+
"kind": "instance_of",
101325+
"type": {
101326+
"name": "string",
101327+
"namespace": "internal"
101328+
}
101329+
},
101330+
{
101331+
"kind": "user_defined_value"
101332+
}
101333+
],
101334+
"type": {
101335+
"name": "AdditionalProperties",
101336+
"namespace": "_spec_utils"
101337+
}
101338+
}
101339+
],
101317101340
"kind": "interface",
101318101341
"name": {
101319101342
"name": "CustomSettings",
@@ -104591,7 +104614,7 @@
104591104614
{
104592104615
"description": "The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.",
104593104616
"name": "function",
104594-
"required": true,
104617+
"required": false,
104595104618
"type": {
104596104619
"kind": "instance_of",
104597104620
"type": {
@@ -104636,6 +104659,17 @@
104636104659
"namespace": "internal"
104637104660
}
104638104661
}
104662+
},
104663+
{
104664+
"name": "description",
104665+
"required": false,
104666+
"type": {
104667+
"kind": "instance_of",
104668+
"type": {
104669+
"name": "string",
104670+
"namespace": "internal"
104671+
}
104672+
}
104639104673
}
104640104674
]
104641104675
},
@@ -115745,7 +115779,7 @@
115745115779
"kind": "properties",
115746115780
"properties": [
115747115781
{
115748-
"name": "stub",
115782+
"name": "allow_lazy_open",
115749115783
"required": true,
115750115784
"type": {
115751115785
"kind": "instance_of",
@@ -115754,6 +115788,229 @@
115754115788
"namespace": "internal"
115755115789
}
115756115790
}
115791+
},
115792+
{
115793+
"name": "analysis_config",
115794+
"required": true,
115795+
"type": {
115796+
"kind": "instance_of",
115797+
"type": {
115798+
"name": "AnalysisConfig",
115799+
"namespace": "ml._types"
115800+
}
115801+
}
115802+
},
115803+
{
115804+
"name": "analysis_limits",
115805+
"required": true,
115806+
"type": {
115807+
"kind": "instance_of",
115808+
"type": {
115809+
"name": "AnalysisLimits",
115810+
"namespace": "ml._types"
115811+
}
115812+
}
115813+
},
115814+
{
115815+
"name": "background_persist_interval",
115816+
"required": false,
115817+
"type": {
115818+
"kind": "instance_of",
115819+
"type": {
115820+
"name": "Time",
115821+
"namespace": "_types"
115822+
}
115823+
}
115824+
},
115825+
{
115826+
"name": "create_time",
115827+
"required": true,
115828+
"type": {
115829+
"kind": "instance_of",
115830+
"type": {
115831+
"name": "Time",
115832+
"namespace": "_types"
115833+
}
115834+
}
115835+
},
115836+
{
115837+
"name": "custom_settings",
115838+
"required": false,
115839+
"type": {
115840+
"kind": "instance_of",
115841+
"type": {
115842+
"name": "CustomSettings",
115843+
"namespace": "ml._types"
115844+
}
115845+
}
115846+
},
115847+
{
115848+
"name": "daily_model_snapshot_retention_after_days",
115849+
"required": true,
115850+
"type": {
115851+
"kind": "instance_of",
115852+
"type": {
115853+
"name": "long",
115854+
"namespace": "_types"
115855+
}
115856+
}
115857+
},
115858+
{
115859+
"name": "data_description",
115860+
"required": true,
115861+
"type": {
115862+
"kind": "instance_of",
115863+
"type": {
115864+
"name": "DataDescription",
115865+
"namespace": "ml._types"
115866+
}
115867+
}
115868+
},
115869+
{
115870+
"name": "datafeed_config",
115871+
"required": false,
115872+
"type": {
115873+
"kind": "instance_of",
115874+
"type": {
115875+
"name": "Datafeed",
115876+
"namespace": "ml._types"
115877+
}
115878+
}
115879+
},
115880+
{
115881+
"name": "description",
115882+
"required": false,
115883+
"type": {
115884+
"kind": "instance_of",
115885+
"type": {
115886+
"name": "string",
115887+
"namespace": "internal"
115888+
}
115889+
}
115890+
},
115891+
{
115892+
"name": "groups",
115893+
"required": false,
115894+
"type": {
115895+
"kind": "array_of",
115896+
"value": {
115897+
"kind": "instance_of",
115898+
"type": {
115899+
"name": "string",
115900+
"namespace": "internal"
115901+
}
115902+
}
115903+
}
115904+
},
115905+
{
115906+
"name": "job_id",
115907+
"required": true,
115908+
"type": {
115909+
"kind": "instance_of",
115910+
"type": {
115911+
"name": "Id",
115912+
"namespace": "_types"
115913+
}
115914+
}
115915+
},
115916+
{
115917+
"name": "job_type",
115918+
"required": true,
115919+
"type": {
115920+
"kind": "instance_of",
115921+
"type": {
115922+
"name": "string",
115923+
"namespace": "internal"
115924+
}
115925+
}
115926+
},
115927+
{
115928+
"name": "job_version",
115929+
"required": true,
115930+
"type": {
115931+
"kind": "instance_of",
115932+
"type": {
115933+
"name": "string",
115934+
"namespace": "internal"
115935+
}
115936+
}
115937+
},
115938+
{
115939+
"name": "finished_time",
115940+
"required": false,
115941+
"type": {
115942+
"kind": "instance_of",
115943+
"type": {
115944+
"name": "Time",
115945+
"namespace": "_types"
115946+
}
115947+
}
115948+
},
115949+
{
115950+
"name": "model_plot_config",
115951+
"required": false,
115952+
"type": {
115953+
"kind": "instance_of",
115954+
"type": {
115955+
"name": "ModelPlotConfig",
115956+
"namespace": "ml._types"
115957+
}
115958+
}
115959+
},
115960+
{
115961+
"name": "model_snapshot_id",
115962+
"required": false,
115963+
"type": {
115964+
"kind": "instance_of",
115965+
"type": {
115966+
"name": "Id",
115967+
"namespace": "_types"
115968+
}
115969+
}
115970+
},
115971+
{
115972+
"name": "model_snapshot_retention_days",
115973+
"required": true,
115974+
"type": {
115975+
"kind": "instance_of",
115976+
"type": {
115977+
"name": "long",
115978+
"namespace": "_types"
115979+
}
115980+
}
115981+
},
115982+
{
115983+
"name": "renormalization_window_days",
115984+
"required": false,
115985+
"type": {
115986+
"kind": "instance_of",
115987+
"type": {
115988+
"name": "long",
115989+
"namespace": "_types"
115990+
}
115991+
}
115992+
},
115993+
{
115994+
"name": "results_index_name",
115995+
"required": true,
115996+
"type": {
115997+
"kind": "instance_of",
115998+
"type": {
115999+
"name": "string",
116000+
"namespace": "internal"
116001+
}
116002+
}
116003+
},
116004+
{
116005+
"name": "results_retention_days",
116006+
"required": false,
116007+
"type": {
116008+
"kind": "instance_of",
116009+
"type": {
116010+
"name": "long",
116011+
"namespace": "_types"
116012+
}
116013+
}
115757116014
}
115758116015
]
115759116016
},

output/typescript/types.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10265,11 +10265,13 @@ export type MlChunkingMode = 'auto' | 'manual' | 'off'
1026510265

1026610266
export type MlConditionOperator = 'gt' | 'gte' | 'lt' | 'lte'
1026710267

10268-
export interface MlCustomSettings {
10268+
export interface MlCustomSettingsKeys {
1026910269
custom_urls?: XpackUsageUrlConfig[]
1027010270
created_by?: string
1027110271
job_tags?: Record<string, string>
1027210272
}
10273+
export type MlCustomSettings = MlCustomSettingsKeys |
10274+
{ [property: string]: any }
1027310275

1027410276
export interface MlDataCounts {
1027510277
bucket_count: long
@@ -10631,10 +10633,11 @@ export interface MlDetector {
1063110633
detector_index?: integer
1063210634
exclude_frequent?: MlExcludeFrequent
1063310635
field_name?: Field
10634-
function: string
10636+
function?: string
1063510637
over_field_name?: Field
1063610638
partition_field_name?: Field
1063710639
use_null?: boolean
10640+
description?: string
1063810641
}
1063910642

1064010643
export interface MlDiscoveryNode {
@@ -11922,7 +11925,27 @@ export interface MlUpdateJobRequest extends RequestBase {
1192211925
}
1192311926

1192411927
export interface MlUpdateJobResponse {
11925-
stub: boolean
11928+
allow_lazy_open: boolean
11929+
analysis_config: MlAnalysisConfig
11930+
analysis_limits: MlAnalysisLimits
11931+
background_persist_interval?: Time
11932+
create_time: Time
11933+
custom_settings?: MlCustomSettings
11934+
daily_model_snapshot_retention_after_days: long
11935+
data_description: MlDataDescription
11936+
datafeed_config?: MlDatafeed
11937+
description?: string
11938+
groups?: string[]
11939+
job_id: Id
11940+
job_type: string
11941+
job_version: string
11942+
finished_time?: Time
11943+
model_plot_config?: MlModelPlotConfig
11944+
model_snapshot_id?: Id
11945+
model_snapshot_retention_days: long
11946+
renormalization_window_days?: long
11947+
results_index_name: string
11948+
results_retention_days?: long
1192611949
}
1192711950

1192811951
export interface MlUpdateModelSnapshotRequest extends RequestBase {

specification/ml/_types/Detector.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class Detector {
4949
/**
5050
* The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.
5151
*/
52-
function: string
52+
function?: string
5353
/**
5454
* The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.
5555
*/
@@ -63,6 +63,7 @@ export class Detector {
6363
* @server_default false
6464
*/
6565
use_null?: boolean
66+
description?: string
6667
}
6768

6869
export enum ExcludeFrequent {

specification/ml/_types/Settings.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
import { Dictionary } from '@spec_utils/Dictionary'
2121
import { UrlConfig } from '@xpack/usage/types'
22+
import { AdditionalProperties } from '@spec_utils/behaviors'
23+
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2224

23-
export class CustomSettings {
25+
export class CustomSettings
26+
implements AdditionalProperties<string, UserDefinedValue> {
2427
custom_urls?: UrlConfig[]
2528
created_by?: string
2629
job_tags?: Dictionary<string, string>

0 commit comments

Comments
 (0)