Skip to content

Fix ml.get_model_snapshots API #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 105 additions & 53 deletions output/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -101318,8 +101318,9 @@
},
"properties": [
{
"description": "An optional description of the job.",
"name": "description",
"required": true,
"required": false,
"type": {
"kind": "instance_of",
"type": {
Expand All @@ -101329,6 +101330,7 @@
}
},
{
"description": "A numerical character string that uniquely identifies the job that the snapshot was created for.",
"name": "job_id",
"required": true,
"type": {
Expand All @@ -101340,8 +101342,9 @@
}
},
{
"description": "The timestamp of the latest processed record.",
"name": "latest_record_time_stamp",
"required": true,
"required": false,
"type": {
"kind": "instance_of",
"type": {
Expand All @@ -101351,8 +101354,9 @@
}
},
{
"description": "The timestamp of the latest bucket result.",
"name": "latest_result_time_stamp",
"required": true,
"required": false,
"type": {
"kind": "instance_of",
"type": {
Expand All @@ -101362,8 +101366,21 @@
}
},
{
"name": "model_size_stats",
"description": "The minimum version required to be able to restore the model snapshot.",
"name": "min_version",
"required": true,
"type": {
"kind": "instance_of",
"type": {
"name": "VersionString",
"namespace": "_types"
}
}
},
{
"description": "Summary information describing the model.",
"name": "model_size_stats",
"required": false,
"type": {
"kind": "instance_of",
"type": {
Expand All @@ -101373,6 +101390,7 @@
}
},
{
"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.",
"name": "retain",
"required": true,
"type": {
Expand All @@ -101384,6 +101402,7 @@
}
},
{
"description": "For internal use only.",
"name": "snapshot_doc_count",
"required": true,
"type": {
Expand All @@ -101395,6 +101414,7 @@
}
},
{
"description": "A numerical character string that uniquely identifies the model snapshot.",
"name": "snapshot_id",
"required": true,
"type": {
Expand All @@ -101406,6 +101426,7 @@
}
},
{
"description": "The creation timestamp for the snapshot.",
"name": "timestamp",
"required": true,
"type": {
Expand All @@ -101415,17 +101436,6 @@
"namespace": "_types"
}
}
},
{
"name": "min_version",
"required": true,
"type": {
"kind": "instance_of",
"type": {
"name": "VersionString",
"namespace": "_types"
}
}
}
]
},
Expand Down Expand Up @@ -107132,56 +107142,23 @@
"kind": "properties",
"properties": [
{
"name": "desc",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "boolean",
"namespace": "internal"
}
}
},
{
"name": "end",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "DateString",
"namespace": "_types"
}
}
},
{
"name": "page",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "Page",
"namespace": "ml._types"
}
}
},
{
"name": "sort",
"name": "start",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "Field",
"name": "Time",
"namespace": "_types"
}
}
},
{
"name": "start",
"name": "end",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "DateString",
"name": "Time",
"namespace": "_types"
}
}
Expand All @@ -107201,6 +107178,7 @@
},
"path": [
{
"description": "Identifier for the anomaly detection job.",
"name": "job_id",
"required": true,
"type": {
Expand All @@ -107212,6 +107190,7 @@
}
},
{
"description": "A numerical character string that uniquely identifies the model snapshot.",
"name": "snapshot_id",
"required": false,
"type": {
Expand All @@ -107223,7 +107202,80 @@
}
}
],
"query": []
"query": [
{
"description": "If true, the results are sorted in descending order.",
"name": "desc",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "boolean",
"namespace": "internal"
}
}
},
{
"description": "Returns snapshots with timestamps earlier than this time.",
"name": "end",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "Time",
"namespace": "_types"
}
}
},
{
"description": "Skips the specified number of snapshots.",
"name": "from",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "integer",
"namespace": "_types"
}
}
},
{
"description": "Specifies the maximum number of snapshots to obtain.",
"name": "size",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "integer",
"namespace": "_types"
}
}
},
{
"description": "Specifies the sort field for the requested snapshots. By default, the snapshots are sorted by their timestamp.",
"name": "sort",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "Field",
"namespace": "_types"
}
}
},
{
"description": "Returns snapshots with timestamps after this time.",
"name": "start",
"required": false,
"type": {
"kind": "instance_of",
"type": {
"name": "Time",
"namespace": "_types"
}
}
}
]
},
{
"body": {
Expand Down
6 changes: 0 additions & 6 deletions output/schema/validation-errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,6 @@
],
"response": []
},
"ml.get_model_snapshots": {
"request": [
"Endpoint has \"@stability: TODO"
],
"response": []
},
"ml.get_overall_buckets": {
"request": [
"Endpoint has \"@stability: TODO"
Expand Down
25 changes: 14 additions & 11 deletions output/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ export type DateString = string

export type DefaultOperator = 'AND' | 'OR'

export interface DictionaryResponseBase<TKey = unknown, TValue = unknown> extends ResponseBase {
export interface DictionaryResponseBase<TKey = unknown, TValue = unknown> {
[key: string]: TValue
}

Expand Down Expand Up @@ -10293,16 +10293,16 @@ export interface MlModelSizeStats {
}

export interface MlModelSnapshot {
description: string
description?: string
job_id: Id
latest_record_time_stamp: Time
latest_result_time_stamp: Time
model_size_stats: MlModelSizeStats
latest_record_time_stamp?: Time
latest_result_time_stamp?: Time
min_version: VersionString
model_size_stats?: MlModelSizeStats
retain: boolean
snapshot_doc_count: long
snapshot_id: Id
timestamp: Time
min_version: VersionString
}

export interface MlOverallBucket {
Expand Down Expand Up @@ -10998,12 +10998,15 @@ export interface MlGetJobsResponse {
export interface MlGetModelSnapshotsRequest extends RequestBase {
job_id: Id
snapshot_id?: Id
desc?: boolean
end?: Time
from?: integer
size?: integer
sort?: Field
start?: Time
body?: {
desc?: boolean
end?: DateString
page?: MlPage
sort?: Field
start?: DateString
start?: Time
end?: Time
}
}

Expand Down
20 changes: 15 additions & 5 deletions specification/ml/_types/ModelSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,24 @@ import { Time } from '@_types/Time'
import { ModelSizeStats } from './ModelSizeStats'

export class ModelSnapshot {
description: string
/** An optional description of the job. */
description?: string
/** A numerical character string that uniquely identifies the job that the snapshot was created for. */
job_id: Id
latest_record_time_stamp: Time
latest_result_time_stamp: Time
model_size_stats: ModelSizeStats
/** The timestamp of the latest processed record. */
latest_record_time_stamp?: Time
/** The timestamp of the latest bucket result. */
latest_result_time_stamp?: Time
/** The minimum version required to be able to restore the model snapshot. */
min_version: VersionString
/** Summary information describing the model. */
model_size_stats?: ModelSizeStats
/** 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. */
retain: boolean
/** For internal use only. */
snapshot_doc_count: long
/** A numerical character string that uniquely identifies the model snapshot. */
snapshot_id: Id
/** The creation timestamp for the snapshot. */
timestamp: Time
min_version: VersionString
}
Loading