OpenSearch/docs/java-rest/high-level/ml/get-model-snapshots.asciidoc

76 lines
2.9 KiB
Plaintext

--
:api: get-model-snapshots
:request: GetModelSnapshotsRequest
:response: GetModelSnapshotsResponse
--
[id="{upid}-{api}"]
=== Get Model Snapshots API
The Get Model Snapshots API retrieves one or more model snapshot results.
It accepts a +{request}+ object and responds
with a +{response}+ object.
[id="{upid}-{api}-request"]
==== Get Model Snapshots Request
A +{request}+ object gets created with an existing non-null `jobId`.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Constructing a new request referencing an existing `jobId`
==== Optional Arguments
The following arguments are optional:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-snapshot-id]
--------------------------------------------------
<1> The id of the snapshot to get. Otherwise it will return all snapshots.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-desc]
--------------------------------------------------
<1> If `true`, the snapshots are sorted in descending order. Defaults to `false`.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-end]
--------------------------------------------------
<1> Snapshots with timestamps earlier than this time will be returned.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-sort]
--------------------------------------------------
<1> The field to sort snapshots on. Defaults to `timestamp`.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-start]
--------------------------------------------------
<1> Snapshots with timestamps on or after this time will be returned.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-page]
--------------------------------------------------
<1> The page parameters `from` and `size`. `from` specifies the number of snapshots to skip.
`size` specifies the maximum number of snapshots to retrieve. Defaults to `0` and `100` respectively.
include::../execution.asciidoc[]
[id="{upid}-{api}-response"]
==== Get Model Snapshots Response
The returned +{response}+ contains the requested snapshots:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> The count of snapshots that were matched
<2> The snapshots retrieved