Skip to content

Commit 5293bce

Browse files
authored
fix api (#395)
1 parent b401bbe commit 5293bce

File tree

6 files changed

+154
-82
lines changed

6 files changed

+154
-82
lines changed

output/schema/schema.json

Lines changed: 105 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -101555,8 +101555,9 @@
101555101555
},
101556101556
"properties": [
101557101557
{
101558+
"description": "An optional description of the job.",
101558101559
"name": "description",
101559-
"required": true,
101560+
"required": false,
101560101561
"type": {
101561101562
"kind": "instance_of",
101562101563
"type": {
@@ -101566,6 +101567,7 @@
101566101567
}
101567101568
},
101568101569
{
101570+
"description": "A numerical character string that uniquely identifies the job that the snapshot was created for.",
101569101571
"name": "job_id",
101570101572
"required": true,
101571101573
"type": {
@@ -101577,8 +101579,9 @@
101577101579
}
101578101580
},
101579101581
{
101582+
"description": "The timestamp of the latest processed record.",
101580101583
"name": "latest_record_time_stamp",
101581-
"required": true,
101584+
"required": false,
101582101585
"type": {
101583101586
"kind": "instance_of",
101584101587
"type": {
@@ -101588,8 +101591,9 @@
101588101591
}
101589101592
},
101590101593
{
101594+
"description": "The timestamp of the latest bucket result.",
101591101595
"name": "latest_result_time_stamp",
101592-
"required": true,
101596+
"required": false,
101593101597
"type": {
101594101598
"kind": "instance_of",
101595101599
"type": {
@@ -101599,8 +101603,21 @@
101599101603
}
101600101604
},
101601101605
{
101602-
"name": "model_size_stats",
101606+
"description": "The minimum version required to be able to restore the model snapshot.",
101607+
"name": "min_version",
101603101608
"required": true,
101609+
"type": {
101610+
"kind": "instance_of",
101611+
"type": {
101612+
"name": "VersionString",
101613+
"namespace": "_types"
101614+
}
101615+
}
101616+
},
101617+
{
101618+
"description": "Summary information describing the model.",
101619+
"name": "model_size_stats",
101620+
"required": false,
101604101621
"type": {
101605101622
"kind": "instance_of",
101606101623
"type": {
@@ -101610,6 +101627,7 @@
101610101627
}
101611101628
},
101612101629
{
101630+
"description": " If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false.",
101613101631
"name": "retain",
101614101632
"required": true,
101615101633
"type": {
@@ -101621,6 +101639,7 @@
101621101639
}
101622101640
},
101623101641
{
101642+
"description": "For internal use only.",
101624101643
"name": "snapshot_doc_count",
101625101644
"required": true,
101626101645
"type": {
@@ -101632,6 +101651,7 @@
101632101651
}
101633101652
},
101634101653
{
101654+
"description": "A numerical character string that uniquely identifies the model snapshot.",
101635101655
"name": "snapshot_id",
101636101656
"required": true,
101637101657
"type": {
@@ -101643,6 +101663,7 @@
101643101663
}
101644101664
},
101645101665
{
101666+
"description": "The creation timestamp for the snapshot.",
101646101667
"name": "timestamp",
101647101668
"required": true,
101648101669
"type": {
@@ -101652,17 +101673,6 @@
101652101673
"namespace": "_types"
101653101674
}
101654101675
}
101655-
},
101656-
{
101657-
"name": "min_version",
101658-
"required": true,
101659-
"type": {
101660-
"kind": "instance_of",
101661-
"type": {
101662-
"name": "VersionString",
101663-
"namespace": "_types"
101664-
}
101665-
}
101666101676
}
101667101677
]
101668101678
},
@@ -107468,56 +107478,23 @@
107468107478
"kind": "properties",
107469107479
"properties": [
107470107480
{
107471-
"name": "desc",
107472-
"required": false,
107473-
"type": {
107474-
"kind": "instance_of",
107475-
"type": {
107476-
"name": "boolean",
107477-
"namespace": "internal"
107478-
}
107479-
}
107480-
},
107481-
{
107482-
"name": "end",
107483-
"required": false,
107484-
"type": {
107485-
"kind": "instance_of",
107486-
"type": {
107487-
"name": "DateString",
107488-
"namespace": "_types"
107489-
}
107490-
}
107491-
},
107492-
{
107493-
"name": "page",
107494-
"required": false,
107495-
"type": {
107496-
"kind": "instance_of",
107497-
"type": {
107498-
"name": "Page",
107499-
"namespace": "ml._types"
107500-
}
107501-
}
107502-
},
107503-
{
107504-
"name": "sort",
107481+
"name": "start",
107505107482
"required": false,
107506107483
"type": {
107507107484
"kind": "instance_of",
107508107485
"type": {
107509-
"name": "Field",
107486+
"name": "Time",
107510107487
"namespace": "_types"
107511107488
}
107512107489
}
107513107490
},
107514107491
{
107515-
"name": "start",
107492+
"name": "end",
107516107493
"required": false,
107517107494
"type": {
107518107495
"kind": "instance_of",
107519107496
"type": {
107520-
"name": "DateString",
107497+
"name": "Time",
107521107498
"namespace": "_types"
107522107499
}
107523107500
}
@@ -107537,6 +107514,7 @@
107537107514
},
107538107515
"path": [
107539107516
{
107517+
"description": "Identifier for the anomaly detection job.",
107540107518
"name": "job_id",
107541107519
"required": true,
107542107520
"type": {
@@ -107548,6 +107526,7 @@
107548107526
}
107549107527
},
107550107528
{
107529+
"description": "A numerical character string that uniquely identifies the model snapshot.",
107551107530
"name": "snapshot_id",
107552107531
"required": false,
107553107532
"type": {
@@ -107559,7 +107538,80 @@
107559107538
}
107560107539
}
107561107540
],
107562-
"query": []
107541+
"query": [
107542+
{
107543+
"description": "If true, the results are sorted in descending order.",
107544+
"name": "desc",
107545+
"required": false,
107546+
"type": {
107547+
"kind": "instance_of",
107548+
"type": {
107549+
"name": "boolean",
107550+
"namespace": "internal"
107551+
}
107552+
}
107553+
},
107554+
{
107555+
"description": "Returns snapshots with timestamps earlier than this time.",
107556+
"name": "end",
107557+
"required": false,
107558+
"type": {
107559+
"kind": "instance_of",
107560+
"type": {
107561+
"name": "Time",
107562+
"namespace": "_types"
107563+
}
107564+
}
107565+
},
107566+
{
107567+
"description": "Skips the specified number of snapshots.",
107568+
"name": "from",
107569+
"required": false,
107570+
"type": {
107571+
"kind": "instance_of",
107572+
"type": {
107573+
"name": "integer",
107574+
"namespace": "_types"
107575+
}
107576+
}
107577+
},
107578+
{
107579+
"description": "Specifies the maximum number of snapshots to obtain.",
107580+
"name": "size",
107581+
"required": false,
107582+
"type": {
107583+
"kind": "instance_of",
107584+
"type": {
107585+
"name": "integer",
107586+
"namespace": "_types"
107587+
}
107588+
}
107589+
},
107590+
{
107591+
"description": "Specifies the sort field for the requested snapshots. By default, the snapshots are sorted by their timestamp.",
107592+
"name": "sort",
107593+
"required": false,
107594+
"type": {
107595+
"kind": "instance_of",
107596+
"type": {
107597+
"name": "Field",
107598+
"namespace": "_types"
107599+
}
107600+
}
107601+
},
107602+
{
107603+
"description": "Returns snapshots with timestamps after this time.",
107604+
"name": "start",
107605+
"required": false,
107606+
"type": {
107607+
"kind": "instance_of",
107608+
"type": {
107609+
"name": "Time",
107610+
"namespace": "_types"
107611+
}
107612+
}
107613+
}
107614+
]
107563107615
},
107564107616
{
107565107617
"body": {

output/schema/validation-errors.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,6 @@
588588
],
589589
"response": []
590590
},
591-
"ml.get_model_snapshots": {
592-
"request": [
593-
"Endpoint has \"@stability: TODO"
594-
],
595-
"response": []
596-
},
597591
"ml.get_overall_buckets": {
598592
"request": [
599593
"Endpoint has \"@stability: TODO"

output/typescript/types.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ export type DateString = string
17981798

17991799
export type DefaultOperator = 'AND' | 'OR'
18001800

1801-
export interface DictionaryResponseBase<TKey = unknown, TValue = unknown> extends ResponseBase {
1801+
export interface DictionaryResponseBase<TKey = unknown, TValue = unknown> {
18021802
[key: string]: TValue
18031803
}
18041804

@@ -10315,16 +10315,16 @@ export interface MlModelSizeStats {
1031510315
}
1031610316

1031710317
export interface MlModelSnapshot {
10318-
description: string
10318+
description?: string
1031910319
job_id: Id
10320-
latest_record_time_stamp: Time
10321-
latest_result_time_stamp: Time
10322-
model_size_stats: MlModelSizeStats
10320+
latest_record_time_stamp?: Time
10321+
latest_result_time_stamp?: Time
10322+
min_version: VersionString
10323+
model_size_stats?: MlModelSizeStats
1032310324
retain: boolean
1032410325
snapshot_doc_count: long
1032510326
snapshot_id: Id
1032610327
timestamp: Time
10327-
min_version: VersionString
1032810328
}
1032910329

1033010330
export interface MlOverallBucket {
@@ -11027,12 +11027,15 @@ export interface MlGetJobsResponse {
1102711027
export interface MlGetModelSnapshotsRequest extends RequestBase {
1102811028
job_id: Id
1102911029
snapshot_id?: Id
11030+
desc?: boolean
11031+
end?: Time
11032+
from?: integer
11033+
size?: integer
11034+
sort?: Field
11035+
start?: Time
1103011036
body?: {
11031-
desc?: boolean
11032-
end?: DateString
11033-
page?: MlPage
11034-
sort?: Field
11035-
start?: DateString
11037+
start?: Time
11038+
end?: Time
1103611039
}
1103711040
}
1103811041

specification/ml/_types/ModelSnapshot.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,24 @@ import { Time } from '@_types/Time'
2323
import { ModelSizeStats } from './ModelSizeStats'
2424

2525
export class ModelSnapshot {
26-
description: string
26+
/** An optional description of the job. */
27+
description?: string
28+
/** A numerical character string that uniquely identifies the job that the snapshot was created for. */
2729
job_id: Id
28-
latest_record_time_stamp: Time
29-
latest_result_time_stamp: Time
30-
model_size_stats: ModelSizeStats
30+
/** The timestamp of the latest processed record. */
31+
latest_record_time_stamp?: Time
32+
/** The timestamp of the latest bucket result. */
33+
latest_result_time_stamp?: Time
34+
/** The minimum version required to be able to restore the model snapshot. */
35+
min_version: VersionString
36+
/** Summary information describing the model. */
37+
model_size_stats?: ModelSizeStats
38+
/** If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false. */
3139
retain: boolean
40+
/** For internal use only. */
3241
snapshot_doc_count: long
42+
/** A numerical character string that uniquely identifies the model snapshot. */
3343
snapshot_id: Id
44+
/** The creation timestamp for the snapshot. */
3445
timestamp: Time
35-
min_version: VersionString
3646
}

0 commit comments

Comments
 (0)