diff --git a/api/OpenSearchApi.d.ts b/api/OpenSearchApi.d.ts index 7c2d038f8..1cb275cc6 100644 --- a/api/OpenSearchApi.d.ts +++ b/api/OpenSearchApi.d.ts @@ -655,7 +655,8 @@ export default class OpenSearchAPI { searchModels (params: API.Knn_SearchModels_Request, callback: callbackFn): TransportRequestCallback; searchModels (params: API.Knn_SearchModels_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; - trainModel (params: API.Knn_TrainModel_Request, options?: TransportRequestOptions): TransportRequestPromise; + trainModel (params?: API.Knn_TrainModel_Request, options?: TransportRequestOptions): TransportRequestPromise; + trainModel (callback: callbackFn): TransportRequestCallback; trainModel (params: API.Knn_TrainModel_Request, callback: callbackFn): TransportRequestCallback; trainModel (params: API.Knn_TrainModel_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; @@ -1344,6 +1345,42 @@ export default class OpenSearchAPI { }; + sm: { + getPolicies (params?: API.Sm_GetPolicies_Request, options?: TransportRequestOptions): TransportRequestPromise; + getPolicies (callback: callbackFn): TransportRequestCallback; + getPolicies (params: API.Sm_GetPolicies_Request, callback: callbackFn): TransportRequestCallback; + getPolicies (params: API.Sm_GetPolicies_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deletePolicy (params: API.Sm_DeletePolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + deletePolicy (params: API.Sm_DeletePolicy_Request, callback: callbackFn): TransportRequestCallback; + deletePolicy (params: API.Sm_DeletePolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getPolicy (params: API.Sm_GetPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + getPolicy (params: API.Sm_GetPolicy_Request, callback: callbackFn): TransportRequestCallback; + getPolicy (params: API.Sm_GetPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + createPolicy (params: API.Sm_CreatePolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + createPolicy (params: API.Sm_CreatePolicy_Request, callback: callbackFn): TransportRequestCallback; + createPolicy (params: API.Sm_CreatePolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + updatePolicy (params: API.Sm_UpdatePolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + updatePolicy (params: API.Sm_UpdatePolicy_Request, callback: callbackFn): TransportRequestCallback; + updatePolicy (params: API.Sm_UpdatePolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + explainPolicy (params: API.Sm_ExplainPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + explainPolicy (params: API.Sm_ExplainPolicy_Request, callback: callbackFn): TransportRequestCallback; + explainPolicy (params: API.Sm_ExplainPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + startPolicy (params: API.Sm_StartPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + startPolicy (params: API.Sm_StartPolicy_Request, callback: callbackFn): TransportRequestCallback; + startPolicy (params: API.Sm_StartPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + stopPolicy (params: API.Sm_StopPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + stopPolicy (params: API.Sm_StopPolicy_Request, callback: callbackFn): TransportRequestCallback; + stopPolicy (params: API.Sm_StopPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + snapshot: { getRepository (params?: API.Snapshot_GetRepository_Request, options?: TransportRequestOptions): TransportRequestPromise; getRepository (callback: callbackFn): TransportRequestCallback; diff --git a/api/OpenSearchApi.js b/api/OpenSearchApi.js index 1e7ca795e..bf4fc43e2 100644 --- a/api/OpenSearchApi.js +++ b/api/OpenSearchApi.js @@ -46,6 +46,7 @@ class OpenSearchAPI { rollups: new(require('./rollups/_api'))(this), searchPipeline: new(require('./searchPipeline/_api'))(this), security: new(require('./security/_api'))(this), + sm: new(require('./sm/_api'))(this), snapshot: new(require('./snapshot/_api'))(this), sql: new(require('./sql/_api'))(this), tasks: new(require('./tasks/_api'))(this), @@ -175,6 +176,7 @@ class OpenSearchAPI { rollups: { get() { return this[kApiModules].rollups } }, searchPipeline: { get() { return this[kApiModules].searchPipeline } }, security: { get() { return this[kApiModules].security } }, + sm: { get() { return this[kApiModules].sm } }, snapshot: { get() { return this[kApiModules].snapshot } }, sql: { get() { return this[kApiModules].sql } }, tasks: { get() { return this[kApiModules].tasks } }, diff --git a/api/_core/renderSearchTemplate.d.ts b/api/_core/renderSearchTemplate.d.ts index b9707247f..944b28b94 100644 --- a/api/_core/renderSearchTemplate.d.ts +++ b/api/_core/renderSearchTemplate.d.ts @@ -24,8 +24,8 @@ export type RenderSearchTemplate_Request = Global.Params & { } export type RenderSearchTemplate_RequestBody = { - file?: string; - params?: Record>; + id?: Common.Id; + params?: Record; source?: string; } diff --git a/api/_core/searchShards.d.ts b/api/_core/searchShards.d.ts index 7e55b505f..dadfeefe8 100644 --- a/api/_core/searchShards.d.ts +++ b/api/_core/searchShards.d.ts @@ -21,6 +21,7 @@ import * as Global from '../_types/_global' export type SearchShards_Request = Global.Params & { allow_no_indices?: boolean; + body?: SearchShards_RequestBody; expand_wildcards?: Common.ExpandWildcards; ignore_unavailable?: boolean; index?: Common.Indices; @@ -29,6 +30,16 @@ export type SearchShards_Request = Global.Params & { routing?: Common.RoutingInQueryString; } +export type SearchShards_RequestBody = { + _source?: boolean | string[]; + allow_partial_search_results?: boolean; + from?: number; + indices_boost?: Record; + query?: Record>; + size?: number; + sort?: Record[]; +} + export type SearchShards_Response = ApiResponse & { body: SearchShards_ResponseBody; } diff --git a/api/_core/searchShards.js b/api/_core/searchShards.js index b7ddf445f..94780a42e 100644 --- a/api/_core/searchShards.js +++ b/api/_core/searchShards.js @@ -32,6 +32,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. * @param {string} [params.index] - Returns the indexes and shards that a search request would be executed against. + * @param {object} [params.body] - Defines the parameters that can be used in the `search_shards` endpoint request. See documentation for supported query syntax. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/_core/searchTemplate.d.ts b/api/_core/searchTemplate.d.ts index e35f2bab8..32926d625 100644 --- a/api/_core/searchTemplate.d.ts +++ b/api/_core/searchTemplate.d.ts @@ -61,6 +61,7 @@ export type SearchTemplate_ResponseBody = { num_reduce_phases?: number; pit_id?: Common.Id; profile?: Core_Search.Profile; + status?: number; suggest?: Record; terminated_early?: boolean; timed_out: boolean; diff --git a/api/_types/_common.d.ts b/api/_types/_common.d.ts index aad183307..1ebab654b 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -15,6 +15,7 @@ */ import * as Cluster_AllocationExplain from './cluster.allocation_explain' +import * as Common_Mapping from './_common.mapping' import * as Common_QueryDsl from './_common.query_dsl' import * as Indices_Stats from './indices.stats' @@ -202,11 +203,19 @@ export type FieldSizeUsage = { size_in_bytes: ByteCount; } -export type FieldValue = boolean | undefined | number | Record | string +export type FieldSort = SortOrder | { + format?: string; + missing?: FieldValue; + mode?: SortMode; + nested?: NestedSortValue; + numeric_type?: FieldSortNumericType; + order?: SortOrder; + unmapped_type?: Common_Mapping.FieldType; +} -export type FieldWithDirection = Record +export type FieldSortNumericType = 'date' | 'date_nanos' | 'double' | 'long' -export type FieldWithOrder = Record +export type FieldValue = boolean | undefined | number | string export type FlushStats = { periodic: number; @@ -265,9 +274,7 @@ export type GetStats = { total: number; } -export type HealthStatus = 'green' | 'red' | 'yellow' - -export type HealthStatusCapitalized = 'GREEN' | 'RED' | 'YELLOW' +export type HealthStatus = 'green' | 'GREEN' | 'yellow' | 'YELLOW' | 'red' | 'RED' export type Host = string @@ -342,17 +349,6 @@ export type InlineScript = string | (ScriptBase & { export type Ip = string -export type KnnField = { - boost?: number; - filter?: Common_QueryDsl.QueryContainer | Common_QueryDsl.QueryContainer[]; - k?: number; - max_distance?: number; - method_parameters?: Record; - min_score?: number; - rescore?: Record; - vector: QueryVector; -} - export type LatLonGeoLocation = { lat: number; lon: number; @@ -384,7 +380,7 @@ export type Metadata = Record export type MinimumShouldMatch = number | string -export type MultiTermQueryRewrite = 'constant_score' | 'constant_score_boolean' | 'scoring_boolean' | 'top_terms_N' | 'top_terms_blended_freqs_N' | 'top_terms_boost_N' +export type MultiTermQueryRewrite = 'constant_score' | 'constant_score_boolean' | 'scoring_boolean' | string export type Name = string @@ -469,8 +465,6 @@ export type PhaseTook = { export type PipelineName = string -export type PipeSeparatedFlagsSimpleQueryStringFlag = Common_QueryDsl.SimpleQueryStringFlag | string - export type PluginStats = { classname: string; custom_foldername?: undefined | string; @@ -495,8 +489,6 @@ export type QueryCacheStats = { total_count: number; } -export type QueryVector = number[] - export type RankBase = Record export type RankContainer = { @@ -783,18 +775,16 @@ export type Slices = number | SlicesCalculation export type SlicesCalculation = 'auto' -export type Sort = SortCombinations | SortCombinations[] - -export type SortCombinations = Field | FieldWithDirection | FieldWithOrder | SortOptions +export type Sort = SortOptions | SortOptions[] export type SortMode = 'avg' | 'max' | 'median' | 'min' | 'sum' -export type SortOptions = { +export type SortOptions = '_score' | '_doc' | string | { _doc?: ScoreSort; _geo_distance?: GeoDistanceSort; _score?: ScoreSort; _script?: ScriptSort; -} +} | Record export type SortOrder = 'asc' | 'desc' diff --git a/api/_types/_common.mapping.d.ts b/api/_types/_common.mapping.d.ts index 7b327c418..2d644e924 100644 --- a/api/_types/_common.mapping.d.ts +++ b/api/_types/_common.mapping.d.ts @@ -145,6 +145,8 @@ export type FieldNamesField = { enabled: boolean; } +export type FieldType = 'aggregate_metric_double' | 'alias' | 'binary' | 'boolean' | 'byte' | 'completion' | 'constant_keyword' | 'date' | 'date_nanos' | 'date_range' | 'double' | 'double_range' | 'flat_object' | 'float' | 'float_range' | 'geo_point' | 'geo_shape' | 'half_float' | 'histogram' | 'icu_collation_keyword' | 'integer' | 'integer_range' | 'ip' | 'ip_range' | 'join' | 'keyword' | 'knn_vector' | 'long' | 'long_range' | 'match_only_text' | 'murmur3' | 'nested' | 'object' | 'percolator' | 'rank_feature' | 'rank_features' | 'scaled_float' | 'search_as_you_type' | 'short' | 'text' | 'token_count' | 'unsigned_long' | 'version' | 'wildcard' | 'xy_point' | 'xy_shape' + export type FlatObjectProperty = PropertyBase & { aggregatable?: boolean; searchable?: boolean; diff --git a/api/_types/_common.query_dsl.d.ts b/api/_types/_common.query_dsl.d.ts index 7e5a4425c..ff863eaf5 100644 --- a/api/_types/_common.query_dsl.d.ts +++ b/api/_types/_common.query_dsl.d.ts @@ -48,14 +48,14 @@ export type CombinedFieldsQuery = QueryBase & { export type CombinedFieldsZeroTerms = 'all' | 'none' -export type CommonTermsQuery = QueryBase & { +export type CommonTermsQuery = string | (QueryBase & { analyzer?: string; cutoff_frequency?: number; high_freq_operator?: Operator; low_freq_operator?: Operator; minimum_should_match?: Common.MinimumShouldMatch; query: string; -} +}) export type ConstantScoreQuery = QueryBase & { filter: QueryContainer; @@ -105,7 +105,7 @@ export type ExistsQuery = QueryBase & { field: Common.Field; } -export type FieldAndFormat = { +export type FieldAndFormat = Common.Field | { field: Common.Field; format?: string; include_unmapped?: boolean; @@ -144,14 +144,14 @@ export type FunctionScoreQuery = QueryBase & { score_mode?: FunctionScoreMode; } -export type FuzzyQuery = QueryBase & { +export type FuzzyQuery = Common.FieldValue | (QueryBase & { fuzziness?: Common.Fuzziness; max_expansions?: number; prefix_length?: number; rewrite?: Common.MultiTermQueryRewrite; transpositions?: boolean; - value: string | number | boolean; -} + value: Common.FieldValue; +}) export type GeoBoundingBoxQuery = QueryBase & { ignore_unmapped?: IgnoreUnmapped; @@ -214,6 +214,10 @@ export type HasParentQuery = QueryBase & { score?: boolean; } +export type HybridQuery = QueryBase & { + queries?: QueryContainer[]; +} + export type IdsQuery = QueryBase & { values?: Common.Ids; } @@ -292,13 +296,22 @@ export type IntervalsWildcard = { use_field?: Common.Field; } -export type KnnQuery = Record +export type KnnQuery = QueryBase & { + filter?: QueryContainer | QueryContainer[]; + k?: number; + max_distance?: number; + method_parameters?: Record; + min_score?: number; + rescore?: Record; + vector: QueryVector; +} export type Like = string | LikeDocument export type LikeDocument = { _id?: Common.Id; _index?: Common.IndexName; + _type?: Common.Type; doc?: Record; fields?: Common.Field[]; per_field_analyzer?: Record; @@ -307,9 +320,9 @@ export type LikeDocument = { version_type?: Common.VersionType; } -export type MatchAllQuery = QueryBase +export type MatchAllQuery = QueryBase & Record -export type MatchBoolPrefixQuery = QueryBase & { +export type MatchBoolPrefixQuery = string | (QueryBase & { analyzer?: string; fuzziness?: Common.Fuzziness; fuzzy_rewrite?: Common.MultiTermQueryRewrite; @@ -319,26 +332,26 @@ export type MatchBoolPrefixQuery = QueryBase & { operator?: Operator; prefix_length?: number; query: string; -} +}) export type MatchNoneQuery = QueryBase & Record -export type MatchPhrasePrefixQuery = QueryBase & { +export type MatchPhrasePrefixQuery = string | (QueryBase & { analyzer?: string; max_expansions?: number; query: string; slop?: number; zero_terms_query?: ZeroTermsQuery; -} +}) -export type MatchPhraseQuery = QueryBase & { +export type MatchPhraseQuery = string | (QueryBase & { analyzer?: string; query: string; slop?: number; zero_terms_query?: ZeroTermsQuery; -} +}) -export type MatchQuery = QueryBase & { +export type MatchQuery = Common.FieldValue | (QueryBase & { analyzer?: string; auto_generate_synonyms_phrase_query?: boolean; cutoff_frequency?: number; @@ -350,9 +363,9 @@ export type MatchQuery = QueryBase & { minimum_should_match?: Common.MinimumShouldMatch; operator?: Operator; prefix_length?: number; - query: string | number | boolean; + query: Common.FieldValue; zero_terms_query?: ZeroTermsQuery; -} +}) export type MoreLikeThisQuery = QueryBase & { analyzer?: string; @@ -406,9 +419,7 @@ export type NestedQuery = QueryBase & { score_mode?: ChildScoreMode; } -export type NeuralQuery = QueryBase & Record - -export type NeuralQueryVectorField = { +export type NeuralQuery = QueryBase & { filter?: QueryContainer; k?: number; max_distance?: number; @@ -429,7 +440,7 @@ export type NumberRangeQuery = RangeQueryBase & { export type NumericDecayFunction = DecayFunctionBase & Record -export type Operator = 'and' | 'or' +export type Operator = 'and' | 'AND' | 'or' | 'OR' export type ParentIdQuery = QueryBase & { id?: Common.Id; @@ -439,7 +450,7 @@ export type ParentIdQuery = QueryBase & { export type PercolateQuery = QueryBase & { document?: Record; - documents?: Record[]; + documents?: any[]; field: Common.Field; id?: Common.Id; index?: Common.IndexName; @@ -456,11 +467,11 @@ export type PinnedDoc = { export type PinnedQuery = QueryBase & Record -export type PrefixQuery = QueryBase & { +export type PrefixQuery = string | (QueryBase & { case_insensitive?: boolean; rewrite?: Common.MultiTermQueryRewrite; value: string; -} +}) export type QueryBase = { _name?: string; @@ -485,10 +496,11 @@ export type QueryContainer = { geo_shape?: GeoShapeQuery; has_child?: HasChildQuery; has_parent?: HasParentQuery; + hybrid?: HybridQuery; ids?: IdsQuery; intervals?: Record; - knn?: KnnQuery; - match?: Record; + knn?: Record; + match?: Record; match_all?: MatchAllQuery; match_bool_prefix?: Record; match_none?: MatchNoneQuery; @@ -497,7 +509,7 @@ export type QueryContainer = { more_like_this?: MoreLikeThisQuery; multi_match?: MultiMatchQuery; nested?: NestedQuery; - neural?: NeuralQuery; + neural?: Record; parent_id?: ParentIdQuery; percolate?: PercolateQuery; pinned?: PinnedQuery; @@ -506,7 +518,6 @@ export type QueryContainer = { range?: Record; rank_feature?: RankFeatureQuery; regexp?: Record; - rule_query?: RuleQuery; script?: ScriptQuery; script_score?: ScriptScoreQuery; simple_query_string?: SimpleQueryStringQuery; @@ -518,12 +529,10 @@ export type QueryContainer = { span_or?: SpanOrQuery; span_term?: Record; span_within?: SpanWithinQuery; - term?: Record; - terms?: TermsQueryField; + term?: Record; + terms?: TermsQuery; terms_set?: Record; - text_expansion?: Record; type?: TypeQuery; - weighted_tokens?: Record; wildcard?: Record; wrapper?: WrapperQuery; xy_shape?: XyShapeQuery; @@ -557,6 +566,8 @@ export type QueryStringQuery = QueryBase & { type?: TextQueryType; } +export type QueryVector = number[] + export type RandomScoreFunction = { field?: Common.Field; seed?: number | string; @@ -595,19 +606,13 @@ export type RankFeatureQuery = QueryBase & { sigmoid?: RankFeatureFunctionSigmoid; } -export type RegexpQuery = QueryBase & { +export type RegexpQuery = string | (QueryBase & { case_insensitive?: boolean; flags?: string; max_determinized_states?: number; rewrite?: Common.MultiTermQueryRewrite; value: string; -} - -export type RuleQuery = QueryBase & { - match_criteria: Record; - organic: QueryContainer; - ruleset_id: Common.Id; -} +}) export type ScriptQuery = QueryBase & { script: Common.Script; @@ -625,7 +630,7 @@ export type ScriptScoreQuery = QueryBase & { export type SimpleQueryStringFlag = 'ALL' | 'AND' | 'ESCAPE' | 'FUZZY' | 'NEAR' | 'NONE' | 'NOT' | 'OR' | 'PHRASE' | 'PRECEDENCE' | 'PREFIX' | 'SLOP' | 'WHITESPACE' -export type SimpleQueryStringFlags = Common.PipeSeparatedFlagsSimpleQueryStringFlag +export type SimpleQueryStringFlags = SimpleQueryStringFlag | string export type SimpleQueryStringQuery = QueryBase & { analyze_wildcard?: boolean; @@ -695,67 +700,53 @@ export type SpanQuery = { span_within?: SpanWithinQuery; } -export type SpanTermQuery = QueryBase & { +export type SpanTermQuery = string | (QueryBase & { value: string; -} +}) export type SpanWithinQuery = QueryBase & { big: SpanQuery; little: SpanQuery; } -export type TermQuery = QueryBase & { +export type TermQuery = Common.FieldValue | (QueryBase & { case_insensitive?: boolean; value: Common.FieldValue; -} +}) -export type TermsLookupField = { +export type TermsLookup = { id?: Common.Id; index?: Common.IndexName; path?: Common.Field; routing?: Common.Routing; } -export type TermsQueryField = { - boost?: number; - [key: string]: any | TermsLookupField | string[]; +export type TermsQuery = QueryBase & { + _name?: any; + boost?: any; + [key: string]: any | TermsQueryField; } +export type TermsQueryField = Common.FieldValue[] | TermsLookup + export type TermsSetQuery = QueryBase & { minimum_should_match_field?: Common.Field; minimum_should_match_script?: Common.Script; terms: string[]; } -export type TextExpansionQuery = QueryBase & { - model_id: string; - model_text: string; - pruning_config?: TokenPruningConfig; -} - export type TextQueryType = 'best_fields' | 'bool_prefix' | 'cross_fields' | 'most_fields' | 'phrase' | 'phrase_prefix' -export type TokenPruningConfig = { - only_score_pruned_tokens?: boolean; - tokens_freq_ratio_threshold?: number; - tokens_weight_threshold?: number; -} - export type TypeQuery = QueryBase & { value: string; } -export type WeightedTokensQuery = QueryBase & { - pruning_config?: TokenPruningConfig; - tokens: Record; -} - -export type WildcardQuery = QueryBase & { +export type WildcardQuery = string | (QueryBase & { case_insensitive?: boolean; rewrite?: Common.MultiTermQueryRewrite; value?: string; wildcard?: string; -} +}) export type WrapperQuery = QueryBase & { query: string; diff --git a/api/_types/_core.rank_eval.d.ts b/api/_types/_core.rank_eval.d.ts index 643dbf6af..b91048923 100644 --- a/api/_types/_core.rank_eval.d.ts +++ b/api/_types/_core.rank_eval.d.ts @@ -27,6 +27,7 @@ export type RankEvalHit = { _id: Common.Id; _index: Common.IndexName; _score: number; + _type?: Common.Type; } export type RankEvalHitItem = { @@ -48,7 +49,7 @@ export type RankEvalMetricBase = { export type RankEvalMetricDetail = { hits: RankEvalHitItem[]; - metric_details: Record>>; + metric_details: Record>; metric_score: number; unrated_docs: UnratedDocument[]; } diff --git a/api/_types/_core.search.d.ts b/api/_types/_core.search.d.ts index 76f322fbe..fcbd4cc77 100644 --- a/api/_types/_core.search.d.ts +++ b/api/_types/_core.search.d.ts @@ -84,7 +84,7 @@ export type AggregationProfileDelegateDebugFilter = { export type BoundaryScanner = 'chars' | 'sentence' | 'word' -export type BuiltinHighlighterType = 'fvh' | 'plain' | 'unified' +export type BuiltinHighlighterType = 'plain' | 'fvh' | 'unified' export type Collector = { children?: Collector[]; @@ -154,11 +154,12 @@ export type HighlightBase = { boundary_scanner?: BoundaryScanner; boundary_scanner_locale?: string; force_source?: boolean; + fragment_offset?: number; fragment_size?: number; fragmenter?: HighlighterFragmenter; highlight_filter?: boolean; highlight_query?: Common_QueryDsl.QueryContainer; - max_analyzed_offset?: number; + max_analyzer_offset?: number; max_fragment_length?: number; no_match_size?: number; number_of_fragments?: number; @@ -184,7 +185,6 @@ export type HighlighterType = BuiltinHighlighterType | string export type HighlightField = HighlightBase & { analyzer?: Common_Analysis.Analyzer; - fragment_offset?: number; matched_fields?: Common.Fields; } @@ -231,7 +231,7 @@ export type InnerHits = { seq_no_primary_term?: boolean; size?: number; sort?: Common.Sort; - stored_field?: Common.Fields; + stored_fields?: Common.Fields; track_scores?: boolean; version?: boolean; } @@ -340,11 +340,11 @@ export type ShardProfile = { searches: SearchProfile[]; } -export type SourceConfig = boolean | Common.Field[] | SourceFilter +export type SourceConfig = boolean | SourceFilter export type SourceConfigParam = boolean | Common.Fields -export type SourceFilter = { +export type SourceFilter = Common.Fields | { excludes?: Common.Fields; includes?: Common.Fields; } diff --git a/api/_types/indices._common.d.ts b/api/_types/indices._common.d.ts index 3ed165d95..e9961154b 100644 --- a/api/_types/indices._common.d.ts +++ b/api/_types/indices._common.d.ts @@ -48,7 +48,7 @@ export type DataStream = { next_generation_managed_by?: ManagedBy; prefer_ilm?: boolean; replicated?: boolean; - status: Common.HealthStatusCapitalized; + status: Common.HealthStatus; system?: boolean; template: Common.Name; timestamp_field: DataStreamTimestampField; @@ -62,6 +62,14 @@ export type DataStreamIndex = { prefer_ilm?: boolean; } +export type DataStreamStats = { + backing_indices: number; + data_stream: Common.Name; + maximum_timestamp: Common.EpochTimeUnitMillis; + store_size?: Common.HumanReadableByteCount; + store_size_bytes: Common.ByteCount; +} + export type DataStreamTimestampField = { name: Common.Field; } @@ -90,6 +98,13 @@ export type IndexErrorCause = { [key: string]: any | Record; } +export type IndexGetUpgradeStatus = { + indices?: Record; + size_in_bytes?: Common.ByteCount; + size_to_upgrade_ancient_in_bytes?: Common.ByteCount; + size_to_upgrade_in_bytes?: Common.ByteCount; +} + export type IndexingPressure = { memory: IndexingPressureMemory; } @@ -109,6 +124,11 @@ export type IndexingSlowlogThresholds = { index?: SlowlogThresholdLevels; } +export type IndexPostUpgradeStatus = { + _shards?: Common.ShardStatistics; + upgraded_indices?: Record; +} + export type IndexRouting = { allocation?: IndexRoutingAllocation; rebalance?: IndexRoutingRebalance; @@ -569,7 +589,7 @@ export type TemplateMapping = { index_patterns: Common.Name[]; mappings: Common_Mapping.TypeMapping; order: number; - settings: Record>; + settings: Record; version?: Common.VersionNumber; } @@ -588,3 +608,21 @@ export type TranslogRetention = { size?: Common.HumanReadableByteCount; } +export type UpgradeRequest = { + allow_no_indices?: boolean; + expand_wildcards?: 'all' | 'closed' | 'none' | 'open'; + ignore_unavailable?: boolean; + wait_for_completion?: boolean; +} + +export type UpgradeStatus = { + size_in_bytes?: Common.ByteCount; + size_to_upgrade_ancient_in_bytes?: Common.ByteCount; + size_to_upgrade_in_bytes?: Common.ByteCount; +} + +export type UpgradeVersionStatus = { + oldest_lucene_segment_version?: Common.VersionString; + upgrade_version?: Common.VersionString; +} + diff --git a/api/_types/indices.shard_stores.d.ts b/api/_types/indices.shard_stores.d.ts index 709265e90..21bc61ea2 100644 --- a/api/_types/indices.shard_stores.d.ts +++ b/api/_types/indices.shard_stores.d.ts @@ -24,6 +24,7 @@ export type ShardStore = { allocation: ShardStoreAllocation; allocation_id?: Common.Id; store_exception?: ShardStoreException; + [key: string]: any | Common.NodeAttributes; } export type ShardStoreAllocation = 'primary' | 'replica' | 'unused' diff --git a/api/_types/knn._common.d.ts b/api/_types/knn._common.d.ts index 2528f6ddc..f96885325 100644 --- a/api/_types/knn._common.d.ts +++ b/api/_types/knn._common.d.ts @@ -14,10 +14,93 @@ * modify the API generator. */ +import * as Common from './_common' export type DefaultOperator = 'AND' | 'OR' +export type DeletedModel = { + model_id: string; + result: 'deleted' | 'error'; +} + +export type GraphMergeStats = { + current?: number; + current_docs?: number; + current_size_in_bytes?: Common.ByteCount; + total?: number; + total_docs?: number; + total_size_in_bytes?: Common.ByteCount; + total_time_in_millis?: Common.DurationValueUnitMillis; +} + +export type GraphRefreshStats = { + total?: number; + total_time_in_millis?: Common.DurationValueUnitMillis; +} + +export type GraphStats = { + merge?: GraphMergeStats; + refresh?: GraphRefreshStats; +} + +export type NodeStats = { + cache_capacity_reached?: boolean; + eviction_count?: number; + faiss_initialized?: boolean; + graph_index_errors?: number; + graph_index_requests?: number; + graph_memory_usage?: number; + graph_memory_usage_percentage?: Common.PercentageNumber; + graph_query_errors?: number; + graph_query_requests?: number; + graph_stats?: GraphStats; + hit_count?: number; + indexing_from_model_degraded?: boolean; + indices_in_cache?: Record; + knn_query_requests?: number; + knn_query_with_filter_requests?: number; + load_exception_count?: number; + load_success_count?: number; + lucene_initialized?: boolean; + max_distance_query_requests?: number; + max_distance_query_with_filter_requests?: number; + min_score_query_requests?: number; + min_score_query_with_filter_requests?: number; + miss_count?: number; + nmslib_initialized?: boolean; + script_compilation_errors?: number; + script_compilations?: number; + script_query_errors?: number; + script_query_requests?: number; + total_load_time?: number; + training_errors?: number; + training_memory_usage?: number; + training_memory_usage_percentage?: Common.PercentageNumber; + training_requests?: number; +} + export type SearchType = 'dfs_query_then_fetch' | 'query_then_fetch' +export type Stats = { + _nodes?: Common.NodeStatistics; + circuit_breaker_triggered?: boolean; + cluster_name?: Common.Name; + model_index_status?: Common.HealthStatus | undefined; + nodes?: Record; +} + export type SuggestMode = 'always' | 'missing' | 'popular' +export type TrainedModel = { + compression_level?: string; + description?: string; + dimension: number; + max_training_vector_count?: number; + method?: string; + mode?: string; + search_size?: number; + spaceType?: string; + training_field: string; + training_index: string; +} + diff --git a/api/_types/ml._common.d.ts b/api/_types/ml._common.d.ts index ce15892ce..f6d3eb46a 100644 --- a/api/_types/ml._common.d.ts +++ b/api/_types/ml._common.d.ts @@ -36,17 +36,6 @@ export type ClientConfig = { retry_timeout_seconds?: number; } -export type CreateConnectorRequest = { - actions: Action[]; - client_config?: ClientConfig; - credential: Credential; - description: string; - name: string; - parameters: Parameters; - protocol: string; - version: number; -} - export type Credential = { access_key?: string; secret_key?: string; @@ -96,17 +85,6 @@ export type ModelGroupRegistration = { export type Parameters = Record -export type RegisterAgentsRequest = { - app_type?: string; - description?: string; - llm?: LLM; - memory?: Memory; - name: string; - parameters?: Parameters; - tools?: ToolItems[]; - type: string; -} - export type SearchModelsHits = { hits: SearchModelsHitsHit[]; max_score?: number; @@ -124,11 +102,6 @@ export type SearchModelsHitsHit = { model_id?: Common.Name; } -export type SearchModelsQuery = { - query: Record; - size: number; -} - export type SearchModelsResponse = { _shards?: Common.ShardStatistics; hits: SearchModelsHits; diff --git a/api/_types/nodes.info.d.ts b/api/_types/nodes.info.d.ts index 111d4d47a..b939f1815 100644 --- a/api/_types/nodes.info.d.ts +++ b/api/_types/nodes.info.d.ts @@ -271,7 +271,7 @@ export type NodeInfoSettingsNode = { name: Common.Name; } -export type NodeInfoSettingsPlugins = Record +export type NodeInfoSettingsPlugins = Record export type NodeInfoSettingsTransport = { type: string; diff --git a/api/_types/observability._common.d.ts b/api/_types/observability._common.d.ts index a885d7928..b9cb072b7 100644 --- a/api/_types/observability._common.d.ts +++ b/api/_types/observability._common.d.ts @@ -33,7 +33,7 @@ export type ObservabilityObject = { operationalPanel?: OperationalPanel; savedQuery?: SavedQuery; savedVisualization?: SavedVisualization; - tenant: string; + tenant?: string; } export type ObservabilityObjectList = { diff --git a/api/_types/rollups._common.d.ts b/api/_types/rollups._common.d.ts index f8321fc23..f5768ca4b 100644 --- a/api/_types/rollups._common.d.ts +++ b/api/_types/rollups._common.d.ts @@ -14,14 +14,7 @@ * modify the API generator. */ - -export type Continuous = { - failure_reason?: string; - next_window_end_time?: number; - next_window_start_time?: number; - stats?: Stats; - status?: string; -} +import * as Common from './_common' export type Cron = { expression?: string; @@ -31,6 +24,7 @@ export type Cron = { export type DateHistogramDimension = { calendar_interval?: string; fixed_interval?: string; + format?: undefined | string; source_field?: string; target_field?: string; timezone?: string; @@ -43,14 +37,11 @@ export type DimensionsConfigItem = { } export type Explain = { - continuous?: Continuous; - last_updated_time?: number; - rollup_id?: string; + metadata_id?: undefined | string; + rollup_metadata?: undefined | Record; } -export type ExplainEntities = { - item?: Explain; -} +export type ExplainEntities = Record export type HistogramDimension = { interval?: string; @@ -89,7 +80,7 @@ export type Rollup = { enabled_time?: number; error_notification?: string; last_updated_time?: number; - metadata_id?: string; + metadata_id?: undefined | string; metrics?: MetricsConfigItem[]; page_size?: number; rollup_id?: string; @@ -100,9 +91,10 @@ export type Rollup = { } export type RollupEntity = { - _id?: string; - _primaryTerm?: number; - _seqNo?: number; + _id?: Common.Id; + _primary_term?: number; + _seq_no?: Common.SequenceNumber; + _version?: Common.VersionNumber; rollup?: Rollup; } @@ -110,14 +102,6 @@ export type Schedule = { interval?: Interval; } -export type Stats = { - documents_processed?: number; - index_time_in_ms?: number; - pages_processed?: number; - rollups_indexed?: number; - search_time_in_ms?: number; -} - export type TermsDimension = { source_field?: string; target_field?: string; diff --git a/api/_types/sm._common.d.ts b/api/_types/sm._common.d.ts new file mode 100644 index 000000000..a3547ab33 --- /dev/null +++ b/api/_types/sm._common.d.ts @@ -0,0 +1,198 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + + +export type BadRequestResponse = { + error?: string; + status?: number; +} + +export type CreateUpdatePolicyRequest = { + creation: CreationConfig; + deletion?: DeletionConfig; + description?: string; + enabled?: boolean; + notification?: NotificationConfig; + snapshot_config: SnapshotConfig; +} + +export type CreationConfig = { + schedule: CronSchedule; + time_limit?: string; +} + +export type CronExpression = { + expression: string; + timezone: string; +} + +export type CronSchedule = { + cron?: CronExpression; +} + +export type DeletePolicyResponse = { + _id: string; + _index: string; + _primary_term: number; + _seq_no: number; + _shards: ShardsInfo; + _version: number; + forced_refresh: boolean; + result: string; +} + +export type DeletionCondition = { + max_age?: string; + max_count?: number; + min_count?: number; +} + +export type DeletionConfig = { + condition?: DeletionCondition; + schedule?: CronSchedule; + time_limit?: string; +} + +export type ExecutionInfo = { + cause?: string; + message?: string; +} + +export type ExecutionMetadata = { + info?: ExecutionInfo; +} + +export type ExplainedPolicy = { + creation?: StateMetadata; + deletion?: StateMetadata; + enabled?: boolean; + name?: string; + policy_primary_term?: number; + policy_seq_no?: number; +} + +export type GetPoliciesResponse = { + policies: ListedPolicy[]; + total_policies: number; +} + +export type IntervalConfig = { + period: number; + start_time: number; + unit: 'Days' | 'Hours' | 'Minutes'; +} + +export type IntervalSchedule = { + interval?: IntervalConfig; +} + +export type ListedPolicy = { + _id: string; + _primary_term?: number; + _seq_no?: number; + sm_policy: SMPolicy; +} + +export type NotFoundError = { + reason: string; + root_cause?: RootCause[]; + type: string; +} + +export type NotFoundResponse = { + error: NotFoundError; + status: number; +} + +export type NotificationChannel = { + id: string; +} + +export type NotificationConditions = { + creation?: boolean; + deletion?: boolean; + failure?: boolean; + time_limit_exceeded?: boolean; +} + +export type NotificationConfig = { + channel?: NotificationChannel; + conditions?: NotificationConditions; +} + +export type PolicyExplanation = { + policies?: ExplainedPolicy[]; +} + +export type PolicyResponse = { + _id: string; + _primary_term: number; + _seq_no: number; + _version: number; + sm_policy: SMPolicy; +} + +export type RetryMetadata = { + count?: number; +} + +export type RootCause = { + reason?: string; + type?: string; +} + +export type ShardsInfo = { + failed?: number; + successful?: number; + total?: number; +} + +export type SMPolicy = { + creation: CreationConfig; + deletion?: DeletionConfig; + description: string; + enabled?: boolean; + enabled_time?: number; + last_updated_time?: number; + name: string; + notification?: NotificationConfig; + schedule?: IntervalSchedule; + schema_version?: number; + snapshot_config: SnapshotConfig; +} + +export type SnapshotConfig = { + date_format?: string; + ignore_unavailable?: boolean; + include_global_state?: boolean; + indices?: string; + metadata?: Record; + partial?: boolean; + repository: string; + timezone?: string; +} + +export type StateMetadata = { + current_state?: string; + latest_execution?: ExecutionMetadata; + retry?: RetryMetadata; + trigger?: TriggerMetadata; +} + +export type TriggerMetadata = { + time?: number; +} + diff --git a/api/_types/snapshot._common.d.ts b/api/_types/snapshot._common.d.ts index 8b89a33ed..e152a75d0 100644 --- a/api/_types/snapshot._common.d.ts +++ b/api/_types/snapshot._common.d.ts @@ -29,39 +29,15 @@ export type Repository = { export type RepositorySettings = { chunk_size?: string; - compress?: string | boolean; - concurrent_streams?: string | number; + compress?: Common.StringifiedBoolean; + concurrent_streams?: Common.StringifiedInteger; location: string; - read_only?: string | boolean; -} - -export type ShardsStats = { - done: number; - failed: number; - finalizing: number; - initializing: number; - started: number; - total: number; -} - -export type ShardsStatsStage = 'DONE' | 'FAILURE' | 'FINALIZE' | 'INIT' | 'STARTED' - -export type ShardsStatsSummary = { - incremental: ShardsStatsSummaryItem; - start_time_in_millis: Common.EpochTimeUnitMillis; - time?: Common.Duration; - time_in_millis: Common.DurationValueUnitMillis; - total: ShardsStatsSummaryItem; -} - -export type ShardsStatsSummaryItem = { - file_count: number; - size_in_bytes: Common.ByteCount; + read_only?: Common.StringifiedBoolean; } export type SnapshotIndexStats = { shards: Record; - shards_stats: ShardsStats; + shards_stats: SnapshotShardsStats; stats: SnapshotStats; } @@ -96,24 +72,52 @@ export type SnapshotShardFailure = { status: string; } +export type SnapshotShardsStats = { + done: number; + failed: number; + finalizing: number; + initializing: number; + started: number; + total: number; +} + +export type SnapshotShardsStatsStage = 'DONE' | 'FAILURE' | 'FINALIZE' | 'INIT' | 'STARTED' + +export type SnapshotShardsStatsSummary = { + incremental: SnapshotShardsStatsSummaryItem; + processed?: SnapshotShardsStatsSummaryItem; + start_time_in_millis: Common.EpochTimeUnitMillis; + time?: Common.Duration; + time_in_millis: Common.DurationValueUnitMillis; + total: SnapshotShardsStatsSummaryItem; +} + +export type SnapshotShardsStatsSummaryItem = { + file_count: number; + size_in_bytes: Common.ByteCount; +} + export type SnapshotShardsStatus = { - stage: ShardsStatsStage; - stats: ShardsStatsSummary; + node?: Common.NodeId; + reason?: string; + stage: SnapshotShardsStatsStage; + stats: SnapshotShardsStatsSummary; } export type SnapshotStats = { incremental: FileCountSnapshotStats; + processed?: FileCountSnapshotStats; start_time_in_millis: Common.EpochTimeUnitMillis; time?: Common.Duration; time_in_millis: Common.DurationValueUnitMillis; total: FileCountSnapshotStats; } -export type Status = { - include_global_state: boolean; +export type SnapshotStatus = { + include_global_state?: boolean; indices: Record; repository: string; - shards_stats: ShardsStats; + shards_stats: SnapshotShardsStats; snapshot: string; state: string; stats: SnapshotStats; diff --git a/api/_types/transforms._common.d.ts b/api/_types/transforms._common.d.ts index 8d11f01d7..956526f6f 100644 --- a/api/_types/transforms._common.d.ts +++ b/api/_types/transforms._common.d.ts @@ -14,6 +14,7 @@ * modify the API generator. */ +import * as Common from './_common' import * as Common_QueryDsl from './_common.query_dsl' export type ContinuousStats = { @@ -29,9 +30,32 @@ export type DateHistogramGroup = { timezone?: string; } +export type DeletedTransformResponse = { + _id: Common.Id; + _index: string; + _primary_term: number; + _seq_no: Common.SequenceNumber; + _shards: Common.ShardStatistics; + _type?: Common.Type; + _version: Common.VersionNumber; + forced_refresh: boolean; + result: string; + status: number; +} + +export type DeleteTransformResponseItem = { + delete?: DeletedTransformResponse; +} + +export type DeleteTransformsResponse = { + errors?: boolean; + items?: DeleteTransformResponseItem[]; + took?: number; +} + export type Explain = { - metadata_id?: string; - transform_metadata?: TransformMetadata; + metadata_id?: undefined | string; + transform_metadata?: TransformMetadata | undefined; } export type ExplainResponse = Record @@ -56,20 +80,6 @@ export type HistogramGroup = { target_field?: string; } -export type MetricsConfigItem = { - metrics?: MetricsConfigMetrics[]; - source_field?: string; - target_field?: string; -} - -export type MetricsConfigMetrics = { - avg?: Record; - max?: Record; - min?: Record; - sum?: Record; - value_count?: Record; -} - export type Preview = { documents?: Record[]; } @@ -90,14 +100,14 @@ export type TermsGroup = { } export type Transform = { - aggregations?: MetricsConfigItem[]; + aggregations?: Record; continuous?: boolean; data_selection_query?: Common_QueryDsl.QueryContainer; description?: string; enabled?: boolean; - enabled_at?: number; + enabled_at?: undefined | number; groups?: GroupsConfigItem[]; - metadata_id?: string; + metadata_id?: undefined | string; page_size?: number; roles?: string[]; schedule?: Schedule; @@ -105,14 +115,7 @@ export type Transform = { source_index?: string; target_index?: string; transform_id?: string; - updated_at?: string; -} - -export type TransformEntity = { - _id?: string; - _primaryTerm?: number; - _seqNo?: number; - transform?: Transform; + updated_at?: number; } export type TransformMetadata = { @@ -124,8 +127,20 @@ export type TransformMetadata = { transform_id?: string; } +export type TransformRequest = { + transform: Transform; +} + +export type TransformResponse = { + _id?: Common.Id; + _primary_term?: number; + _seq_no?: Common.SequenceNumber; + _version?: Common.VersionNumber; + transform?: Transform; +} + export type TransformsResponse = { total_transforms?: number; - transforms?: TransformEntity[]; + transforms?: TransformResponse[]; } diff --git a/api/cat/aliases.js b/api/cat/aliases.js index 70b435d9f..1b3bdef26 100644 --- a/api/cat/aliases.js +++ b/api/cat/aliases.js @@ -25,13 +25,13 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Cat * * @param {object} [params] - * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indexes that are open, closed or both. - * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). - * @param {array} [params.h] - Comma-separated list of column names to display. - * @param {boolean} [params.help=false] - Return help information. - * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. - * @param {boolean} [params.v=false] - Verbose mode. Display column headers. + * @param {string} [params.expand_wildcards] - Expands wildcard expressions to concrete indexes. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. + * @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`. + * @param {array} [params.h] - A comma-separated list of column names to display. + * @param {boolean} [params.help=false] - Returns help information. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by. + * @param {boolean} [params.v=false] - Enables verbose mode, which displays column headers. * @param {string} [params.name] - A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/cat/allocation.js b/api/cat/allocation.js index f6ca84172..a371eef64 100644 --- a/api/cat/allocation.js +++ b/api/cat/allocation.js @@ -25,16 +25,16 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Cat * * @param {object} [params] - * @param {string} [params.bytes] - The unit used to display byte values. - * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). - * @param {array} [params.h] - Comma-separated list of column names to display. - * @param {boolean} [params.help=false] - Return help information. - * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. - * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. - * @param {boolean} [params.v=false] - Verbose mode. Display column headers. - * @param {string} [params.node_id] - Comma-separated list of node identifiers or names used to limit the returned information. + * @param {string} [params.bytes] - The units used to display byte values. + * @param {string} [params.cluster_manager_timeout] - A timeout for connection to the cluster manager node. + * @param {string} [params.format] - A short version of the HTTP `Accept` header, such as `json` or `yaml`. + * @param {array} [params.h] - A comma-separated list of column names to display. + * @param {boolean} [params.help=false] - Returns help information. + * @param {boolean} [params.local=false] - Returns local information but does not retrieve the state from cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - A timeout for connection to the cluster manager node. + * @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by. + * @param {boolean} [params.v=false] - Enables verbose mode, which displays column headers. + * @param {string} [params.node_id] - A comma-separated list of node IDs or names used to limit the returned information. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/cat/clusterManager.js b/api/cat/clusterManager.js index 9973f3000..e82c62ed5 100644 --- a/api/cat/clusterManager.js +++ b/api/cat/clusterManager.js @@ -25,14 +25,14 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Cat * * @param {object} [params] - * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). - * @param {array} [params.h] - Comma-separated list of column names to display. + * @param {string} [params.cluster_manager_timeout] - A timeout for connection to the cluster manager node. + * @param {string} [params.format] - A short version of the HTTP `Accept` header, such as `json` or `yaml`. + * @param {array} [params.h] - A comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. - * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. - * @param {boolean} [params.v=false] - Verbose mode. Display column headers. + * @param {string} [params.master_timeout] DEPRECATED - A timeout for connection to the cluster manager node. + * @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by. + * @param {boolean} [params.v=false] - Enables verbose mode, which displays column headers. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/cat/snapshots.js b/api/cat/snapshots.js index 6343bf7c4..e7b2b068f 100644 --- a/api/cat/snapshots.js +++ b/api/cat/snapshots.js @@ -31,10 +31,10 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.ignore_unavailable=false] - If `true`, the response does not include information from unavailable snapshots. * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. + * @param {string} [params.repository] - A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. `_all` returns all repositories. If any repository fails during the request, OpenSearch returns an error. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit in which to display time values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. - * @param {string} [params.repository] - A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. `_all` returns all repositories. If any repository fails during the request, OpenSearch returns an error. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/index.d.ts b/api/index.d.ts index a5e82f4d8..a06fd28a6 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -36,7 +36,7 @@ import { GetScript_Request, GetScript_Response, GetScript_ResponseBody } from '. import { PutScript_Request, PutScript_RequestBody, PutScript_Response, PutScript_ResponseBody } from './_core/putScript'; import { ScriptsPainlessExecute_Request, ScriptsPainlessExecute_RequestBody, ScriptsPainlessExecute_Response, ScriptsPainlessExecute_ResponseBody } from './_core/scriptsPainlessExecute'; import { Search_Request, Search_RequestBody, Search_Response, Search_ResponseBody } from './_core/search'; -import { SearchShards_Request, SearchShards_Response, SearchShards_ResponseBody } from './_core/searchShards'; +import { SearchShards_Request, SearchShards_RequestBody, SearchShards_Response, SearchShards_ResponseBody } from './_core/searchShards'; import { DeletePit_Request, DeletePit_RequestBody, DeletePit_Response, DeletePit_ResponseBody } from './_core/deletePit'; import { DeleteAllPits_Request, DeleteAllPits_Response, DeleteAllPits_ResponseBody } from './_core/deleteAllPits'; import { GetAllPits_Request, GetAllPits_Response, GetAllPits_ResponseBody } from './_core/getAllPits'; @@ -271,19 +271,19 @@ import { Ism_RetryIndex_Request, Ism_RetryIndex_Response, Ism_RetryIndex_Respons import { Ism_RefreshSearchAnalyzers_Request, Ism_RefreshSearchAnalyzers_Response, Ism_RefreshSearchAnalyzers_ResponseBody } from './ism/refreshSearchAnalyzers'; import { Knn_Stats_Request, Knn_Stats_Response, Knn_Stats_ResponseBody } from './knn/stats'; import { Knn_SearchModels_Request, Knn_SearchModels_RequestBody, Knn_SearchModels_Response, Knn_SearchModels_ResponseBody } from './knn/searchModels'; -import { Knn_TrainModel_Request, Knn_TrainModel_RequestBody, Knn_TrainModel_Response, Knn_TrainModel_ResponseBody } from './knn/trainModel'; +import { Knn_TrainModel_Request, Knn_TrainModel_Response, Knn_TrainModel_ResponseBody } from './knn/trainModel'; import { Knn_DeleteModel_Request, Knn_DeleteModel_Response, Knn_DeleteModel_ResponseBody } from './knn/deleteModel'; import { Knn_GetModel_Request, Knn_GetModel_Response, Knn_GetModel_ResponseBody } from './knn/getModel'; import { Knn_Warmup_Request, Knn_Warmup_Response, Knn_Warmup_ResponseBody } from './knn/warmup'; -import { Ml_RegisterAgents_Request, Ml_RegisterAgents_Response, Ml_RegisterAgents_ResponseBody } from './ml/registerAgents'; +import { Ml_RegisterAgents_Request, Ml_RegisterAgents_RequestBody, Ml_RegisterAgents_Response, Ml_RegisterAgents_ResponseBody } from './ml/registerAgents'; import { Ml_DeleteAgent_Request, Ml_DeleteAgent_Response, Ml_DeleteAgent_ResponseBody } from './ml/deleteAgent'; -import { Ml_CreateConnector_Request, Ml_CreateConnector_Response, Ml_CreateConnector_ResponseBody } from './ml/createConnector'; +import { Ml_CreateConnector_Request, Ml_CreateConnector_RequestBody, Ml_CreateConnector_Response, Ml_CreateConnector_ResponseBody } from './ml/createConnector'; import { Ml_DeleteConnector_Request, Ml_DeleteConnector_Response, Ml_DeleteConnector_ResponseBody } from './ml/deleteConnector'; import { Ml_RegisterModelGroup_Request, Ml_RegisterModelGroup_RequestBody, Ml_RegisterModelGroup_Response, Ml_RegisterModelGroup_ResponseBody } from './ml/registerModelGroup'; import { Ml_DeleteModelGroup_Request, Ml_DeleteModelGroup_Response, Ml_DeleteModelGroup_ResponseBody } from './ml/deleteModelGroup'; import { Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_ResponseBody } from './ml/getModelGroup'; import { Ml_RegisterModel_Request, Ml_RegisterModel_RequestBody, Ml_RegisterModel_Response, Ml_RegisterModel_ResponseBody } from './ml/registerModel'; -import { Ml_SearchModels_Request, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody } from './ml/searchModels'; +import { Ml_SearchModels_Request, Ml_SearchModels_RequestBody, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody } from './ml/searchModels'; import { Ml_DeleteModel_Request, Ml_DeleteModel_Response, Ml_DeleteModel_ResponseBody } from './ml/deleteModel'; import { Ml_DeployModel_Request, Ml_DeployModel_Response, Ml_DeployModel_ResponseBody } from './ml/deployModel'; import { Ml_UndeployModel_Request, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody } from './ml/undeployModel'; @@ -337,8 +337,16 @@ import { Rollups_Put_Request, Rollups_Put_Response, Rollups_Put_ResponseBody } f import { Rollups_Explain_Request, Rollups_Explain_Response, Rollups_Explain_ResponseBody } from './rollups/explain'; import { Rollups_Start_Request, Rollups_Start_Response, Rollups_Start_ResponseBody } from './rollups/start'; import { Rollups_Stop_Request, Rollups_Stop_Response, Rollups_Stop_ResponseBody } from './rollups/stop'; +import { Sm_GetPolicies_Request, Sm_GetPolicies_Response, Sm_GetPolicies_ResponseBody } from './sm/getPolicies'; +import { Sm_DeletePolicy_Request, Sm_DeletePolicy_Response, Sm_DeletePolicy_ResponseBody } from './sm/deletePolicy'; +import { Sm_GetPolicy_Request, Sm_GetPolicy_Response, Sm_GetPolicy_ResponseBody } from './sm/getPolicy'; +import { Sm_CreatePolicy_Request, Sm_CreatePolicy_Response, Sm_CreatePolicy_ResponseBody } from './sm/createPolicy'; +import { Sm_UpdatePolicy_Request, Sm_UpdatePolicy_Response, Sm_UpdatePolicy_ResponseBody } from './sm/updatePolicy'; +import { Sm_ExplainPolicy_Request, Sm_ExplainPolicy_Response, Sm_ExplainPolicy_ResponseBody } from './sm/explainPolicy'; +import { Sm_StartPolicy_Request, Sm_StartPolicy_Response, Sm_StartPolicy_ResponseBody } from './sm/startPolicy'; +import { Sm_StopPolicy_Request, Sm_StopPolicy_Response, Sm_StopPolicy_ResponseBody } from './sm/stopPolicy'; import { Transforms_Search_Request, Transforms_Search_Response, Transforms_Search_ResponseBody } from './transforms/search'; -import { Transforms_Preview_Request, Transforms_Preview_RequestBody, Transforms_Preview_Response, Transforms_Preview_ResponseBody } from './transforms/preview'; +import { Transforms_Preview_Request, Transforms_Preview_Response, Transforms_Preview_ResponseBody } from './transforms/preview'; import { Transforms_Delete_Request, Transforms_Delete_Response, Transforms_Delete_ResponseBody } from './transforms/delete'; import { Transforms_Get_Request, Transforms_Get_Response, Transforms_Get_ResponseBody } from './transforms/get'; import { Transforms_Put_Request, Transforms_Put_Response, Transforms_Put_ResponseBody } from './transforms/put'; @@ -391,7 +399,7 @@ export { PutScript_Request, PutScript_RequestBody, PutScript_Response, PutScript_ResponseBody, ScriptsPainlessExecute_Request, ScriptsPainlessExecute_RequestBody, ScriptsPainlessExecute_Response, ScriptsPainlessExecute_ResponseBody, Search_Request, Search_RequestBody, Search_Response, Search_ResponseBody, - SearchShards_Request, SearchShards_Response, SearchShards_ResponseBody, + SearchShards_Request, SearchShards_RequestBody, SearchShards_Response, SearchShards_ResponseBody, DeletePit_Request, DeletePit_RequestBody, DeletePit_Response, DeletePit_ResponseBody, DeleteAllPits_Request, DeleteAllPits_Response, DeleteAllPits_ResponseBody, GetAllPits_Request, GetAllPits_Response, GetAllPits_ResponseBody, @@ -626,19 +634,19 @@ export { Ism_RefreshSearchAnalyzers_Request, Ism_RefreshSearchAnalyzers_Response, Ism_RefreshSearchAnalyzers_ResponseBody, Knn_Stats_Request, Knn_Stats_Response, Knn_Stats_ResponseBody, Knn_SearchModels_Request, Knn_SearchModels_RequestBody, Knn_SearchModels_Response, Knn_SearchModels_ResponseBody, - Knn_TrainModel_Request, Knn_TrainModel_RequestBody, Knn_TrainModel_Response, Knn_TrainModel_ResponseBody, + Knn_TrainModel_Request, Knn_TrainModel_Response, Knn_TrainModel_ResponseBody, Knn_DeleteModel_Request, Knn_DeleteModel_Response, Knn_DeleteModel_ResponseBody, Knn_GetModel_Request, Knn_GetModel_Response, Knn_GetModel_ResponseBody, Knn_Warmup_Request, Knn_Warmup_Response, Knn_Warmup_ResponseBody, - Ml_RegisterAgents_Request, Ml_RegisterAgents_Response, Ml_RegisterAgents_ResponseBody, + Ml_RegisterAgents_Request, Ml_RegisterAgents_RequestBody, Ml_RegisterAgents_Response, Ml_RegisterAgents_ResponseBody, Ml_DeleteAgent_Request, Ml_DeleteAgent_Response, Ml_DeleteAgent_ResponseBody, - Ml_CreateConnector_Request, Ml_CreateConnector_Response, Ml_CreateConnector_ResponseBody, + Ml_CreateConnector_Request, Ml_CreateConnector_RequestBody, Ml_CreateConnector_Response, Ml_CreateConnector_ResponseBody, Ml_DeleteConnector_Request, Ml_DeleteConnector_Response, Ml_DeleteConnector_ResponseBody, Ml_RegisterModelGroup_Request, Ml_RegisterModelGroup_RequestBody, Ml_RegisterModelGroup_Response, Ml_RegisterModelGroup_ResponseBody, Ml_DeleteModelGroup_Request, Ml_DeleteModelGroup_Response, Ml_DeleteModelGroup_ResponseBody, Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_ResponseBody, Ml_RegisterModel_Request, Ml_RegisterModel_RequestBody, Ml_RegisterModel_Response, Ml_RegisterModel_ResponseBody, - Ml_SearchModels_Request, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody, + Ml_SearchModels_Request, Ml_SearchModels_RequestBody, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody, Ml_DeleteModel_Request, Ml_DeleteModel_Response, Ml_DeleteModel_ResponseBody, Ml_DeployModel_Request, Ml_DeployModel_Response, Ml_DeployModel_ResponseBody, Ml_UndeployModel_Request, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody, @@ -692,8 +700,16 @@ export { Rollups_Explain_Request, Rollups_Explain_Response, Rollups_Explain_ResponseBody, Rollups_Start_Request, Rollups_Start_Response, Rollups_Start_ResponseBody, Rollups_Stop_Request, Rollups_Stop_Response, Rollups_Stop_ResponseBody, + Sm_GetPolicies_Request, Sm_GetPolicies_Response, Sm_GetPolicies_ResponseBody, + Sm_DeletePolicy_Request, Sm_DeletePolicy_Response, Sm_DeletePolicy_ResponseBody, + Sm_GetPolicy_Request, Sm_GetPolicy_Response, Sm_GetPolicy_ResponseBody, + Sm_CreatePolicy_Request, Sm_CreatePolicy_Response, Sm_CreatePolicy_ResponseBody, + Sm_UpdatePolicy_Request, Sm_UpdatePolicy_Response, Sm_UpdatePolicy_ResponseBody, + Sm_ExplainPolicy_Request, Sm_ExplainPolicy_Response, Sm_ExplainPolicy_ResponseBody, + Sm_StartPolicy_Request, Sm_StartPolicy_Response, Sm_StartPolicy_ResponseBody, + Sm_StopPolicy_Request, Sm_StopPolicy_Response, Sm_StopPolicy_ResponseBody, Transforms_Search_Request, Transforms_Search_Response, Transforms_Search_ResponseBody, - Transforms_Preview_Request, Transforms_Preview_RequestBody, Transforms_Preview_Response, Transforms_Preview_ResponseBody, + Transforms_Preview_Request, Transforms_Preview_Response, Transforms_Preview_ResponseBody, Transforms_Delete_Request, Transforms_Delete_Response, Transforms_Delete_ResponseBody, Transforms_Get_Request, Transforms_Get_Response, Transforms_Get_ResponseBody, Transforms_Put_Request, Transforms_Put_Response, Transforms_Put_ResponseBody, diff --git a/api/indices/dataStreamsStats.d.ts b/api/indices/dataStreamsStats.d.ts index 441cae05a..3fdd4d1ad 100644 --- a/api/indices/dataStreamsStats.d.ts +++ b/api/indices/dataStreamsStats.d.ts @@ -17,7 +17,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' import * as Global from '../_types/_global' -import * as Indices_DataStreamsStats from '../_types/indices.data_streams_stats' +import * as Indices_Common from '../_types/indices._common' export type Indices_DataStreamsStats_Request = Global.Params & { name?: Common.Indices; @@ -31,8 +31,8 @@ export type Indices_DataStreamsStats_ResponseBody = { _shards: Common.ShardStatistics; backing_indices: number; data_stream_count: number; - data_streams: Indices_DataStreamsStats.DataStreamsStatsItem[]; + data_streams: Indices_Common.DataStreamStats[]; + total_store_size?: Common.HumanReadableByteCount; total_store_size_bytes: Common.ByteCount; - total_store_sizes?: Common.HumanReadableByteCount; } diff --git a/api/indices/getUpgrade.d.ts b/api/indices/getUpgrade.d.ts index 9c2c48e04..d97be6142 100644 --- a/api/indices/getUpgrade.d.ts +++ b/api/indices/getUpgrade.d.ts @@ -17,6 +17,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' import * as Global from '../_types/_global' +import * as Indices_Common from '../_types/indices._common' export type Indices_GetUpgrade_Request = Global.Params & { allow_no_indices?: boolean; @@ -29,5 +30,5 @@ export type Indices_GetUpgrade_Response = ApiResponse & { body: Indices_GetUpgrade_ResponseBody; } -export type Indices_GetUpgrade_ResponseBody = Record +export type Indices_GetUpgrade_ResponseBody = Indices_Common.IndexGetUpgradeStatus diff --git a/api/indices/putTemplate.d.ts b/api/indices/putTemplate.d.ts index 38800a810..16a1cf735 100644 --- a/api/indices/putTemplate.d.ts +++ b/api/indices/putTemplate.d.ts @@ -34,7 +34,7 @@ export type Indices_PutTemplate_RequestBody = { index_patterns?: string | string[]; mappings?: Common_Mapping.TypeMapping; order?: number; - settings?: Record>; + settings?: Record; version?: Common.VersionNumber; } diff --git a/api/indices/upgrade.d.ts b/api/indices/upgrade.d.ts index 270812137..761ee9eea 100644 --- a/api/indices/upgrade.d.ts +++ b/api/indices/upgrade.d.ts @@ -17,9 +17,11 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' import * as Global from '../_types/_global' +import * as Indices_Common from '../_types/indices._common' export type Indices_Upgrade_Request = Global.Params & { allow_no_indices?: boolean; + body?: Indices_Common.UpgradeRequest; expand_wildcards?: Common.ExpandWildcards; ignore_unavailable?: boolean; index?: string[]; @@ -31,5 +33,5 @@ export type Indices_Upgrade_Response = ApiResponse & { body: Indices_Upgrade_ResponseBody; } -export type Indices_Upgrade_ResponseBody = Record +export type Indices_Upgrade_ResponseBody = Indices_Common.IndexPostUpgradeStatus diff --git a/api/indices/upgrade.js b/api/indices/upgrade.js index 43b18cb47..59aec09d1 100644 --- a/api/indices/upgrade.js +++ b/api/indices/upgrade.js @@ -31,6 +31,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.only_ancient_segments] - If `true`, only ancient (an older Lucene major release) segments will be upgraded. * @param {boolean} [params.wait_for_completion=false] - Should this request wait until the operation has completed before returning. * @param {array} [params.index] - Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. + * @param {object} [params.body] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/knn/deleteModel.d.ts b/api/knn/deleteModel.d.ts index 56b870133..a478fb756 100644 --- a/api/knn/deleteModel.d.ts +++ b/api/knn/deleteModel.d.ts @@ -16,6 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Knn_Common from '../_types/knn._common' export type Knn_DeleteModel_Request = Global.Params & { model_id: string; @@ -25,5 +26,5 @@ export type Knn_DeleteModel_Response = ApiResponse & { body: Knn_DeleteModel_ResponseBody; } -export type Knn_DeleteModel_ResponseBody = Record +export type Knn_DeleteModel_ResponseBody = Knn_Common.DeletedModel diff --git a/api/knn/searchModels.d.ts b/api/knn/searchModels.d.ts index 795d445fc..61353bdfe 100644 --- a/api/knn/searchModels.d.ts +++ b/api/knn/searchModels.d.ts @@ -16,6 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' +import * as Core_Search from '../_types/_core.search' import * as Global from '../_types/_global' import * as Knn_Common from '../_types/knn._common' @@ -71,5 +72,5 @@ export type Knn_SearchModels_Response = ApiResponse & { body: Knn_SearchModels_ResponseBody; } -export type Knn_SearchModels_ResponseBody = Record +export type Knn_SearchModels_ResponseBody = Core_Search.ResponseBody diff --git a/api/knn/stats.d.ts b/api/knn/stats.d.ts index dc875e8e9..058eae7f0 100644 --- a/api/knn/stats.d.ts +++ b/api/knn/stats.d.ts @@ -17,10 +17,11 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' import * as Global from '../_types/_global' +import * as Knn_Common from '../_types/knn._common' export type Knn_Stats_Request = Global.Params & { node_id?: string[]; - stat?: 'cache_capacity_reached' | 'circuit_breaker_triggered' | 'eviction_count' | 'faiss_initialized' | 'graph_index_errors' | 'graph_index_requests' | 'graph_memory_usage' | 'graph_memory_usage_percentage' | 'graph_query_errors' | 'graph_query_requests' | 'hit_count' | 'indexing_from_model_degraded' | 'indices_in_cache' | 'knn_query_requests' | 'load_exception_count' | 'load_success_count' | 'miss_count' | 'model_index_status' | 'nmslib_initialized' | 'script_compilation_errors' | 'script_compilations' | 'script_query_errors' | 'script_query_requests' | 'total_load_time' | 'training_errors' | 'training_memory_usage' | 'training_memory_usage_percentage' | 'training_requests'[]; + stat?: 'cache_capacity_reached' | 'circuit_breaker_triggered' | 'eviction_count' | 'faiss_initialized' | 'graph_index_errors' | 'graph_index_requests' | 'graph_memory_usage' | 'graph_memory_usage_percentage' | 'graph_query_errors' | 'graph_query_requests' | 'graph_stats' | 'hit_count' | 'indexing_from_model_degraded' | 'indices_in_cache' | 'knn_query_requests' | 'knn_query_with_filter_requests' | 'load_exception_count' | 'load_success_count' | 'lucene_initialized' | 'max_distance_query_requests' | 'max_distance_query_with_filter_requests' | 'min_score_query_requests' | 'min_score_query_with_filter_requests' | 'miss_count' | 'model_index_status' | 'nmslib_initialized' | 'script_compilation_errors' | 'script_compilations' | 'script_query_errors' | 'script_query_requests' | 'total_load_time' | 'training_errors' | 'training_memory_usage' | 'training_memory_usage_percentage' | 'training_requests'[]; timeout?: Common.Duration; } @@ -28,5 +29,5 @@ export type Knn_Stats_Response = ApiResponse & { body: Knn_Stats_ResponseBody; } -export type Knn_Stats_ResponseBody = Record +export type Knn_Stats_ResponseBody = Knn_Common.Stats diff --git a/api/knn/trainModel.d.ts b/api/knn/trainModel.d.ts index 00605c507..894c507b2 100644 --- a/api/knn/trainModel.d.ts +++ b/api/knn/trainModel.d.ts @@ -16,26 +16,14 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Knn_Common from '../_types/knn._common' export type Knn_TrainModel_Request = Global.Params & { - body: Knn_TrainModel_RequestBody; + body?: Knn_Common.TrainedModel; model_id?: string; preference?: string; } -export type Knn_TrainModel_RequestBody = { - compression_level?: string; - description?: string; - dimension: number; - max_training_vector_count?: number; - method?: string; - mode?: string; - search_size?: number; - spaceType?: string; - training_field: string; - training_index: string; -} - export type Knn_TrainModel_Response = ApiResponse & { body: Knn_TrainModel_ResponseBody; } diff --git a/api/knn/trainModel.js b/api/knn/trainModel.js index 6ab3df677..ea09211c8 100644 --- a/api/knn/trainModel.js +++ b/api/knn/trainModel.js @@ -16,7 +16,7 @@ 'use strict'; -const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); +const { normalizeArguments, parsePathParam } = require('../utils'); /** * Create and train a model that can be used for initializing k-NN native library indexes during indexing. @@ -24,10 +24,10 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @memberOf API-Knn * - * @param {object} params + * @param {object} [params] * @param {string} [params.preference] - Preferred node to execute training. * @param {string} [params.model_id] - The id of the model. - * @param {object} params.body + * @param {object} [params.body] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response @@ -36,13 +36,13 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u */ function trainModelFunc(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); - if (params.body == null) return handleMissingParam('body', this, callback); let { body, model_id, ...querystring } = params; model_id = parsePathParam(model_id); const path = ['/_plugins/_knn/models', model_id, '_train'].filter(c => c != null).join('/'); const method = 'POST'; + body = body || ''; return this.transport.request({ method, path, querystring, body }, options, callback); } diff --git a/api/knn/warmup.d.ts b/api/knn/warmup.d.ts index 82481761a..c91a6b055 100644 --- a/api/knn/warmup.d.ts +++ b/api/knn/warmup.d.ts @@ -15,6 +15,7 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' export type Knn_Warmup_Request = Global.Params & { @@ -25,5 +26,5 @@ export type Knn_Warmup_Response = ApiResponse & { body: Knn_Warmup_ResponseBody; } -export type Knn_Warmup_ResponseBody = Record +export type Knn_Warmup_ResponseBody = Common.ShardsOperationResponseBase diff --git a/api/ml/createConnector.d.ts b/api/ml/createConnector.d.ts index 7a8f66e66..1f64964b4 100644 --- a/api/ml/createConnector.d.ts +++ b/api/ml/createConnector.d.ts @@ -19,7 +19,18 @@ import * as Global from '../_types/_global' import * as Ml_Common from '../_types/ml._common' export type Ml_CreateConnector_Request = Global.Params & { - body?: Ml_Common.CreateConnectorRequest; + body?: Ml_CreateConnector_RequestBody; +} + +export type Ml_CreateConnector_RequestBody = { + actions: Ml_Common.Action[]; + client_config?: Ml_Common.ClientConfig; + credential: Ml_Common.Credential; + description: string; + name: string; + parameters: Ml_Common.Parameters; + protocol: string; + version: number; } export type Ml_CreateConnector_Response = ApiResponse & { diff --git a/api/ml/registerAgents.d.ts b/api/ml/registerAgents.d.ts index d049cbf62..6bee74726 100644 --- a/api/ml/registerAgents.d.ts +++ b/api/ml/registerAgents.d.ts @@ -19,7 +19,18 @@ import * as Global from '../_types/_global' import * as Ml_Common from '../_types/ml._common' export type Ml_RegisterAgents_Request = Global.Params & { - body?: Ml_Common.RegisterAgentsRequest; + body?: Ml_RegisterAgents_RequestBody; +} + +export type Ml_RegisterAgents_RequestBody = { + app_type?: string; + description?: string; + llm?: Ml_Common.LLM; + memory?: Ml_Common.Memory; + name: string; + parameters?: Ml_Common.Parameters; + tools?: Ml_Common.ToolItems[]; + type: string; } export type Ml_RegisterAgents_Response = ApiResponse & { diff --git a/api/ml/searchModels.d.ts b/api/ml/searchModels.d.ts index 1b45d244b..8c0f6c3cf 100644 --- a/api/ml/searchModels.d.ts +++ b/api/ml/searchModels.d.ts @@ -19,7 +19,12 @@ import * as Global from '../_types/_global' import * as Ml_Common from '../_types/ml._common' export type Ml_SearchModels_Request = Global.Params & { - body?: Ml_Common.SearchModelsQuery; + body?: Ml_SearchModels_RequestBody; +} + +export type Ml_SearchModels_RequestBody = { + query: Record; + size: number; } export type Ml_SearchModels_Response = ApiResponse & { diff --git a/api/observability/getLocalstats.d.ts b/api/observability/getLocalstats.d.ts index 99d97e88d..aeadfe72a 100644 --- a/api/observability/getLocalstats.d.ts +++ b/api/observability/getLocalstats.d.ts @@ -23,5 +23,5 @@ export type Observability_GetLocalstats_Response = ApiResponse & { body: Observability_GetLocalstats_ResponseBody; } -export type Observability_GetLocalstats_ResponseBody = string +export type Observability_GetLocalstats_ResponseBody = Record diff --git a/api/observability/getLocalstats.js b/api/observability/getLocalstats.js index 2a617cbdf..8e3094789 100644 --- a/api/observability/getLocalstats.js +++ b/api/observability/getLocalstats.js @@ -19,7 +19,7 @@ const { normalizeArguments } = require('../utils'); /** - * Retrieves Local Stats of all observability objects. + * Retrieves local stats of all observability objects. *
See Also: {@link undefined - observability.get_localstats} * * @memberOf API-Observability diff --git a/api/rollups/delete.d.ts b/api/rollups/delete.d.ts index 1911d06b4..7d5b299d9 100644 --- a/api/rollups/delete.d.ts +++ b/api/rollups/delete.d.ts @@ -26,5 +26,5 @@ export type Rollups_Delete_Response = ApiResponse & { body: Rollups_Delete_ResponseBody; } -export type Rollups_Delete_ResponseBody = Record +export type Rollups_Delete_ResponseBody = Common.WriteResponseBase diff --git a/api/rollups/start.d.ts b/api/rollups/start.d.ts index cafdb554f..302663272 100644 --- a/api/rollups/start.d.ts +++ b/api/rollups/start.d.ts @@ -26,5 +26,5 @@ export type Rollups_Start_Response = ApiResponse & { body: Rollups_Start_ResponseBody; } -export type Rollups_Start_ResponseBody = Record +export type Rollups_Start_ResponseBody = Common.AcknowledgedResponseBase diff --git a/api/rollups/stop.d.ts b/api/rollups/stop.d.ts index fd77ca176..0ea4853ef 100644 --- a/api/rollups/stop.d.ts +++ b/api/rollups/stop.d.ts @@ -26,5 +26,5 @@ export type Rollups_Stop_Response = ApiResponse & { body: Rollups_Stop_ResponseBody; } -export type Rollups_Stop_ResponseBody = Record +export type Rollups_Stop_ResponseBody = Common.AcknowledgedResponseBase diff --git a/api/sm/_api.js b/api/sm/_api.js new file mode 100644 index 000000000..9baf008e8 --- /dev/null +++ b/api/sm/_api.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +/** @namespace API-Sm */ + +function SmApi(bindObj) { + this.createPolicy = require('./createPolicy').bind(bindObj); + this.deletePolicy = require('./deletePolicy').bind(bindObj); + this.explainPolicy = require('./explainPolicy').bind(bindObj); + this.getPolicies = require('./getPolicies').bind(bindObj); + this.getPolicy = require('./getPolicy').bind(bindObj); + this.startPolicy = require('./startPolicy').bind(bindObj); + this.stopPolicy = require('./stopPolicy').bind(bindObj); + this.updatePolicy = require('./updatePolicy').bind(bindObj); + + // Deprecated: Use createPolicy instead. + this.create_policy = require('./createPolicy').bind(bindObj); + // Deprecated: Use deletePolicy instead. + this.delete_policy = require('./deletePolicy').bind(bindObj); + // Deprecated: Use explainPolicy instead. + this.explain_policy = require('./explainPolicy').bind(bindObj); + // Deprecated: Use getPolicies instead. + this.get_policies = require('./getPolicies').bind(bindObj); + // Deprecated: Use getPolicy instead. + this.get_policy = require('./getPolicy').bind(bindObj); + // Deprecated: Use startPolicy instead. + this.start_policy = require('./startPolicy').bind(bindObj); + // Deprecated: Use stopPolicy instead. + this.stop_policy = require('./stopPolicy').bind(bindObj); + // Deprecated: Use updatePolicy instead. + this.update_policy = require('./updatePolicy').bind(bindObj); +} + +module.exports = SmApi; diff --git a/api/sm/createPolicy.d.ts b/api/sm/createPolicy.d.ts new file mode 100644 index 000000000..d252949e7 --- /dev/null +++ b/api/sm/createPolicy.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Sm_Common from '../_types/sm._common' + +export type Sm_CreatePolicy_Request = Global.Params & { + body?: Sm_Common.CreateUpdatePolicyRequest; + policy_name: string; +} + +export type Sm_CreatePolicy_Response = ApiResponse & { + body: Sm_CreatePolicy_ResponseBody; +} + +export type Sm_CreatePolicy_ResponseBody = Sm_Common.PolicyResponse + diff --git a/api/sm/createPolicy.js b/api/sm/createPolicy.js new file mode 100644 index 000000000..743622121 --- /dev/null +++ b/api/sm/createPolicy.js @@ -0,0 +1,50 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Creates a snapshot management policy. + *
See Also: {@link undefined - sm.create_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {string} params.policy_name - The name of the snapshot management policy. + * @param {object} [params.body] + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function createPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createPolicyFunc; diff --git a/api/sm/deletePolicy.d.ts b/api/sm/deletePolicy.d.ts new file mode 100644 index 000000000..4534f08ab --- /dev/null +++ b/api/sm/deletePolicy.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Sm_Common from '../_types/sm._common' + +export type Sm_DeletePolicy_Request = Global.Params & { + policy_name: string; +} + +export type Sm_DeletePolicy_Response = ApiResponse & { + body: Sm_DeletePolicy_ResponseBody; +} + +export type Sm_DeletePolicy_ResponseBody = Sm_Common.DeletePolicyResponse + diff --git a/api/sm/deletePolicy.js b/api/sm/deletePolicy.js new file mode 100644 index 000000000..e9cffb4d9 --- /dev/null +++ b/api/sm/deletePolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Deletes a snapshot management policy. + *
See Also: {@link undefined - sm.delete_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {string} params.policy_name - The name of the snapshot management policy. + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function deletePolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deletePolicyFunc; diff --git a/api/sm/explainPolicy.d.ts b/api/sm/explainPolicy.d.ts new file mode 100644 index 000000000..2376f1475 --- /dev/null +++ b/api/sm/explainPolicy.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Sm_Common from '../_types/sm._common' + +export type Sm_ExplainPolicy_Request = Global.Params & { + policy_name: string; +} + +export type Sm_ExplainPolicy_Response = ApiResponse & { + body: Sm_ExplainPolicy_ResponseBody; +} + +export type Sm_ExplainPolicy_ResponseBody = Sm_Common.PolicyExplanation + diff --git a/api/sm/explainPolicy.js b/api/sm/explainPolicy.js new file mode 100644 index 000000000..665f7ef8e --- /dev/null +++ b/api/sm/explainPolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Explains the state of the snapshot management policy. + *
See Also: {@link undefined - sm.explain_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {string} params.policy_name - The name of the snapshot management policy. + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function explainPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name + '/_explain'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = explainPolicyFunc; diff --git a/api/sm/getPolicies.d.ts b/api/sm/getPolicies.d.ts new file mode 100644 index 000000000..6b3f6ffc2 --- /dev/null +++ b/api/sm/getPolicies.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Sm_Common from '../_types/sm._common' + +export type Sm_GetPolicies_Request = Global.Params & { + from?: number; + queryString?: string; + size?: number; + sortField?: string; + sortOrder?: 'asc' | 'desc'; +} + +export type Sm_GetPolicies_Response = ApiResponse & { + body: Sm_GetPolicies_ResponseBody; +} + +export type Sm_GetPolicies_ResponseBody = Sm_Common.GetPoliciesResponse + diff --git a/api/sm/getPolicies.js b/api/sm/getPolicies.js new file mode 100644 index 000000000..a485d2d37 --- /dev/null +++ b/api/sm/getPolicies.js @@ -0,0 +1,51 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Retrieves all snapshot management policies with optional pagination and filtering. + *
See Also: {@link undefined - sm.get_policies} + * + * @memberOf API-Sm + * + * @param {object} [params] + * @param {number} [params.from] - The starting index (default: 0) + * @param {string} [params.queryString] - A query string to filter policies. + * @param {number} [params.size] - The number of policies to return. + * @param {string} [params.sortField] - The field to sort on. + * @param {string} [params.sortOrder=asc] - The order of sorting. + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function getPoliciesFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_sm/policies'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getPoliciesFunc; diff --git a/api/sm/getPolicy.d.ts b/api/sm/getPolicy.d.ts new file mode 100644 index 000000000..05663733e --- /dev/null +++ b/api/sm/getPolicy.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Sm_Common from '../_types/sm._common' + +export type Sm_GetPolicy_Request = Global.Params & { + policy_name: string; +} + +export type Sm_GetPolicy_Response = ApiResponse & { + body: Sm_GetPolicy_ResponseBody; +} + +export type Sm_GetPolicy_ResponseBody = Sm_Common.PolicyResponse + diff --git a/api/sm/getPolicy.js b/api/sm/getPolicy.js new file mode 100644 index 000000000..57f9d72a9 --- /dev/null +++ b/api/sm/getPolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Retrieves a specific snapshot management policy by name. + *
See Also: {@link undefined - sm.get_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {string} params.policy_name - The name of the snapshot management policy. + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function getPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getPolicyFunc; diff --git a/api/sm/startPolicy.d.ts b/api/sm/startPolicy.d.ts new file mode 100644 index 000000000..15d9fc628 --- /dev/null +++ b/api/sm/startPolicy.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' + +export type Sm_StartPolicy_Request = Global.Params & { + policy_name: string; +} + +export type Sm_StartPolicy_Response = ApiResponse & { + body: Sm_StartPolicy_ResponseBody; +} + +export type Sm_StartPolicy_ResponseBody = { + acknowledged?: boolean; +} + diff --git a/api/sm/startPolicy.js b/api/sm/startPolicy.js new file mode 100644 index 000000000..7405c747f --- /dev/null +++ b/api/sm/startPolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Starts a snapshot management policy. + *
See Also: {@link undefined - sm.start_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {string} params.policy_name - The name of the snapshot management policy. + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function startPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name + '/_start'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = startPolicyFunc; diff --git a/api/_types/indices.data_streams_stats.d.ts b/api/sm/stopPolicy.d.ts similarity index 55% rename from api/_types/indices.data_streams_stats.d.ts rename to api/sm/stopPolicy.d.ts index 5fed9a19e..2897ea8d0 100644 --- a/api/_types/indices.data_streams_stats.d.ts +++ b/api/sm/stopPolicy.d.ts @@ -14,13 +14,18 @@ * modify the API generator. */ -import * as Common from './_common' +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' -export type DataStreamsStatsItem = { - backing_indices: number; - data_stream: Common.Name; - maximum_timestamp: Common.EpochTimeUnitMillis; - store_size?: Common.HumanReadableByteCount; - store_size_bytes: Common.ByteCount; +export type Sm_StopPolicy_Request = Global.Params & { + policy_name: string; +} + +export type Sm_StopPolicy_Response = ApiResponse & { + body: Sm_StopPolicy_ResponseBody; +} + +export type Sm_StopPolicy_ResponseBody = { + acknowledged?: boolean; } diff --git a/api/sm/stopPolicy.js b/api/sm/stopPolicy.js new file mode 100644 index 000000000..2af80f358 --- /dev/null +++ b/api/sm/stopPolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Stops a snapshot management policy. + *
See Also: {@link undefined - sm.stop_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {string} params.policy_name - The name of the snapshot management policy. + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function stopPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name + '/_stop'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = stopPolicyFunc; diff --git a/api/sm/updatePolicy.d.ts b/api/sm/updatePolicy.d.ts new file mode 100644 index 000000000..a8120908f --- /dev/null +++ b/api/sm/updatePolicy.d.ts @@ -0,0 +1,33 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Sm_Common from '../_types/sm._common' + +export type Sm_UpdatePolicy_Request = Global.Params & { + body?: Sm_Common.CreateUpdatePolicyRequest; + if_primary_term: number; + if_seq_no: number; + policy_name: string; +} + +export type Sm_UpdatePolicy_Response = ApiResponse & { + body: Sm_UpdatePolicy_ResponseBody; +} + +export type Sm_UpdatePolicy_ResponseBody = Sm_Common.PolicyResponse + diff --git a/api/sm/updatePolicy.js b/api/sm/updatePolicy.js new file mode 100644 index 000000000..c78d0c12e --- /dev/null +++ b/api/sm/updatePolicy.js @@ -0,0 +1,54 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Updates an existing snapshot management policy. Requires `if_seq_no` and `if_primary_term`. + *
See Also: {@link undefined - sm.update_policy} + * + * @memberOf API-Sm + * + * @param {object} params + * @param {number} params.if_primary_term - The primary term of the policy to update. + * @param {number} params.if_seq_no - The sequence number of the policy to update. + * @param {string} params.policy_name - The name of the snapshot management policy. + * @param {object} [params.body] + * + * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ +function updatePolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.if_primary_term == null) return handleMissingParam('if_primary_term', this, callback); + if (params.if_seq_no == null) return handleMissingParam('if_seq_no', this, callback); + if (params.policy_name == null) return handleMissingParam('policy_name', this, callback); + + let { body, policy_name, ...querystring } = params; + policy_name = parsePathParam(policy_name); + + const path = '/_plugins/_sm/policies/' + policy_name; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = updatePolicyFunc; diff --git a/api/snapshot/status.d.ts b/api/snapshot/status.d.ts index 99215850e..35baf3004 100644 --- a/api/snapshot/status.d.ts +++ b/api/snapshot/status.d.ts @@ -32,6 +32,6 @@ export type Snapshot_Status_Response = ApiResponse & { } export type Snapshot_Status_ResponseBody = { - snapshots: Snapshot_Common.Status[]; + snapshots: Snapshot_Common.SnapshotStatus[]; } diff --git a/api/transforms/delete.d.ts b/api/transforms/delete.d.ts index 464e639be..cb112f3ad 100644 --- a/api/transforms/delete.d.ts +++ b/api/transforms/delete.d.ts @@ -17,6 +17,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' import * as Global from '../_types/_global' +import * as Transforms_Common from '../_types/transforms._common' export type Transforms_Delete_Request = Global.Params & { id: Common.Id; @@ -26,5 +27,5 @@ export type Transforms_Delete_Response = ApiResponse & { body: Transforms_Delete_ResponseBody; } -export type Transforms_Delete_ResponseBody = Record +export type Transforms_Delete_ResponseBody = Transforms_Common.DeleteTransformsResponse diff --git a/api/transforms/get.d.ts b/api/transforms/get.d.ts index 864f062ae..0864050eb 100644 --- a/api/transforms/get.d.ts +++ b/api/transforms/get.d.ts @@ -27,5 +27,5 @@ export type Transforms_Get_Response = ApiResponse & { body: Transforms_Get_ResponseBody; } -export type Transforms_Get_ResponseBody = Transforms_Common.TransformEntity +export type Transforms_Get_ResponseBody = Transforms_Common.TransformResponse diff --git a/api/transforms/preview.d.ts b/api/transforms/preview.d.ts index 04289a841..a099c7d30 100644 --- a/api/transforms/preview.d.ts +++ b/api/transforms/preview.d.ts @@ -19,11 +19,7 @@ import * as Global from '../_types/_global' import * as Transforms_Common from '../_types/transforms._common' export type Transforms_Preview_Request = Global.Params & { - body?: Transforms_Preview_RequestBody; -} - -export type Transforms_Preview_RequestBody = { - transform: Transforms_Common.Transform; + body?: Transforms_Common.TransformRequest; } export type Transforms_Preview_Response = ApiResponse & { diff --git a/api/transforms/put.d.ts b/api/transforms/put.d.ts index 57d5dd5d7..37490f912 100644 --- a/api/transforms/put.d.ts +++ b/api/transforms/put.d.ts @@ -20,7 +20,7 @@ import * as Global from '../_types/_global' import * as Transforms_Common from '../_types/transforms._common' export type Transforms_Put_Request = Global.Params & { - body?: Transforms_Common.Transform; + body?: Transforms_Common.TransformRequest; id: Common.Id; if_primary_term?: number; if_seq_no?: Common.SequenceNumber; @@ -30,5 +30,5 @@ export type Transforms_Put_Response = ApiResponse & { body: Transforms_Put_ResponseBody; } -export type Transforms_Put_ResponseBody = Transforms_Common.TransformEntity +export type Transforms_Put_ResponseBody = Transforms_Common.TransformResponse