diff --git a/api/api/snapshot.js b/api/api/snapshot.js index 3028779fd..85a3d706a 100644 --- a/api/api/snapshot.js +++ b/api/api/snapshot.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' } +const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'sort', 'size', 'order', 'from_sort_value', 'after', 'offset', 'slm_policy_filter', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes'] +const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', fromSortValue: 'from_sort_value', slmPolicyFilter: 'slm_policy_filter', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' } function SnapshotApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 8d26eb46d..ccd2889e8 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -2628,6 +2628,13 @@ export interface SnapshotGet extends Generic { ignore_unavailable?: boolean; index_details?: boolean; include_repository?: boolean; + sort?: 'start_time' | 'duration' | 'name' | 'repository' | 'index_count' | 'shard_count' | 'failed_shard_count'; + size?: integer; + order?: 'asc' | 'desc'; + from_sort_value?: string; + after?: string; + offset?: integer; + slm_policy_filter?: string; verbose?: boolean; } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index fe93c3d78..e40915c9b 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -3510,7 +3510,7 @@ link:{ref}/modules-scripting.html[Documentation] + ---- client.getScriptContext() ---- -link:https://www.elastic.co/guide/en/elasticsearch/painless/7.17/painless-contexts.html[Documentation] + +link:{painless}/painless-contexts.html[Documentation] + [discrete] @@ -9127,7 +9127,7 @@ client.scriptsPainlessExecute({ body: object }) ---- -link:https://www.elastic.co/guide/en/elasticsearch/painless/7.17/painless-execute-api.html[Documentation] + +link:{painless}/painless-execute-api.html[Documentation] + [cols=2*] |=== |`body` @@ -10860,6 +10860,13 @@ client.snapshot.get({ ignore_unavailable: boolean, index_details: boolean, include_repository: boolean, + sort: 'start_time' | 'duration' | 'name' | 'repository' | 'index_count' | 'shard_count' | 'failed_shard_count', + size: integer, + order: 'asc' | 'desc', + from_sort_value: string, + after: string, + offset: integer, + slm_policy_filter: string, verbose: boolean }) ---- @@ -10884,6 +10891,29 @@ link:{ref}/modules-snapshots.html[Documentation] + |`include_repository` or `includeRepository` |`boolean` - Whether to include the repository name in the snapshot info. Defaults to true. +|`sort` +|`'start_time' \| 'duration' \| 'name' \| 'repository' \| 'index_count' \| 'shard_count' \| 'failed_shard_count'` - Allows setting a sort order for the result. Defaults to start_time + +_Default:_ `start_time` + +|`size` +|`integer` - Maximum number of snapshots to return. Defaults to 0 which means return all that match without limit. + +|`order` +|`'asc' \| 'desc'` - Sort order + +_Default:_ `asc` + +|`from_sort_value` or `fromSortValue` +|`string` - Value of the current sort column at which to start retrieval. + +|`after` +|`string` - Offset identifier to start pagination from as returned by the 'next' field in the response body. + +|`offset` +|`integer` - Numeric offset to start pagination based on the snapshots matching the request. Defaults to 0 + +|`slm_policy_filter` or `slmPolicyFilter` +|`string` - Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy + |`verbose` |`boolean` - Whether to show verbose snapshot info or only show the basic info found in the repository index blob diff --git a/scripts/utils/generateDocs.js b/scripts/utils/generateDocs.js index 8d114eefa..d2e775154 100644 --- a/scripts/utils/generateDocs.js +++ b/scripts/utils/generateDocs.js @@ -282,6 +282,7 @@ function fixLink (name, str) { str = str.replace(/frozen\.html/, 'freeze-index-api.html') str = str.replace(/ml-file-structure\.html/, 'ml-find-file-structure.html') str = str.replace(/security-api-get-user-privileges\.html/, 'security-api-get-privileges.html') + str = str.replace(/^.+guide\/en\/elasticsearch\/painless\/[^/]+\/([^./]*\.html(?:#.+)?)$/, '{painless}/$1') return str }