From aba68d50384055d52af27b7b46782496dced3906 Mon Sep 17 00:00:00 2001 From: nhtruong <644650+nhtruong@users.noreply.github.com> Date: Sun, 15 Jun 2025 00:12:41 +0000 Subject: [PATCH] Updated opensearch-js to reflect the latest OpenSearch API spec (2025-06-15) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- api/OpenSearchApi.d.ts | 142 +++++++ api/OpenSearchApi.js | 8 + api/_core/bulk.d.ts | 2 +- api/_core/bulk.js | 2 +- api/_core/bulkStream.js | 2 +- api/_core/count.js | 2 +- api/_core/create.js | 2 +- api/_core/delete.js | 2 +- api/_core/deleteByQuery.js | 2 +- api/_core/explain.d.ts | 2 +- api/_core/explain.js | 4 +- api/_core/get.js | 4 +- api/_core/getSource.js | 4 +- api/_core/index.js | 2 +- api/_core/mget.js | 2 +- api/_core/mtermvectors.js | 12 +- api/_core/search.d.ts | 1 + api/_core/search.js | 3 +- api/_core/searchShards.d.ts | 5 + api/_core/searchShards.js | 3 +- api/_core/searchTemplate.js | 2 +- api/_core/termvectors.js | 12 +- api/_core/update.js | 2 +- api/_core/updateByQuery.js | 2 +- api/_types/_common.aggregations.d.ts | 377 ++++++------------ api/_types/_common.analysis.d.ts | 4 +- api/_types/_common.d.ts | 20 +- api/_types/_common.mapping.d.ts | 2 +- api/_types/_common.query_dsl.d.ts | 11 +- api/_types/_core.bulk.d.ts | 24 +- api/_types/_core.explain.d.ts | 8 +- api/_types/_core.search.d.ts | 30 +- api/_types/asynchronous_search._common.d.ts | 4 +- api/_types/cluster._common.d.ts | 2 + api/_types/geospatial._common.d.ts | 147 +++++++ api/_types/index.d.ts | 6 + api/_types/indices._common.d.ts | 9 +- api/_types/knn._common.d.ts | 4 +- api/_types/ltr._common.d.ts | 58 ++- api/_types/ml._common.d.ts | 9 + api/_types/neural._common.d.ts | 87 ++++ api/_types/nodes._common.d.ts | 2 +- api/_types/nodes.stats.d.ts | 1 + api/_types/search_pipeline._common.d.ts | 20 +- api/_types/search_relevance._common.d.ts | 64 +++ api/_types/security._common.d.ts | 34 +- api/cluster/existsComponentTemplate.js | 2 +- api/cluster/health.d.ts | 3 +- api/danglingIndices/listDanglingIndices.d.ts | 4 +- api/geospatial/_api.js | 46 +++ api/geospatial/deleteIp2GeoDatasource.d.ts | 30 ++ api/geospatial/deleteIp2GeoDatasource.js | 49 +++ api/geospatial/geojsonUploadPost.d.ts | 30 ++ api/geospatial/geojsonUploadPost.js | 49 +++ api/geospatial/geojsonUploadPut.d.ts | 30 ++ api/geospatial/geojsonUploadPut.js | 49 +++ api/geospatial/getIp2GeoDatasource.d.ts | 31 ++ api/geospatial/getIp2GeoDatasource.js | 48 +++ api/geospatial/getUploadStats.d.ts | 28 ++ api/geospatial/getUploadStats.js | 45 +++ api/geospatial/putIp2GeoDatasource.d.ts | 32 ++ api/geospatial/putIp2GeoDatasource.js | 53 +++ .../putIp2GeoDatasourceSettings.d.ts | 32 ++ api/geospatial/putIp2GeoDatasourceSettings.js | 50 +++ api/index.d.ts | 70 +++- api/indices/putSettings.js | 2 +- api/indices/simulateTemplate.js | 2 +- api/ltr/_api.js | 24 ++ api/ltr/cacheStats.d.ts | 28 ++ api/ltr/cacheStats.js | 45 +++ api/ltr/clearCache.d.ts | 30 ++ api/ltr/clearCache.js | 48 +++ api/ltr/createDefaultStore.d.ts | 28 ++ api/ltr/createDefaultStore.js | 45 +++ api/ltr/createStore.d.ts | 30 ++ api/ltr/createStore.js | 49 +++ api/ltr/deleteDefaultStore.d.ts | 28 ++ api/ltr/deleteDefaultStore.js | 45 +++ api/ltr/deleteStore.d.ts | 30 ++ api/ltr/deleteStore.js | 49 +++ api/ltr/getStore.d.ts | 30 ++ api/ltr/getStore.js | 49 +++ api/ltr/listStores.d.ts | 28 ++ api/ltr/listStores.js | 45 +++ api/ml/getTool.d.ts | 2 +- api/neural/_api.js | 26 ++ api/neural/stats.d.ts | 33 ++ api/neural/stats.js | 52 +++ api/nodes/hotThreads.js | 12 +- api/nodes/info.js | 6 +- api/nodes/reloadSecureSettings.js | 2 +- api/nodes/stats.js | 18 +- api/query/datasourcesList.js | 2 +- api/searchRelevance/_api.js | 64 +++ api/searchRelevance/deleteExperiments.d.ts | 29 ++ api/searchRelevance/deleteExperiments.js | 49 +++ api/searchRelevance/deleteJudgments.d.ts | 29 ++ api/searchRelevance/deleteJudgments.js | 49 +++ api/searchRelevance/deleteQuerySets.d.ts | 29 ++ api/searchRelevance/deleteQuerySets.js | 49 +++ .../deleteSearchConfigurations.d.ts | 29 ++ .../deleteSearchConfigurations.js | 49 +++ api/searchRelevance/getExperiments.d.ts | 30 ++ api/searchRelevance/getExperiments.js | 48 +++ api/searchRelevance/getJudgments.d.ts | 30 ++ api/searchRelevance/getJudgments.js | 48 +++ api/searchRelevance/getQuerySets.d.ts | 30 ++ api/searchRelevance/getQuerySets.js | 48 +++ .../getSearchConfigurations.d.ts | 30 ++ .../getSearchConfigurations.js | 48 +++ api/searchRelevance/postQuerySets.d.ts | 39 ++ api/searchRelevance/postQuerySets.js | 47 +++ api/searchRelevance/putExperiments.d.ts | 36 ++ api/searchRelevance/putExperiments.js | 47 +++ api/searchRelevance/putJudgments.d.ts | 48 +++ api/searchRelevance/putJudgments.js | 47 +++ api/searchRelevance/putQuerySets.d.ts | 39 ++ api/searchRelevance/putQuerySets.js | 47 +++ .../putSearchConfigurations.d.ts | 38 ++ .../putSearchConfigurations.js | 47 +++ api/security/getSslinfo.d.ts | 3 +- api/security/getSslinfo.js | 2 +- api/security/patchDistinguishedName.d.ts | 4 +- api/sql/query.js | 2 +- 124 files changed, 3347 insertions(+), 403 deletions(-) create mode 100644 api/_types/geospatial._common.d.ts create mode 100644 api/_types/neural._common.d.ts create mode 100644 api/_types/search_relevance._common.d.ts create mode 100644 api/geospatial/_api.js create mode 100644 api/geospatial/deleteIp2GeoDatasource.d.ts create mode 100644 api/geospatial/deleteIp2GeoDatasource.js create mode 100644 api/geospatial/geojsonUploadPost.d.ts create mode 100644 api/geospatial/geojsonUploadPost.js create mode 100644 api/geospatial/geojsonUploadPut.d.ts create mode 100644 api/geospatial/geojsonUploadPut.js create mode 100644 api/geospatial/getIp2GeoDatasource.d.ts create mode 100644 api/geospatial/getIp2GeoDatasource.js create mode 100644 api/geospatial/getUploadStats.d.ts create mode 100644 api/geospatial/getUploadStats.js create mode 100644 api/geospatial/putIp2GeoDatasource.d.ts create mode 100644 api/geospatial/putIp2GeoDatasource.js create mode 100644 api/geospatial/putIp2GeoDatasourceSettings.d.ts create mode 100644 api/geospatial/putIp2GeoDatasourceSettings.js create mode 100644 api/ltr/cacheStats.d.ts create mode 100644 api/ltr/cacheStats.js create mode 100644 api/ltr/clearCache.d.ts create mode 100644 api/ltr/clearCache.js create mode 100644 api/ltr/createDefaultStore.d.ts create mode 100644 api/ltr/createDefaultStore.js create mode 100644 api/ltr/createStore.d.ts create mode 100644 api/ltr/createStore.js create mode 100644 api/ltr/deleteDefaultStore.d.ts create mode 100644 api/ltr/deleteDefaultStore.js create mode 100644 api/ltr/deleteStore.d.ts create mode 100644 api/ltr/deleteStore.js create mode 100644 api/ltr/getStore.d.ts create mode 100644 api/ltr/getStore.js create mode 100644 api/ltr/listStores.d.ts create mode 100644 api/ltr/listStores.js create mode 100644 api/neural/_api.js create mode 100644 api/neural/stats.d.ts create mode 100644 api/neural/stats.js create mode 100644 api/searchRelevance/_api.js create mode 100644 api/searchRelevance/deleteExperiments.d.ts create mode 100644 api/searchRelevance/deleteExperiments.js create mode 100644 api/searchRelevance/deleteJudgments.d.ts create mode 100644 api/searchRelevance/deleteJudgments.js create mode 100644 api/searchRelevance/deleteQuerySets.d.ts create mode 100644 api/searchRelevance/deleteQuerySets.js create mode 100644 api/searchRelevance/deleteSearchConfigurations.d.ts create mode 100644 api/searchRelevance/deleteSearchConfigurations.js create mode 100644 api/searchRelevance/getExperiments.d.ts create mode 100644 api/searchRelevance/getExperiments.js create mode 100644 api/searchRelevance/getJudgments.d.ts create mode 100644 api/searchRelevance/getJudgments.js create mode 100644 api/searchRelevance/getQuerySets.d.ts create mode 100644 api/searchRelevance/getQuerySets.js create mode 100644 api/searchRelevance/getSearchConfigurations.d.ts create mode 100644 api/searchRelevance/getSearchConfigurations.js create mode 100644 api/searchRelevance/postQuerySets.d.ts create mode 100644 api/searchRelevance/postQuerySets.js create mode 100644 api/searchRelevance/putExperiments.d.ts create mode 100644 api/searchRelevance/putExperiments.js create mode 100644 api/searchRelevance/putJudgments.d.ts create mode 100644 api/searchRelevance/putJudgments.js create mode 100644 api/searchRelevance/putQuerySets.d.ts create mode 100644 api/searchRelevance/putQuerySets.js create mode 100644 api/searchRelevance/putSearchConfigurations.d.ts create mode 100644 api/searchRelevance/putSearchConfigurations.js diff --git a/api/OpenSearchApi.d.ts b/api/OpenSearchApi.d.ts index b8646de8c..616a34f03 100644 --- a/api/OpenSearchApi.d.ts +++ b/api/OpenSearchApi.d.ts @@ -339,6 +339,39 @@ export default class OpenSearchAPI { }; + geospatial: { + getUploadStats (params?: API.Geospatial_GetUploadStats_Request, options?: TransportRequestOptions): TransportRequestPromise; + getUploadStats (callback: callbackFn): TransportRequestCallback; + getUploadStats (params: API.Geospatial_GetUploadStats_Request, callback: callbackFn): TransportRequestCallback; + getUploadStats (params: API.Geospatial_GetUploadStats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + geojsonUploadPost (params: API.Geospatial_GeojsonUploadPost_Request, options?: TransportRequestOptions): TransportRequestPromise; + geojsonUploadPost (params: API.Geospatial_GeojsonUploadPost_Request, callback: callbackFn): TransportRequestCallback; + geojsonUploadPost (params: API.Geospatial_GeojsonUploadPost_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + geojsonUploadPut (params: API.Geospatial_GeojsonUploadPut_Request, options?: TransportRequestOptions): TransportRequestPromise; + geojsonUploadPut (params: API.Geospatial_GeojsonUploadPut_Request, callback: callbackFn): TransportRequestCallback; + geojsonUploadPut (params: API.Geospatial_GeojsonUploadPut_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getIp2GeoDatasource (params?: API.Geospatial_GetIp2GeoDatasource_Request, options?: TransportRequestOptions): TransportRequestPromise; + getIp2GeoDatasource (callback: callbackFn): TransportRequestCallback; + getIp2GeoDatasource (params: API.Geospatial_GetIp2GeoDatasource_Request, callback: callbackFn): TransportRequestCallback; + getIp2GeoDatasource (params: API.Geospatial_GetIp2GeoDatasource_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteIp2GeoDatasource (params: API.Geospatial_DeleteIp2GeoDatasource_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteIp2GeoDatasource (params: API.Geospatial_DeleteIp2GeoDatasource_Request, callback: callbackFn): TransportRequestCallback; + deleteIp2GeoDatasource (params: API.Geospatial_DeleteIp2GeoDatasource_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putIp2GeoDatasource (params: API.Geospatial_PutIp2GeoDatasource_Request, options?: TransportRequestOptions): TransportRequestPromise; + putIp2GeoDatasource (params: API.Geospatial_PutIp2GeoDatasource_Request, callback: callbackFn): TransportRequestCallback; + putIp2GeoDatasource (params: API.Geospatial_PutIp2GeoDatasource_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putIp2GeoDatasourceSettings (params: API.Geospatial_PutIp2GeoDatasourceSettings_Request, options?: TransportRequestOptions): TransportRequestPromise; + putIp2GeoDatasourceSettings (params: API.Geospatial_PutIp2GeoDatasourceSettings_Request, callback: callbackFn): TransportRequestCallback; + putIp2GeoDatasourceSettings (params: API.Geospatial_PutIp2GeoDatasourceSettings_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + indices: { getAlias (params?: API.Indices_GetAlias_Request, options?: TransportRequestOptions): TransportRequestPromise; getAlias (callback: callbackFn): TransportRequestCallback; @@ -693,6 +726,43 @@ export default class OpenSearchAPI { }; ltr: { + deleteDefaultStore (params?: API.Ltr_DeleteDefaultStore_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteDefaultStore (callback: callbackFn): TransportRequestCallback; + deleteDefaultStore (params: API.Ltr_DeleteDefaultStore_Request, callback: callbackFn): TransportRequestCallback; + deleteDefaultStore (params: API.Ltr_DeleteDefaultStore_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + listStores (params?: API.Ltr_ListStores_Request, options?: TransportRequestOptions): TransportRequestPromise; + listStores (callback: callbackFn): TransportRequestCallback; + listStores (params: API.Ltr_ListStores_Request, callback: callbackFn): TransportRequestCallback; + listStores (params: API.Ltr_ListStores_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + createDefaultStore (params?: API.Ltr_CreateDefaultStore_Request, options?: TransportRequestOptions): TransportRequestPromise; + createDefaultStore (callback: callbackFn): TransportRequestCallback; + createDefaultStore (params: API.Ltr_CreateDefaultStore_Request, callback: callbackFn): TransportRequestCallback; + createDefaultStore (params: API.Ltr_CreateDefaultStore_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + cacheStats (params?: API.Ltr_CacheStats_Request, options?: TransportRequestOptions): TransportRequestPromise; + cacheStats (callback: callbackFn): TransportRequestCallback; + cacheStats (params: API.Ltr_CacheStats_Request, callback: callbackFn): TransportRequestCallback; + cacheStats (params: API.Ltr_CacheStats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + clearCache (params?: API.Ltr_ClearCache_Request, options?: TransportRequestOptions): TransportRequestPromise; + clearCache (callback: callbackFn): TransportRequestCallback; + clearCache (params: API.Ltr_ClearCache_Request, callback: callbackFn): TransportRequestCallback; + clearCache (params: API.Ltr_ClearCache_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteStore (params: API.Ltr_DeleteStore_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteStore (params: API.Ltr_DeleteStore_Request, callback: callbackFn): TransportRequestCallback; + deleteStore (params: API.Ltr_DeleteStore_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getStore (params: API.Ltr_GetStore_Request, options?: TransportRequestOptions): TransportRequestPromise; + getStore (params: API.Ltr_GetStore_Request, callback: callbackFn): TransportRequestCallback; + getStore (params: API.Ltr_GetStore_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + createStore (params: API.Ltr_CreateStore_Request, options?: TransportRequestOptions): TransportRequestPromise; + createStore (params: API.Ltr_CreateStore_Request, callback: callbackFn): TransportRequestCallback; + createStore (params: API.Ltr_CreateStore_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + stats (params?: API.Ltr_Stats_Request, options?: TransportRequestOptions): TransportRequestPromise; stats (callback: callbackFn): TransportRequestCallback; stats (params: API.Ltr_Stats_Request, callback: callbackFn): TransportRequestCallback; @@ -961,6 +1031,14 @@ export default class OpenSearchAPI { }; + neural: { + stats (params?: API.Neural_Stats_Request, options?: TransportRequestOptions): TransportRequestPromise; + stats (callback: callbackFn): TransportRequestCallback; + stats (params: API.Neural_Stats_Request, callback: callbackFn): TransportRequestCallback; + stats (params: API.Neural_Stats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + nodes: { info (params?: API.Nodes_Info_Request, options?: TransportRequestOptions): TransportRequestPromise; info (callback: callbackFn): TransportRequestCallback; @@ -1212,6 +1290,70 @@ export default class OpenSearchAPI { }; + searchRelevance: { + getExperiments (params?: API.SearchRelevance_GetExperiments_Request, options?: TransportRequestOptions): TransportRequestPromise; + getExperiments (callback: callbackFn): TransportRequestCallback; + getExperiments (params: API.SearchRelevance_GetExperiments_Request, callback: callbackFn): TransportRequestCallback; + getExperiments (params: API.SearchRelevance_GetExperiments_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putExperiments (params?: API.SearchRelevance_PutExperiments_Request, options?: TransportRequestOptions): TransportRequestPromise; + putExperiments (callback: callbackFn): TransportRequestCallback; + putExperiments (params: API.SearchRelevance_PutExperiments_Request, callback: callbackFn): TransportRequestCallback; + putExperiments (params: API.SearchRelevance_PutExperiments_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteExperiments (params: API.SearchRelevance_DeleteExperiments_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteExperiments (params: API.SearchRelevance_DeleteExperiments_Request, callback: callbackFn): TransportRequestCallback; + deleteExperiments (params: API.SearchRelevance_DeleteExperiments_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getJudgments (params?: API.SearchRelevance_GetJudgments_Request, options?: TransportRequestOptions): TransportRequestPromise; + getJudgments (callback: callbackFn): TransportRequestCallback; + getJudgments (params: API.SearchRelevance_GetJudgments_Request, callback: callbackFn): TransportRequestCallback; + getJudgments (params: API.SearchRelevance_GetJudgments_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putJudgments (params?: API.SearchRelevance_PutJudgments_Request, options?: TransportRequestOptions): TransportRequestPromise; + putJudgments (callback: callbackFn): TransportRequestCallback; + putJudgments (params: API.SearchRelevance_PutJudgments_Request, callback: callbackFn): TransportRequestCallback; + putJudgments (params: API.SearchRelevance_PutJudgments_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteJudgments (params: API.SearchRelevance_DeleteJudgments_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteJudgments (params: API.SearchRelevance_DeleteJudgments_Request, callback: callbackFn): TransportRequestCallback; + deleteJudgments (params: API.SearchRelevance_DeleteJudgments_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getQuerySets (params?: API.SearchRelevance_GetQuerySets_Request, options?: TransportRequestOptions): TransportRequestPromise; + getQuerySets (callback: callbackFn): TransportRequestCallback; + getQuerySets (params: API.SearchRelevance_GetQuerySets_Request, callback: callbackFn): TransportRequestCallback; + getQuerySets (params: API.SearchRelevance_GetQuerySets_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + postQuerySets (params?: API.SearchRelevance_PostQuerySets_Request, options?: TransportRequestOptions): TransportRequestPromise; + postQuerySets (callback: callbackFn): TransportRequestCallback; + postQuerySets (params: API.SearchRelevance_PostQuerySets_Request, callback: callbackFn): TransportRequestCallback; + postQuerySets (params: API.SearchRelevance_PostQuerySets_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putQuerySets (params?: API.SearchRelevance_PutQuerySets_Request, options?: TransportRequestOptions): TransportRequestPromise; + putQuerySets (callback: callbackFn): TransportRequestCallback; + putQuerySets (params: API.SearchRelevance_PutQuerySets_Request, callback: callbackFn): TransportRequestCallback; + putQuerySets (params: API.SearchRelevance_PutQuerySets_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteQuerySets (params: API.SearchRelevance_DeleteQuerySets_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteQuerySets (params: API.SearchRelevance_DeleteQuerySets_Request, callback: callbackFn): TransportRequestCallback; + deleteQuerySets (params: API.SearchRelevance_DeleteQuerySets_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getSearchConfigurations (params?: API.SearchRelevance_GetSearchConfigurations_Request, options?: TransportRequestOptions): TransportRequestPromise; + getSearchConfigurations (callback: callbackFn): TransportRequestCallback; + getSearchConfigurations (params: API.SearchRelevance_GetSearchConfigurations_Request, callback: callbackFn): TransportRequestCallback; + getSearchConfigurations (params: API.SearchRelevance_GetSearchConfigurations_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putSearchConfigurations (params?: API.SearchRelevance_PutSearchConfigurations_Request, options?: TransportRequestOptions): TransportRequestPromise; + putSearchConfigurations (callback: callbackFn): TransportRequestCallback; + putSearchConfigurations (params: API.SearchRelevance_PutSearchConfigurations_Request, callback: callbackFn): TransportRequestCallback; + putSearchConfigurations (params: API.SearchRelevance_PutSearchConfigurations_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteSearchConfigurations (params: API.SearchRelevance_DeleteSearchConfigurations_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteSearchConfigurations (params: API.SearchRelevance_DeleteSearchConfigurations_Request, callback: callbackFn): TransportRequestCallback; + deleteSearchConfigurations (params: API.SearchRelevance_DeleteSearchConfigurations_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + security: { getSslinfo (params?: API.Security_GetSslinfo_Request, options?: TransportRequestOptions): TransportRequestPromise; getSslinfo (callback: callbackFn): TransportRequestCallback; diff --git a/api/OpenSearchApi.js b/api/OpenSearchApi.js index c9c8f6c2e..8cf014f9d 100644 --- a/api/OpenSearchApi.js +++ b/api/OpenSearchApi.js @@ -28,6 +28,7 @@ class OpenSearchAPI { cluster: new(require('./cluster/_api'))(this), danglingIndices: new(require('./danglingIndices/_api'))(this), flowFramework: new(require('./flowFramework/_api'))(this), + geospatial: new(require('./geospatial/_api'))(this), http: new(require('./http/_api'))(this), indices: new(require('./indices/_api'))(this), ingest: new(require('./ingest/_api'))(this), @@ -37,6 +38,7 @@ class OpenSearchAPI { list: new(require('./list/_api'))(this), ltr: new(require('./ltr/_api'))(this), ml: new(require('./ml/_api'))(this), + neural: new(require('./neural/_api'))(this), nodes: new(require('./nodes/_api'))(this), notifications: new(require('./notifications/_api'))(this), observability: new(require('./observability/_api'))(this), @@ -46,6 +48,7 @@ class OpenSearchAPI { replication: new(require('./replication/_api'))(this), rollups: new(require('./rollups/_api'))(this), searchPipeline: new(require('./searchPipeline/_api'))(this), + searchRelevance: new(require('./searchRelevance/_api'))(this), security: new(require('./security/_api'))(this), sm: new(require('./sm/_api'))(this), snapshot: new(require('./snapshot/_api'))(this), @@ -159,6 +162,7 @@ class OpenSearchAPI { cluster: { get() { return this[kApiModules].cluster } }, danglingIndices: { get() { return this[kApiModules].danglingIndices } }, flowFramework: { get() { return this[kApiModules].flowFramework } }, + geospatial: { get() { return this[kApiModules].geospatial } }, http: { get() { return this[kApiModules].http } }, indices: { get() { return this[kApiModules].indices } }, ingest: { get() { return this[kApiModules].ingest } }, @@ -168,6 +172,7 @@ class OpenSearchAPI { list: { get() { return this[kApiModules].list } }, ltr: { get() { return this[kApiModules].ltr } }, ml: { get() { return this[kApiModules].ml } }, + neural: { get() { return this[kApiModules].neural } }, nodes: { get() { return this[kApiModules].nodes } }, notifications: { get() { return this[kApiModules].notifications } }, observability: { get() { return this[kApiModules].observability } }, @@ -177,6 +182,7 @@ class OpenSearchAPI { replication: { get() { return this[kApiModules].replication } }, rollups: { get() { return this[kApiModules].rollups } }, searchPipeline: { get() { return this[kApiModules].searchPipeline } }, + searchRelevance: { get() { return this[kApiModules].searchRelevance } }, security: { get() { return this[kApiModules].security } }, sm: { get() { return this[kApiModules].sm } }, snapshot: { get() { return this[kApiModules].snapshot } }, @@ -195,6 +201,8 @@ class OpenSearchAPI { remote_store: { get() { return this[kApiModules].remoteStore } }, // Deprecated: Use searchPipeline instead. search_pipeline: { get() { return this[kApiModules].searchPipeline } }, + // Deprecated: Use searchRelevance instead. + search_relevance: { get() { return this[kApiModules].searchRelevance } }, }) } } diff --git a/api/_core/bulk.d.ts b/api/_core/bulk.d.ts index 6df4417ae..75f6b059e 100644 --- a/api/_core/bulk.d.ts +++ b/api/_core/bulk.d.ts @@ -29,7 +29,7 @@ export interface Bulk_Request extends Global.Params { pipeline?: string; refresh?: Common.Refresh; require_alias?: boolean; - routing?: Common.RoutingInQueryString; + routing?: Common.Routing; timeout?: Common.Duration; type?: string; wait_for_active_shards?: Common.WaitForActiveShards; diff --git a/api/_core/bulk.js b/api/_core/bulk.js index acde21cec..84e08340e 100644 --- a/api/_core/bulk.js +++ b/api/_core/bulk.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. * @param {boolean} [params.require_alias=false] - If `true`, the request's actions must target an index alias. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. * @param {string} [params.type] - Default document type for items which don't provide one. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/api/_core/bulkStream.js b/api/_core/bulkStream.js index c4367d54f..0f0e3598b 100644 --- a/api/_core/bulkStream.js +++ b/api/_core/bulkStream.js @@ -33,7 +33,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. * @param {boolean} [params.require_alias=false] - If `true`, the request's actions must target an index alias. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. * @param {string} [params.type] - Default document type for items which don't provide one. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/api/_core/count.js b/api/_core/count.js index 833628f25..f9e0b55c6 100644 --- a/api/_core/count.js +++ b/api/_core/count.js @@ -37,7 +37,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {number} [params.min_score] - Sets the minimum `_score` value that documents must have to be included in the result. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {string} [params.q] - Query in the Lucene query string syntax. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {number} [params.terminate_after] - Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams and indexes, omit this parameter or use `*` or `_all`. * @param {object} [params.body] - Query to restrict the results specified with the Query DSL (optional) diff --git a/api/_core/create.js b/api/_core/create.js index 1cc8d54e8..3be76e47f 100644 --- a/api/_core/create.js +++ b/api/_core/create.js @@ -29,7 +29,7 @@ Returns a 409 response when a document with a same ID already exists in the inde * @param {object} params * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`. diff --git a/api/_core/delete.js b/api/_core/delete.js index 57e36831b..30ec9ac2e 100644 --- a/api/_core/delete.js +++ b/api/_core/delete.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term. * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number. * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period to wait for active shards. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`. diff --git a/api/_core/deleteByQuery.js b/api/_core/deleteByQuery.js index 78bdf822e..90e01b86b 100644 --- a/api/_core/deleteByQuery.js +++ b/api/_core/deleteByQuery.js @@ -44,7 +44,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. * @param {boolean} [params.request_cache] - If `true`, the request cache is used for this request. Defaults to the index-level setting. * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.scroll] - Period to retain the search context for scrolling. * @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation. * @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout. diff --git a/api/_core/explain.d.ts b/api/_core/explain.d.ts index c50cd9a9b..0639f776d 100644 --- a/api/_core/explain.d.ts +++ b/api/_core/explain.d.ts @@ -51,7 +51,7 @@ export type Explain_ResponseBody = { _id: Common.Id; _index: Common.IndexName; _type?: Common.Type; - explanation?: Core_Explain.ExplanationDetail; + explanation?: Core_Explain.Explanation; get?: Common.InlineGet; matched: boolean; } diff --git a/api/_core/explain.js b/api/_core/explain.js index ada0c3b35..f32a62efe 100644 --- a/api/_core/explain.js +++ b/api/_core/explain.js @@ -19,7 +19,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn't match) a query. *
See Also: {@link https://opensearch.org/docs/latest/api-reference/explain/ - explain} * * @memberOf API-Core @@ -35,7 +35,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {boolean} [params.lenient] - If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {string} [params.q] - Query in the Lucene query string syntax. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return in the response. * @param {string} params.id - Defines the document ID. * @param {string} params.index - Index names used to limit the request. Only a single index name can be provided to this parameter. diff --git a/api/_core/get.js b/api/_core/get.js index 662ef9cb8..0aab3a2bd 100644 --- a/api/_core/get.js +++ b/api/_core/get.js @@ -35,8 +35,8 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.stored_fields] - List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to false. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. * @param {string} [params.version_type] - Specific version type: `internal`, `external`, `external_gte`. - * @param {string} params.id - Unique identifier of the document. - * @param {string} params.index - Name of the index that contains the document. + * @param {string} params.id - The unique identifier of the document. + * @param {string} params.index - The name of the index that contains the document. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/_core/getSource.js b/api/_core/getSource.js index 4bd27f4a4..f6efdd836 100644 --- a/api/_core/getSource.js +++ b/api/_core/getSource.js @@ -34,8 +34,8 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.routing] - Target the specified primary shard. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. * @param {string} [params.version_type] - Specific version type. One of `internal`, `external`, `external_gte`. - * @param {string} params.id - Unique identifier of the document. - * @param {string} params.index - Name of the index that contains the document. + * @param {string} params.id - The unique identifier of the document. + * @param {string} params.index - The name of the index that contains the document. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/_core/index.js b/api/_core/index.js index 007a5f652..d31b7880b 100644 --- a/api/_core/index.js +++ b/api/_core/index.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. * @param {boolean} [params.require_alias=false] - If `true`, the destination must be an index alias. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`. diff --git a/api/_core/mget.js b/api/_core/mget.js index 4fe9b4e0c..a59159b1c 100644 --- a/api/_core/mget.js +++ b/api/_core/mget.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {boolean} [params.realtime] - If `true`, the request is real-time as opposed to near-real-time. * @param {string} [params.refresh] - If `true`, the request refreshes relevant shards before retrieving documents. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.stored_fields] - If `true`, retrieves the document fields stored in the index rather than the document `_source`. * @param {string} [params.index] - Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. * @param {object} params.body - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. diff --git a/api/_core/mtermvectors.js b/api/_core/mtermvectors.js index add491213..bf8ff8c2a 100644 --- a/api/_core/mtermvectors.js +++ b/api/_core/mtermvectors.js @@ -26,18 +26,18 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {boolean} [params.field_statistics=true] - If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. - * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. - * @param {array} [params.ids] - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body + * @param {string} [params.fields] - A comma-separated list or a wildcard expression specifying the fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. + * @param {array} [params.ids] - A comma-separated list of documents IDs. You must provide either the `docs` field in the request body or specify `ids` as a query parameter or in the request body. * @param {boolean} [params.offsets=true] - If `true`, the response includes term offsets. * @param {boolean} [params.payloads=true] - If `true`, the response includes term payloads. * @param {boolean} [params.positions=true] - If `true`, the response includes term positions. - * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. + * @param {string} [params.preference] - Specifies the node or shard on which the operation should be performed. See [preference query parameter]({{site.url}}{{site.baseurl}}/api-reference/search-apis/search/#the-preference-query-parameter) for a list of available options. By default the requests are routed randomly to available shard copies (primary or replica), with no guarantee of consistency across repeated queries. * @param {boolean} [params.realtime=true] - If `true`, the request is real-time as opposed to near-real-time. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {boolean} [params.term_statistics=false] - If `true`, the response includes term frequency and document frequency. * @param {number} [params.version] - If `true`, returns the document version as part of a hit. - * @param {string} [params.version_type] - Specific version type. - * @param {string} [params.index] - Name of the index that contains the documents. + * @param {string} [params.version_type] - The specific version type. + * @param {string} [params.index] - The name of the index that contains the document. * @param {object} [params.body] - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/_core/search.d.ts b/api/_core/search.d.ts index 7ed23463e..a6bdd6b40 100644 --- a/api/_core/search.d.ts +++ b/api/_core/search.d.ts @@ -69,6 +69,7 @@ export interface Search_Request extends Global.Params { track_scores?: boolean; track_total_hits?: Core_Search.TrackHits; typed_keys?: boolean; + verbose_pipeline?: boolean; version?: boolean; } diff --git a/api/_core/search.js b/api/_core/search.js index c357753d3..ff7a0d69f 100644 --- a/api/_core/search.js +++ b/api/_core/search.js @@ -52,7 +52,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.q] - Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing. * @param {boolean} [params.request_cache] - If `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings. * @param {boolean} [params.rest_total_hits_as_int=false] - Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.scroll] - Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed `1d` (24 hours). You can change this limit using the `search.max_keep_alive` cluster-level setting. * @param {string} [params.search_pipeline] - Customizable sequence of processing stages applied to search queries. * @param {string} [params.search_type] - How distributed term frequencies are calculated for relevance scoring. @@ -70,6 +70,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.track_scores] - If `true`, calculate and return document scores, even if the scores are not used for sorting. * @param {string} [params.track_total_hits] - Number of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query. * @param {boolean} [params.typed_keys] - If `true`, aggregation and suggester names are be prefixed by their respective types in the response. + * @param {boolean} [params.verbose_pipeline] - Enables or disables verbose mode for the search pipeline. When verbose mode is enabled, detailed information about each processor in the search pipeline is included in the search response. This includes the processor name, execution status, input, output, and time taken for processing. This parameter is primarily intended for debugging purposes, allowing users to track how data flows and transforms through the search pipeline. * @param {boolean} [params.version] - If `true`, returns document version as part of a hit. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams and indexes, omit this parameter or use `*` or `_all`. * @param {object} [params.body] - The search definition using the Query DSL diff --git a/api/_core/searchShards.d.ts b/api/_core/searchShards.d.ts index 37b877ee5..a57e37fb5 100644 --- a/api/_core/searchShards.d.ts +++ b/api/_core/searchShards.d.ts @@ -21,6 +21,7 @@ import * as Global from '../_types/_global' export interface SearchShards_Request extends Global.Params { allow_no_indices?: boolean; + body?: SearchShards_RequestBody; expand_wildcards?: Common.ExpandWildcards; ignore_unavailable?: boolean; index?: Common.Indices; @@ -29,6 +30,10 @@ export interface SearchShards_Request extends Global.Params { routing?: Common.RoutingInQueryString; } +export type SearchShards_RequestBody = { + slice?: Common.SlicedScroll; +} + export interface SearchShards_Response extends ApiResponse { body: SearchShards_ResponseBody; } diff --git a/api/_core/searchShards.js b/api/_core/searchShards.js index b7ddf445f..952b5bd4e 100644 --- a/api/_core/searchShards.js +++ b/api/_core/searchShards.js @@ -30,8 +30,9 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. * @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.routing] - A 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] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/_core/searchTemplate.js b/api/_core/searchTemplate.js index e4a4f7d88..4573e8f8d 100644 --- a/api/_core/searchTemplate.js +++ b/api/_core/searchTemplate.js @@ -34,7 +34,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {boolean} [params.profile] - If `true`, the query execution is profiled. * @param {boolean} [params.rest_total_hits_as_int=false] - If `true`, `hits.total` are rendered as an integer in the response. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.scroll] - Specifies how long a consistent view of the index should be maintained for scrolled search. * @param {string} [params.search_type] - The type of the search operation. * @param {boolean} [params.typed_keys] - If `true`, the response prefixes aggregation and suggester names with their respective types. diff --git a/api/_core/termvectors.js b/api/_core/termvectors.js index 904014153..c0546f737 100644 --- a/api/_core/termvectors.js +++ b/api/_core/termvectors.js @@ -26,18 +26,18 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {boolean} [params.field_statistics=true] - If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. - * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. + * @param {string} [params.fields] - A comma-separated list or a wildcard expression specifying the fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. * @param {boolean} [params.offsets=true] - If `true`, the response includes term offsets. * @param {boolean} [params.payloads=true] - If `true`, the response includes term payloads. * @param {boolean} [params.positions=true] - If `true`, the response includes term positions. - * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. + * @param {string} [params.preference] - Specifies the node or shard on which the operation should be performed. See [preference query parameter]({{site.url}}{{site.baseurl}}/api-reference/search-apis/search/#the-preference-query-parameter) for a list of available options. By default the requests are routed randomly to available shard copies (primary or replica), with no guarantee of consistency across repeated queries. * @param {boolean} [params.realtime=true] - If `true`, the request is real-time as opposed to near-real-time. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {boolean} [params.term_statistics=false] - If `true`, the response includes term frequency and document frequency. * @param {number} [params.version] - If `true`, returns the document version as part of a hit. - * @param {string} [params.version_type] - Specific version type. - * @param {string} params.index - Name of the index that contains the document. - * @param {string} [params.id] - Unique identifier of the document. + * @param {string} [params.version_type] - The specific version type. + * @param {string} params.index - The name of the index that contains the document. + * @param {string} [params.id] - The unique identifier of the document. * @param {object} [params.body] - Define parameters and or supply a document to get termvectors for. See documentation. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/_core/update.js b/api/_core/update.js index fe6d91538..16d543f22 100644 --- a/api/_core/update.js +++ b/api/_core/update.js @@ -34,7 +34,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.refresh] - If 'true', OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. * @param {boolean} [params.require_alias=false] - If `true`, the destination must be an index alias. * @param {number} [params.retry_on_conflict=0] - Specify how many times should the operation be retried when a conflict occurs. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period to wait for dynamic mapping updates and active shards. This guarantees OpenSearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operations. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard. * @param {string} params.id - Document ID diff --git a/api/_core/updateByQuery.js b/api/_core/updateByQuery.js index 96ce85df0..81fa4666b 100644 --- a/api/_core/updateByQuery.js +++ b/api/_core/updateByQuery.js @@ -46,7 +46,7 @@ for example to pick up a mapping change. * @param {string} [params.refresh] - If `true`, OpenSearch refreshes affected shards to make the operation visible to search. * @param {boolean} [params.request_cache] - If `true`, the request cache is used for this request. * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. - * @param {string} [params.routing] - Custom value used to route operations to a specific shard. + * @param {string} [params.routing] - A custom value used to route operations to a specific shard. * @param {string} [params.scroll] - Period to retain the search context for scrolling. * @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation. * @param {string} [params.search_timeout] - Explicit timeout for each search request. diff --git a/api/_types/_common.aggregations.d.ts b/api/_types/_common.aggregations.d.ts index e3ce338f6..083c50a01 100644 --- a/api/_types/_common.aggregations.d.ts +++ b/api/_types/_common.aggregations.d.ts @@ -28,7 +28,7 @@ export type AdjacencyMatrixBucket = MultiBucketBase & { key: string; } -export type Aggregate = CardinalityAggregate | HdrPercentilesAggregate | HdrPercentileRanksAggregate | TDigestPercentilesAggregate | TDigestPercentileRanksAggregate | PercentilesBucketAggregate | MedianAbsoluteDeviationAggregate | MinAggregate | MaxAggregate | SumAggregate | AvgAggregate | WeightedAvgAggregate | ValueCountAggregate | SimpleValueAggregate | DerivativeAggregate | BucketMetricValueAggregate | StatsAggregate | StatsBucketAggregate | ExtendedStatsAggregate | ExtendedStatsBucketAggregate | GeoBoundsAggregate | GeoCentroidAggregate | HistogramAggregate | DateHistogramAggregate | AutoDateHistogramAggregate | VariableWidthHistogramAggregate | StringTermsAggregate | LongTermsAggregate | DoubleTermsAggregate | UnmappedTermsAggregate | LongRareTermsAggregate | StringRareTermsAggregate | UnmappedRareTermsAggregate | MultiTermsAggregate | MissingAggregate | NestedAggregate | ReverseNestedAggregate | GlobalAggregate | FilterAggregate | ChildrenAggregate | ParentAggregate | SamplerAggregate | UnmappedSamplerAggregate | GeoHashGridAggregate | GeoTileGridAggregate | RangeAggregate | DateRangeAggregate | GeoDistanceAggregate | IpRangeAggregate | FiltersAggregate | AdjacencyMatrixAggregate | SignificantLongTermsAggregate | SignificantStringTermsAggregate | UnmappedSignificantTermsAggregate | CompositeAggregate | ScriptedMetricAggregate | TopHitsAggregate | InferenceAggregate | StringStatsAggregate | BoxPlotAggregate | TopMetricsAggregate | TTestAggregate | RateAggregate | CumulativeCardinalityAggregate | MatrixStatsAggregate | GeoLineAggregate +export type Aggregate = AdjacencyMatrixAggregate | AutoDateHistogramAggregate | AvgAggregate | BoxPlotAggregate | BucketMetricValueAggregate | CardinalityAggregate | ChildrenAggregate | CompositeAggregate | DateHistogramAggregate | DateRangeAggregate | DerivativeAggregate | DoubleTermsAggregate | ExtendedStatsAggregate | ExtendedStatsBucketAggregate | FilterAggregate | FiltersAggregate | GeoBoundsAggregate | GeoCentroidAggregate | GeoDistanceAggregate | GeoHashGridAggregate | GeoTileGridAggregate | GlobalAggregate | HdrPercentilesAggregate | HdrPercentileRanksAggregate | HistogramAggregate | IpRangeAggregate | LongRareTermsAggregate | LongTermsAggregate | MatrixStatsAggregate | MaxAggregate | MedianAbsoluteDeviationAggregate | MinAggregate | MissingAggregate | MultiTermsAggregate | NestedAggregate | ParentAggregate | PercentilesBucketAggregate | RangeAggregate | RateAggregate | ReverseNestedAggregate | SamplerAggregate | ScriptedMetricAggregate | SignificantLongTermsAggregate | SignificantStringTermsAggregate | CumulativeCardinalityAggregate | SimpleValueAggregate | StatsAggregate | StatsBucketAggregate | StringRareTermsAggregate | StringTermsAggregate | SumAggregate | TDigestPercentilesAggregate | TDigestPercentileRanksAggregate | TTestAggregate | TopHitsAggregate | UnmappedRareTermsAggregate | UnmappedSignificantTermsAggregate | UnmappedTermsAggregate | ValueCountAggregate | VariableWidthHistogramAggregate | WeightedAvgAggregate export type AggregateBase = { meta?: Common.Metadata; @@ -95,8 +95,6 @@ export type AggregationContainer = { geo_distance: GeoDistanceAggregation; } | { geohash_grid: GeoHashGridAggregation; -} | { - geo_line: GeoLineAggregation; } | { geotile_grid: GeoTileGridAggregation; } | { @@ -105,10 +103,6 @@ export type AggregationContainer = { histogram: HistogramAggregation; } | { ip_range: IpRangeAggregation; -} | { - inference: InferenceAggregation; -} | { - line: GeoLineAggregation; } | { matrix_stats: MatrixStatsAggregation; } | { @@ -165,8 +159,6 @@ export type AggregationContainer = { stats: StatsAggregation; } | { stats_bucket: StatsBucketAggregation; -} | { - string_stats: StringStatsAggregation; } | { sum: SumAggregation; } | { @@ -177,8 +169,6 @@ export type AggregationContainer = { top_hits: TopHitsAggregation; } | { t_test: TTestAggregation; -} | { - top_metrics: TopMetricsAggregation; } | { value_count: ValueCountAggregation; } | { @@ -188,14 +178,14 @@ export type AggregationContainer = { }) export type AggregationRange = { - from?: undefined | number | string; + from?: number | string | undefined; key?: string; - to?: undefined | number | string; + to?: number | string | undefined; } export type ArrayPercentilesItem = { key: string; - value: undefined | number | string; + value: number | undefined; value_as_string?: string; } @@ -252,38 +242,16 @@ export type BucketPathAggregation = Aggregation & { buckets_path?: BucketsPath; } -export type BucketsAdjacencyMatrixBucket = Record | AdjacencyMatrixBucket[] - -export type BucketsCompositeBucket = Record | CompositeBucket[] +export type Buckets = Record | TBucket[] export type BucketScriptAggregation = PipelineAggregationBase & { script?: Common.Script; } -export type BucketsDateHistogramBucket = Record | DateHistogramBucket[] - -export type BucketsDoubleTermsBucket = Record | DoubleTermsBucket[] - export type BucketSelectorAggregation = PipelineAggregationBase & { script?: Common.Script; } -export type BucketsFiltersBucket = Record | FiltersBucket[] - -export type BucketsGeoHashGridBucket = Record | GeoHashGridBucket[] - -export type BucketsGeoTileGridBucket = Record | GeoTileGridBucket[] - -export type BucketsHistogramBucket = Record | HistogramBucket[] - -export type BucketsIpRangeBucket = Record | IpRangeBucket[] - -export type BucketsLongRareTermsBucket = Record | LongRareTermsBucket[] - -export type BucketsLongTermsBucket = Record | LongTermsBucket[] - -export type BucketsMultiTermsBucket = Record | MultiTermsBucket[] - export type BucketSortAggregation = Aggregation & { from?: number; gap_policy?: GapPolicy; @@ -293,21 +261,7 @@ export type BucketSortAggregation = Aggregation & { export type BucketsPath = string | string[] | Record -export type BucketsQueryContainer = Record | Common_QueryDsl.QueryContainer[] - -export type BucketsRangeBucket = Record | RangeBucket[] - -export type BucketsSignificantLongTermsBucket = Record | SignificantLongTermsBucket[] - -export type BucketsSignificantStringTermsBucket = Record | SignificantStringTermsBucket[] - -export type BucketsStringRareTermsBucket = Record | StringRareTermsBucket[] - -export type BucketsStringTermsBucket = Record | StringTermsBucket[] - -export type BucketsVariableWidthHistogramBucket = Record | VariableWidthHistogramBucket[] - -export type BucketsVoid = Record | Common.Void[] +export type BucketsQueryContainer = Buckets & (Record | Common_QueryDsl.QueryContainer[]) export type CalendarInterval = 'second' | '1s' | 'minute' | '1m' | 'hour' | '1h' | 'day' | '1d' | 'week' | '1w' | 'month' | '1M' | 'quarter' | '1q' | 'year' | '1Y' @@ -334,14 +288,6 @@ export type ChiSquareHeuristic = { include_negatives: boolean; } -export type ClassificationInferenceOptions = { - num_top_classes?: number; - num_top_feature_importance_values?: number; - prediction_field_type?: string; - results_field?: string; - top_classes_results_field?: string; -} - export type CompositeAggregate = MultiBucketAggregateBaseCompositeBucket & { after_key?: CompositeAggregateKey; } @@ -427,7 +373,7 @@ export type DateHistogramBucket = MultiBucketBase & { key_as_string?: string; } -export type DateRangeAggregate = RangeAggregate & Record +export type DateRangeAggregate = RangeAggregateBase & Record export type DateRangeAggregation = BucketAggregationBase & { field?: Common.Field; @@ -475,30 +421,37 @@ export type EwmaMovingAverageAggregation = MovingAverageAggregationBase & { settings: EwmaModelSettings; } -export type ExtendedBoundsdouble = { - max: number; - min: number; +export type ExtendedBounds = { + max: T; + min: T; } -export type ExtendedBoundsFieldDateMath = { - max: FieldDateMath; - min: FieldDateMath; +export type ExtendedBoundsDouble = ExtendedBounds & { + max?: number; + min?: number; } -export type ExtendedStatsAggregate = StatsAggregate & { - std_deviation: undefined | number | string; +export type ExtendedBoundsFieldDateMath = ExtendedBounds & { + max?: FieldDateMath; + min?: FieldDateMath; +} + +export type ExtendedStatsAggregate = ExtendedStatsAggregateBase & Record + +export type ExtendedStatsAggregateBase = StatsAggregateBase & { + std_deviation: number | undefined; std_deviation_as_string?: string; std_deviation_bounds?: StandardDeviationBounds; std_deviation_bounds_as_string?: StandardDeviationBoundsAsString; - std_deviation_population: undefined | number | string; - std_deviation_sampling: undefined | number | string; - sum_of_squares: undefined | number | string; + std_deviation_population: number | undefined; + std_deviation_sampling: number | undefined; + sum_of_squares: number | undefined; sum_of_squares_as_string?: string; - variance: undefined | number | string; + variance: number | undefined; variance_as_string?: string; - variance_population: undefined | number | string; + variance_population: number | undefined; variance_population_as_string?: string; - variance_sampling: undefined | number | string; + variance_sampling: number | undefined; variance_sampling_as_string?: string; } @@ -506,7 +459,7 @@ export type ExtendedStatsAggregation = FormatMetricAggregationBase & { sigma?: number; } -export type ExtendedStatsBucketAggregate = ExtendedStatsAggregate & Record +export type ExtendedStatsBucketAggregate = ExtendedStatsAggregateBase & Record export type ExtendedStatsBucketAggregation = PipelineAggregationBase & { sigma?: number; @@ -555,7 +508,7 @@ export type GeoCentroidAggregation = MetricAggregationBase & { location?: Common.GeoLocation; } -export type GeoDistanceAggregate = RangeAggregate & Record +export type GeoDistanceAggregate = RangeAggregateBase & Record export type GeoDistanceAggregation = BucketAggregationBase & { distance_type?: Common.GeoDistanceType; @@ -579,28 +532,6 @@ export type GeoHashGridBucket = MultiBucketBase & { key: Common.GeoHash; } -export type GeoLineAggregate = AggregateBase & { - geometry: Common.GeoLine; - properties: Record; - type: string; -} - -export type GeoLineAggregation = { - include_sort?: boolean; - point: GeoLinePoint; - size?: number; - sort: GeoLineSort; - sort_order?: Common.SortOrder; -} - -export type GeoLinePoint = { - field: Common.Field; -} - -export type GeoLineSort = { - field: Common.Field; -} - export type GeoTileGridAggregate = MultiBucketAggregateBaseGeoTileGridBucket & Record export type GeoTileGridAggregation = BucketAggregationBase & { @@ -634,10 +565,10 @@ export type HdrPercentilesAggregate = PercentilesAggregateBase & Record export type HistogramAggregation = BucketAggregationBase & { - extended_bounds?: ExtendedBoundsdouble; + extended_bounds?: ExtendedBoundsDouble; field?: Common.Field; format?: string; - hard_bounds?: ExtendedBoundsdouble; + hard_bounds?: ExtendedBoundsDouble; interval?: number; keyed?: boolean; min_doc_count?: number; @@ -683,40 +614,6 @@ export type HoltWintersMovingAverageAggregation = MovingAverageAggregationBase & export type HoltWintersType = 'add' | 'mult' -export type InferenceAggregate = AggregateBase & { - feature_importance?: InferenceFeatureImportance[]; - top_classes?: InferenceTopClassEntry[]; - value?: Common.FieldValue; - warning?: string; -} - -export type InferenceAggregation = PipelineAggregationBase & { - inference_config?: InferenceConfigContainer; - model_id: Common.Name; -} - -export type InferenceClassImportance = { - class_name: string; - importance: number; -} - -export type InferenceConfigContainer = { - classification?: ClassificationInferenceOptions; - regression?: RegressionInferenceOptions; -} - -export type InferenceFeatureImportance = { - classes?: InferenceClassImportance[]; - feature_name: string; - importance?: number; -} - -export type InferenceTopClassEntry = { - class_name: Common.FieldValue; - class_probability: number; - class_score: number; -} - export type IpRangeAggregate = MultiBucketAggregateBaseIpRangeBucket & Record export type IpRangeAggregation = BucketAggregationBase & { @@ -736,7 +633,7 @@ export type IpRangeBucket = MultiBucketBase & { to?: string; } -export type KeyedPercentiles = Record +export type KeyedPercentiles = Record export type LinearMovingAverageAggregation = MovingAverageAggregationBase & { model: 'linear'; @@ -753,10 +650,12 @@ export type LongRareTermsBucket = MultiBucketBase & { export type LongTermsAggregate = TermsAggregateBaseLongTermsBucket & Record export type LongTermsBucket = TermsBucketBase & { - key: number; + key: LongTermsBucketKey; key_as_string?: string; } +export type LongTermsBucketKey = number | string + export type MatrixAggregation = Aggregation & { fields?: Common.Fields; missing?: Record; @@ -837,80 +736,60 @@ export type MovingPercentilesAggregation = PipelineAggregationBase & { window?: number; } -export type MultiBucketAggregateBaseAdjacencyMatrixBucket = AggregateBase & { - buckets: BucketsAdjacencyMatrixBucket; -} - -export type MultiBucketAggregateBaseCompositeBucket = AggregateBase & { - buckets: BucketsCompositeBucket; -} - -export type MultiBucketAggregateBaseDateHistogramBucket = AggregateBase & { - buckets: BucketsDateHistogramBucket; -} - -export type MultiBucketAggregateBaseDoubleTermsBucket = AggregateBase & { - buckets: BucketsDoubleTermsBucket; +export type MultiBucketAggregateBase = AggregateBase & { + buckets: Buckets & (Record | TBucket[]); } -export type MultiBucketAggregateBaseFiltersBucket = AggregateBase & { - buckets: BucketsFiltersBucket; +export type MultiBucketAggregateBaseAdjacencyMatrixBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | AdjacencyMatrixBucket[]); } -export type MultiBucketAggregateBaseGeoHashGridBucket = AggregateBase & { - buckets: BucketsGeoHashGridBucket; +export type MultiBucketAggregateBaseCompositeBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | CompositeBucket[]); } -export type MultiBucketAggregateBaseGeoTileGridBucket = AggregateBase & { - buckets: BucketsGeoTileGridBucket; +export type MultiBucketAggregateBaseDateHistogramBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | DateHistogramBucket[]); } -export type MultiBucketAggregateBaseHistogramBucket = AggregateBase & { - buckets: BucketsHistogramBucket; +export type MultiBucketAggregateBaseFiltersBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | FiltersBucket[]); } -export type MultiBucketAggregateBaseIpRangeBucket = AggregateBase & { - buckets: BucketsIpRangeBucket; +export type MultiBucketAggregateBaseGeoHashGridBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | GeoHashGridBucket[]); } -export type MultiBucketAggregateBaseLongRareTermsBucket = AggregateBase & { - buckets: BucketsLongRareTermsBucket; +export type MultiBucketAggregateBaseGeoTileGridBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | GeoTileGridBucket[]); } -export type MultiBucketAggregateBaseLongTermsBucket = AggregateBase & { - buckets: BucketsLongTermsBucket; +export type MultiBucketAggregateBaseHistogramBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | HistogramBucket[]); } -export type MultiBucketAggregateBaseMultiTermsBucket = AggregateBase & { - buckets: BucketsMultiTermsBucket; +export type MultiBucketAggregateBaseIpRangeBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | IpRangeBucket[]); } -export type MultiBucketAggregateBaseRangeBucket = AggregateBase & { - buckets: BucketsRangeBucket; +export type MultiBucketAggregateBaseLongRareTermsBucket = MultiBucketAggregateBase & { + buckets?: Buckets & (Record | LongRareTermsBucket[]); } -export type MultiBucketAggregateBaseSignificantLongTermsBucket = AggregateBase & { - buckets: BucketsSignificantLongTermsBucket; +export type MultiBucketAggregateBaseRangeBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | RangeBucket[]); } -export type MultiBucketAggregateBaseSignificantStringTermsBucket = AggregateBase & { - buckets: BucketsSignificantStringTermsBucket; +export type MultiBucketAggregateBaseStringRareTermsBucket = MultiBucketAggregateBase & { + buckets?: Buckets & (Record | StringRareTermsBucket[]); } -export type MultiBucketAggregateBaseStringRareTermsBucket = AggregateBase & { - buckets: BucketsStringRareTermsBucket; +export type MultiBucketAggregateBaseVariableWidthHistogramBucket = MultiBucketAggregateBase & { + buckets: Buckets & (Record | VariableWidthHistogramBucket[]); } -export type MultiBucketAggregateBaseStringTermsBucket = AggregateBase & { - buckets: BucketsStringTermsBucket; -} - -export type MultiBucketAggregateBaseVariableWidthHistogramBucket = AggregateBase & { - buckets: BucketsVariableWidthHistogramBucket; -} - -export type MultiBucketAggregateBaseVoid = AggregateBase & { - buckets: BucketsVoid; +export type MultiBucketAggregateBaseVoid = MultiBucketAggregateBase & { + buckets?: Buckets & (Record | Common.Void[]); } export type MultiBucketBase = { @@ -946,9 +825,7 @@ export type MutualInformationHeuristic = { include_negatives?: boolean; } -export type NestedAggregate = AggregateBase & { - doc_count?: number; -} +export type NestedAggregate = SingleBucketAggregateBase & Record export type NestedAggregation = BucketAggregationBase & { path?: Common.Field; @@ -999,7 +876,9 @@ export type PipelineAggregationBase = BucketPathAggregation & { gap_policy?: GapPolicy; } -export type RangeAggregate = MultiBucketAggregateBaseRangeBucket & Record +export type RangeAggregate = RangeAggregateBase & Record + +export type RangeAggregateBase = MultiBucketAggregateBaseRangeBucket & Record export type RangeAggregation = BucketAggregationBase & { field?: Common.Field; @@ -1040,11 +919,6 @@ export type RateAggregation = FormatMetricAggregationBase & { export type RateMode = 'sum' | 'value_count' -export type RegressionInferenceOptions = { - num_top_feature_importance_values?: number; - results_field?: Common.Field; -} - export type ReverseNestedAggregate = SingleBucketAggregateBase & Record export type ReverseNestedAggregation = BucketAggregationBase & { @@ -1064,7 +938,7 @@ export type ScriptedHeuristic = { } export type ScriptedMetricAggregate = AggregateBase & { - value: Record; + value: any; } export type ScriptedMetricAggregation = MetricAggregationBase & { @@ -1092,19 +966,21 @@ export type SignificantStringTermsBucket = SignificantTermsBucketBase & { key: string; } -export type SignificantTermsAggregateBaseSignificantLongTermsBucket = MultiBucketAggregateBaseSignificantLongTermsBucket & { +export type SignificantTermsAggregateBase = MultiBucketAggregateBase & { bg_count?: number; doc_count?: number; } -export type SignificantTermsAggregateBaseSignificantStringTermsBucket = MultiBucketAggregateBaseSignificantStringTermsBucket & { - bg_count?: number; - doc_count?: number; +export type SignificantTermsAggregateBaseSignificantLongTermsBucket = SignificantTermsAggregateBase & { + buckets?: Buckets & (Record | SignificantLongTermsBucket[]); } -export type SignificantTermsAggregateBaseVoid = MultiBucketAggregateBaseVoid & { - bg_count?: number; - doc_count?: number; +export type SignificantTermsAggregateBaseSignificantStringTermsBucket = SignificantTermsAggregateBase & { + buckets?: Buckets & (Record | SignificantStringTermsBucket[]); +} + +export type SignificantTermsAggregateBaseVoid = SignificantTermsAggregateBase & { + buckets?: Buckets & (Record | Common.Void[]); } export type SignificantTermsAggregation = BucketAggregationBase & { @@ -1163,17 +1039,17 @@ export type SingleBucketAggregateBase = AggregateBase & { } export type SingleMetricAggregateBase = AggregateBase & { - value: undefined | number | string; + value: number | undefined; value_as_string?: string; } export type StandardDeviationBounds = { - lower: undefined | number | string; - lower_population: undefined | number | string; - lower_sampling: undefined | number | string; - upper: undefined | number | string; - upper_population: undefined | number | string; - upper_sampling: undefined | number | string; + lower: number | undefined; + lower_population: number | undefined; + lower_sampling: number | undefined; + upper: number | undefined; + upper_population: number | undefined; + upper_sampling: number | undefined; } export type StandardDeviationBoundsAsString = { @@ -1185,13 +1061,15 @@ export type StandardDeviationBoundsAsString = { upper_sampling: string; } -export type StatsAggregate = AggregateBase & { - avg: undefined | number | string; +export type StatsAggregate = StatsAggregateBase & Record + +export type StatsAggregateBase = AggregateBase & { + avg: number | undefined; avg_as_string?: string; count: number; - max: undefined | number | string; + max: number | undefined; max_as_string?: string; - min: undefined | number | string; + min: number | undefined; min_as_string?: string; sum: number; sum_as_string?: string; @@ -1199,7 +1077,7 @@ export type StatsAggregate = AggregateBase & { export type StatsAggregation = FormatMetricAggregationBase & Record -export type StatsBucketAggregate = StatsAggregate & Record +export type StatsBucketAggregate = StatsAggregateBase & Record export type StatsBucketAggregation = PipelineAggregationBase & Record @@ -1209,26 +1087,10 @@ export type StringRareTermsBucket = MultiBucketBase & { key: string; } -export type StringStatsAggregate = AggregateBase & { - avg_length: undefined | number | string; - avg_length_as_string?: string; - count: number; - distribution?: undefined | Record | string; - entropy: undefined | number | string; - max_length: undefined | number | string; - max_length_as_string?: string; - min_length: undefined | number | string; - min_length_as_string?: string; -} - -export type StringStatsAggregation = MetricAggregationBase & { - show_distribution?: boolean; -} - export type StringTermsAggregate = TermsAggregateBaseStringTermsBucket & Record export type StringTermsBucket = TermsBucketBase & { - key: Common.FieldValue; + key: string; } export type SumAggregate = SingleMetricAggregateBase & Record @@ -1237,6 +1099,10 @@ export type SumAggregation = FormatMetricAggregationBase & Record export type SumBucketAggregation = PipelineAggregationBase & Record +export type T = Record + +export type TBucket = Record + export type TDigest = { compression?: number; } @@ -1245,29 +1111,29 @@ export type TDigestPercentileRanksAggregate = PercentilesAggregateBase & Record< export type TDigestPercentilesAggregate = PercentilesAggregateBase & Record -export type TermsAggregateBaseDoubleTermsBucket = MultiBucketAggregateBaseDoubleTermsBucket & { +export type TermsAggregateBase = MultiBucketAggregateBase & { doc_count_error_upper_bound?: number; sum_other_doc_count?: number; } -export type TermsAggregateBaseLongTermsBucket = MultiBucketAggregateBaseLongTermsBucket & { - doc_count_error_upper_bound?: number; - sum_other_doc_count?: number; +export type TermsAggregateBaseDoubleTermsBucket = TermsAggregateBase & { + buckets?: Buckets & (Record | DoubleTermsBucket[]); } -export type TermsAggregateBaseMultiTermsBucket = MultiBucketAggregateBaseMultiTermsBucket & { - doc_count_error_upper_bound?: number; - sum_other_doc_count?: number; +export type TermsAggregateBaseLongTermsBucket = TermsAggregateBase & { + buckets?: Buckets & (Record | LongTermsBucket[]); } -export type TermsAggregateBaseStringTermsBucket = MultiBucketAggregateBaseStringTermsBucket & { - doc_count_error_upper_bound?: number; - sum_other_doc_count?: number; +export type TermsAggregateBaseMultiTermsBucket = TermsAggregateBase & { + buckets?: Buckets & (Record | MultiTermsBucket[]); } -export type TermsAggregateBaseVoid = MultiBucketAggregateBaseVoid & { - doc_count_error_upper_bound?: number; - sum_other_doc_count?: number; +export type TermsAggregateBaseStringTermsBucket = TermsAggregateBase & { + buckets?: Buckets & (Record | StringTermsBucket[]); +} + +export type TermsAggregateBaseVoid = TermsAggregateBase & { + buckets?: Buckets & (Record | Common.Void[]); } export type TermsAggregation = BucketAggregationBase & { @@ -1331,27 +1197,8 @@ export type TopHitsAggregation = MetricAggregationBase & { version?: boolean; } -export type TopMetrics = { - metrics: Record; - sort: Common.FieldValue[]; -} - -export type TopMetricsAggregate = AggregateBase & { - top: TopMetrics[]; -} - -export type TopMetricsAggregation = MetricAggregationBase & { - metrics?: TopMetricsValue | TopMetricsValue[]; - size?: number; - sort?: Common.Sort; -} - -export type TopMetricsValue = { - field: Common.Field; -} - export type TTestAggregate = AggregateBase & { - value: undefined | number | string; + value: number | undefined; value_as_string?: string; } @@ -1365,8 +1212,6 @@ export type TTestType = 'heteroscedastic' | 'homoscedastic' | 'paired' export type UnmappedRareTermsAggregate = MultiBucketAggregateBaseVoid & Record -export type UnmappedSamplerAggregate = SingleBucketAggregateBase & Record - export type UnmappedSignificantTermsAggregate = SignificantTermsAggregateBaseVoid & Record export type UnmappedTermsAggregate = TermsAggregateBaseVoid & Record diff --git a/api/_types/_common.analysis.d.ts b/api/_types/_common.analysis.d.ts index 402dd5dd8..e10b16088 100644 --- a/api/_types/_common.analysis.d.ts +++ b/api/_types/_common.analysis.d.ts @@ -480,8 +480,8 @@ export type ReverseTokenFilter = TokenFilterBase & { export type ShingleTokenFilter = TokenFilterBase & { filler_token?: string; - max_shingle_size?: number | string; - min_shingle_size?: number | string; + max_shingle_size?: Common.StringifiedInteger; + min_shingle_size?: Common.StringifiedInteger; output_unigrams?: boolean; output_unigrams_if_no_shingles?: boolean; token_separator?: string; diff --git a/api/_types/_common.d.ts b/api/_types/_common.d.ts index cac0d9eab..cbbe597f3 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -234,8 +234,10 @@ export type GeoDistanceSort = { distance_type?: GeoDistanceType; ignore_unmapped?: boolean; mode?: SortMode; + nested?: NestedSortValue; order?: SortOrder; unit?: DistanceUnit; + validation_method?: Common_QueryDsl.GeoValidationMethod; [key: string]: any | GeoLocation[]; } @@ -249,11 +251,6 @@ export type GeoHashLocation = { export type GeoHashPrecision = number | string -export type GeoLine = { - coordinates: number[][]; - type: string; -} - export type GeoLocation = LatLonGeoLocation | GeoHashLocation | number[] | string export type GeoShapeRelation = 'contains' | 'disjoint' | 'intersects' | 'within' @@ -336,6 +333,7 @@ export type InlineGetDictUserDefined = { _source?: Record; fields?: Record>; found: boolean; + [key: string]: any | Record; } export type InlineScript = string | (ScriptBase & { @@ -417,6 +415,7 @@ export type NodeShard = { primary: boolean; recovery_source?: Record; relocating_node?: NodeId | undefined; + searchOnly?: boolean; shard: number; state: Indices_Stats.ShardRoutingState; unassigned_info?: Cluster_AllocationExplain.UnassignedInformation; @@ -746,6 +745,13 @@ export type ShardFailure = { status?: string; } +export type ShardInfo = { + failed: uint; + failures?: ShardFailure[]; + successful: uint; + total: uint; +} + export type ShardsOperationResponseBase = { _shards: ShardStatistics; } @@ -891,9 +897,9 @@ export type VersionType = 'external' | 'external_gte' | 'force' | 'internal' export type Void = Record -export type WaitForActiveShardOptions = 'all' | 'index-setting' +export type WaitForActiveShardOptions = 'all' | undefined -export type WaitForActiveShards = number | WaitForActiveShardOptions +export type WaitForActiveShards = StringifiedInteger | WaitForActiveShardOptions export type WaitForEvents = 'immediate' | 'urgent' | 'high' | 'normal' | 'low' | 'languid' diff --git a/api/_types/_common.mapping.d.ts b/api/_types/_common.mapping.d.ts index 3758922ba..764dc01cb 100644 --- a/api/_types/_common.mapping.d.ts +++ b/api/_types/_common.mapping.d.ts @@ -119,7 +119,7 @@ export type DoubleRangeProperty = RangePropertyBase & { type: 'double_range'; } -export type DynamicMapping = 'false' | 'strict' | 'strict_allow_templates' | 'true' +export type DynamicMapping = 'false' | 'strict' | 'strict_allow_templates' | 'true' | boolean export type DynamicTemplate = { mapping?: Property; diff --git a/api/_types/_common.query_dsl.d.ts b/api/_types/_common.query_dsl.d.ts index 360e73926..4620524e1 100644 --- a/api/_types/_common.query_dsl.d.ts +++ b/api/_types/_common.query_dsl.d.ts @@ -555,6 +555,7 @@ export type QueryContainer = { span_or?: SpanOrQuery; span_term?: Record; span_within?: SpanWithinQuery; + template?: Record; term?: Record; terms?: TermsQuery; terms_set?: Record; @@ -745,20 +746,24 @@ export type TermQuery = Common.FieldValue | (QueryBase & { }) export type TermsLookup = { - id?: Common.Id; - index?: Common.IndexName; - path?: Common.Field; + id: Common.Id; + index: Common.IndexName; + path: Common.Field; routing?: Common.Routing; + store?: boolean; } export type TermsQuery = QueryBase & { _name?: any; boost?: any; + value_type?: TermsQueryValueType; [key: string]: any | TermsQueryField; } export type TermsQueryField = Common.FieldValue[] | TermsLookup +export type TermsQueryValueType = 'bitmap' | 'default' + export type TermsSetQuery = QueryBase & { minimum_should_match_field?: Common.Field; minimum_should_match_script?: Common.Script; diff --git a/api/_types/_core.bulk.d.ts b/api/_types/_core.bulk.d.ts index 2f136b2d6..56102c96d 100644 --- a/api/_types/_core.bulk.d.ts +++ b/api/_types/_core.bulk.d.ts @@ -19,18 +19,25 @@ import * as Core_Search from './_core.search' export type CreateOperation = WriteOperation -export type DeleteOperation = OperationBase +export type DeleteOperation = OperationBase & { + if_primary_term?: number; + if_seq_no?: Common.SequenceNumber; + version?: Common.VersionNumber; + version_type?: Common.VersionType; +} -export type IndexOperation = WriteOperation +export type IndexOperation = WriteOperation & { + if_primary_term?: number; + if_seq_no?: Common.SequenceNumber; + op_type?: Common.OpType; + version?: Common.VersionNumber; + version_type?: Common.VersionType; +} export type OperationBase = { _id?: Common.Id; _index?: Common.IndexName; - if_primary_term?: number; - if_seq_no?: Common.SequenceNumber; routing?: Common.Routing; - version?: Common.VersionNumber; - version_type?: Common.VersionType; } export type OperationContainer = { @@ -45,7 +52,7 @@ export type ResponseItem = { _index: string; _primary_term?: number; _seq_no?: Common.SequenceNumber; - _shards?: Common.ShardStatistics; + _shards?: Common.ShardInfo; _type?: string; _version?: Common.VersionNumber; error?: Common.ErrorCause; @@ -66,12 +73,13 @@ export type UpdateAction = { } export type UpdateOperation = OperationBase & { + if_primary_term?: number; + if_seq_no?: Common.SequenceNumber; require_alias?: boolean; retry_on_conflict?: number; } export type WriteOperation = OperationBase & { - dynamic_templates?: Record; pipeline?: string; require_alias?: boolean; } diff --git a/api/_types/_core.explain.d.ts b/api/_types/_core.explain.d.ts index 16092472a..7ca90dc6c 100644 --- a/api/_types/_core.explain.d.ts +++ b/api/_types/_core.explain.d.ts @@ -17,13 +17,7 @@ export type Explanation = { description: string; - details: ExplanationDetail[]; - value: number; -} - -export type ExplanationDetail = { - description: string; - details?: ExplanationDetail[]; + details: Explanation[]; value: number; } diff --git a/api/_types/_core.search.d.ts b/api/_types/_core.search.d.ts index 313db9aa1..210ac04ed 100644 --- a/api/_types/_core.search.d.ts +++ b/api/_types/_core.search.d.ts @@ -231,17 +231,17 @@ export type HighlightField = HighlightBase & { export type Hit = { _explanation?: Core_Explain.Explanation; - _id: Common.Id; + _id?: Common.Id; _ignored?: string[]; - _index: Common.IndexName; + _index?: Common.IndexName; _nested?: NestedIdentity; _node?: string; _primary_term?: number; _routing?: string; - _score?: undefined | number | string; + _score?: undefined | number; _seq_no?: Common.SequenceNumber; _shard?: string; - _source?: Record; + _source?: TDocument; _type?: Common.Type; _version?: Common.VersionNumber; fields?: Record; @@ -253,8 +253,10 @@ export type Hit = { } export type HitsMetadata = { - hits: Hit[]; - max_score?: undefined | number | string; + hits: Hit & { + _source?: T; +}[]; + max_score?: undefined | number; total?: TotalHits | number; } @@ -345,6 +347,16 @@ export type PointInTimeReference = { keep_alive?: Common.Duration; } +export type ProcessorExecutionDetail = { + duration_millis?: number; + error?: string; + input_data?: Record | Record[]; + output_data?: Record | Record[]; + processor_name?: string; + status?: string; + tag?: string; +} + export type Profile = { shards: ShardProfile[]; } @@ -397,10 +409,10 @@ export type ResponseBody = { aggregations?: Record; fields?: Record>; hits: HitsMetadata; - max_score?: number; num_reduce_phases?: number; phase_took?: Common.PhaseTook; pit_id?: Common.Id; + processor_results?: ProcessorExecutionDetail[]; profile?: Profile; suggest?: Record; terminated_early?: boolean; @@ -473,6 +485,10 @@ export type SuggestFuzziness = { export type SuggestSort = 'frequency' | 'score' +export type T = Record + +export type TDocument = Record + export type TermSuggest = SuggestBase & { options: TermSuggestOption | TermSuggestOption[]; } diff --git a/api/_types/asynchronous_search._common.d.ts b/api/_types/asynchronous_search._common.d.ts index b3ee30330..900ed8ee6 100644 --- a/api/_types/asynchronous_search._common.d.ts +++ b/api/_types/asynchronous_search._common.d.ts @@ -18,6 +18,7 @@ import * as Common from './_common' import * as Common_Aggregations from './_common.aggregations' import * as Common_QueryDsl from './_common.query_dsl' import * as Core_Search from './_core.search' +import * as Nodes_Common from './nodes._common' export type AsynchronousSearchStats = { cancelled?: number; @@ -77,8 +78,7 @@ export type Search = { version?: boolean; } -export type StatsResponse = { - _nodes?: Common.NodeStatistics; +export type StatsResponse = Nodes_Common.NodesResponseBase & { cluster_name?: string; nodes?: Record; } diff --git a/api/_types/cluster._common.d.ts b/api/_types/cluster._common.d.ts index 224868ee6..02f00d400 100644 --- a/api/_types/cluster._common.d.ts +++ b/api/_types/cluster._common.d.ts @@ -37,3 +37,5 @@ export type ComponentTemplateSummary = { version?: Common.VersionNumber; } +export type WaitForNodes = number | string + diff --git a/api/_types/geospatial._common.d.ts b/api/_types/geospatial._common.d.ts new file mode 100644 index 000000000..aaa15e89a --- /dev/null +++ b/api/_types/geospatial._common.d.ts @@ -0,0 +1,147 @@ +/* + * 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 * as Common from './_common' + +export type Database = { + fields?: string[]; + provider?: string; + sha256_hash?: string; + updated_at_in_epoch_millis?: Common.EpochTimeUnitMillis; + valid_for_in_days?: number; +} + +export type DataSource = { + database: Database; + endpoint: string; + name: Common.Name; + next_update_at_in_epoch_millis: Common.EpochTimeUnitMillis; + state: 'AVAILABLE' | 'CREATE_FAILED' | 'CREATING' | 'DELETING'; + update_interval_in_days: number; + update_stats: UpdateStats; +} + +export type Envelope = PointCoordinates[] + +export type GeoJSONData = { + geometry: Geometry; + properties?: Record; + type: 'Feature' | 'FeatureCollection'; +} + +export type GeoJSONRequest = { + data: GeoJSONData[]; + field?: string; + index: Common.IndexName; + type: 'geo_point' | 'geo_shape'; +} + +export type Geometry = GeoShapes | GeometryCollection + +export type GeometryCollection = { + geometries: Geometry[]; + type: 'GeometryCollection'; +} + +export type GeoShapes = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | Envelope + +export type GeoSpatialGeojsonUploadResponse = { + errors: boolean; + failure: number; + success: number; + took: Common.DurationValueUnitMillis; + total: number; +} + +export type GeoSpatialUploadStats = { + metrics: UploadStatsMetric[]; + total: UploadStatsTotal; +} + +export type GetDataSourceResponse = { + datasources: DataSource[]; +} + +export type LineString = { + coordinates: LineStringCoordinates; + type: 'LineString'; +} + +export type LineStringCoordinates = PointCoordinates[] + +export type MultiLineString = { + coordinates: MultiLineStringCoordinates; + type: 'MultiLineString'; +} + +export type MultiLineStringCoordinates = LineStringCoordinates[] + +export type MultiPoint = { + coordinates: MultiPointCoordinates; + type: 'MultiPoint'; +} + +export type MultiPointCoordinates = PointCoordinates[] + +export type MultiPolygon = { + coordinates: MultiPolygonCoordinates; + type: 'MultiPolygon'; +} + +export type MultiPolygonCoordinates = PolygonCoordinates[] + +export type Point = { + coordinates: PointCoordinates; + type: 'Point'; +} + +export type PointCoordinates = number[] + +export type Polygon = { + coordinates: PolygonCoordinates; + type: 'Polygon'; +} + +export type PolygonCoordinates = PointCoordinates[][] + +export type PutIP2GeoDataSourceRequest = { + endpoint?: string; + update_interval_in_days?: number; +} + +export type UpdateStats = { + last_processing_time_in_millis?: Common.EpochTimeUnitMillis; + last_succeeded_at_in_epoch_millis?: Common.EpochTimeUnitMillis; +} + +export type UploadStatsMetric = { + duration: Common.DurationValueUnitMillis; + failed: number; + id: Common.Id; + node_id: Common.NodeId; + success: number; + type: string; + upload: number; +} + +export type UploadStatsTotal = { + duration: Common.DurationValueUnitMillis; + failed: number; + request_count: number; + success: number; + upload: number; +} + diff --git a/api/_types/index.d.ts b/api/_types/index.d.ts index 9d26691d2..376db2465 100644 --- a/api/_types/index.d.ts +++ b/api/_types/index.d.ts @@ -74,6 +74,7 @@ import * as Cluster_WeightedRouting from './cluster.weighted_routing' import * as DanglingIndices_ListDanglingIndices from './dangling_indices.list_dangling_indices' import * as FlowFramework_Common from './flow_framework.common' import * as FlowFramework_Errors from './flow_framework.errors' +import * as Geospatial_Common from './geospatial._common' import * as Indices_Common from './indices._common' import * as Indices_AddBlock from './indices.add_block' import * as Indices_Analyze from './indices.analyze' @@ -99,6 +100,7 @@ import * as Ism_Common from './ism._common' import * as Knn_Common from './knn._common' import * as Ltr_Common from './ltr._common' import * as Ml_Common from './ml._common' +import * as Neural_Common from './neural._common' import * as Nodes_Common from './nodes._common' import * as Nodes_Info from './nodes.info' import * as Nodes_ReloadSecureSettings from './nodes.reload_secure_settings' @@ -111,6 +113,7 @@ import * as RemoteStore_Common from './remote_store._common' import * as Replication_Common from './replication._common' import * as Rollups_Common from './rollups._common' import * as SearchPipeline_Common from './search_pipeline._common' +import * as SearchRelevance_Common from './search_relevance._common' import * as Security_Common from './security._common' import * as Sm_Common from './sm._common' import * as Snapshot_Common from './snapshot._common' @@ -184,6 +187,7 @@ export { DanglingIndices_ListDanglingIndices, FlowFramework_Common, FlowFramework_Errors, + Geospatial_Common, Indices_Common, Indices_AddBlock, Indices_Analyze, @@ -209,6 +213,7 @@ export { Knn_Common, Ltr_Common, Ml_Common, + Neural_Common, Nodes_Common, Nodes_Info, Nodes_ReloadSecureSettings, @@ -221,6 +226,7 @@ export { Replication_Common, Rollups_Common, SearchPipeline_Common, + SearchRelevance_Common, Security_Common, Sm_Common, Snapshot_Common, diff --git a/api/_types/indices._common.d.ts b/api/_types/indices._common.d.ts index c6430cf55..dfe80cb81 100644 --- a/api/_types/indices._common.d.ts +++ b/api/_types/indices._common.d.ts @@ -37,6 +37,8 @@ export type AliasDefinition = { search_routing?: string; } +export type BuiltinStorageType = 'fs' | 'hybridfs' | 'mmapfs' | 'niofs' + export type DataStream = { _meta?: Common.Metadata; allow_custom_routing?: boolean; @@ -171,6 +173,7 @@ export type IndexSettingBlocks = { read?: Common.StringifiedBoolean; read_only?: Common.StringifiedBoolean; read_only_allow_delete?: Common.StringifiedBoolean; + search_only?: Common.StringifiedBoolean; write?: Common.StringifiedBoolean; } @@ -192,7 +195,7 @@ export type IndexSettings = { creation_date_string?: Common.DateTime; default_pipeline?: Common.PipelineName; final_pipeline?: Common.PipelineName; - format?: string | number; + format?: Common.StringifiedInteger; gc_deletes?: Common.Duration; hidden?: Common.StringifiedBoolean; highlight?: IndexSettingsHighlight; @@ -223,7 +226,7 @@ export type IndexSettings = { number_of_replicas?: Common.StringifiedInteger; number_of_routing_shards?: Common.StringifiedInteger; number_of_shards?: Common.StringifiedInteger; - priority?: number | string; + priority?: Common.StringifiedInteger; provided_name?: Common.Name; queries?: IndexSettingsQueries; query_string?: IndexSettingsQueryString; @@ -578,7 +581,7 @@ export type SoftDeletesRetention = { operations?: Common.StringifiedLong; } -export type StorageType = 'fs' | 'hybridfs' | 'mmapfs' | 'niofs' | string +export type StorageType = BuiltinStorageType | string export type TemplateMapping = { aliases: Record; diff --git a/api/_types/knn._common.d.ts b/api/_types/knn._common.d.ts index c13231dd8..6dfabaea6 100644 --- a/api/_types/knn._common.d.ts +++ b/api/_types/knn._common.d.ts @@ -15,6 +15,7 @@ */ import * as Common from './_common' +import * as Nodes_Common from './nodes._common' export type DeletedModel = { model_id: string; @@ -84,8 +85,7 @@ export type NodeStats = { training_requests?: number; } -export type Stats = { - _nodes?: Common.NodeStatistics; +export type Stats = Nodes_Common.NodesResponseBase & { circuit_breaker_triggered?: boolean; cluster_name?: Common.Name; model_index_status?: Common.HealthStatus | undefined; diff --git a/api/_types/ltr._common.d.ts b/api/_types/ltr._common.d.ts index 648916895..f25759da3 100644 --- a/api/_types/ltr._common.d.ts +++ b/api/_types/ltr._common.d.ts @@ -15,6 +15,25 @@ */ import * as Common from './_common' +import * as Nodes_Common from './nodes._common' + +export type AcknowledgedResponse = { + acknowledged?: boolean; + index?: string; + shards_acknowledged?: boolean; +} + +export type CacheAllStats = { + features?: CacheItemStats; + featuresets?: CacheItemStats; + models?: CacheItemStats; + total?: CacheItemStats; +} + +export type CacheItemStats = { + count?: number; + ram?: number; +} export type CacheStat = { entry_count?: number; @@ -30,20 +49,55 @@ export type CacheStats = { model?: CacheStat; } +export type CacheStatsResponse = { + _nodes?: Common.NodeStatistics; + all?: CacheAllStats; + cluster_name?: Common.Name; + nodes?: Record; + stores?: Record; +} + +export type ListStoresResponse = { + stores: Record; +} + +export type NodeDetails = { + hostname?: string; + name?: string; + stats?: NodeStatsDetails; +} + export type NodeStats = { cache?: CacheStats; request_error_count?: number; request_total_count?: number; } -export type Stats = { - _nodes?: Common.NodeStatistics; +export type NodeStatsDetails = { + features?: CacheItemStats; + featuresets?: CacheItemStats; + models?: CacheItemStats; + total?: CacheItemStats; +} + +export type Stats = Nodes_Common.NodesResponseBase & { cluster_name?: Common.Name; nodes?: Record; status?: string; stores?: StoreStats; } +export type StoreDetails = { + counts?: Record; + index?: string; + store?: string; + version?: number; +} + +export type StoreExistsResponse = { + exists?: boolean; +} + export type StoreStat = { feature_count?: number; featureset_count?: number; diff --git a/api/_types/ml._common.d.ts b/api/_types/ml._common.d.ts index 7109de8e1..3246bdde7 100644 --- a/api/_types/ml._common.d.ts +++ b/api/_types/ml._common.d.ts @@ -629,13 +629,22 @@ export type Term = { } export type Tool = { + attributes?: ToolAttributes; description?: string; name?: Common.Name; type?: string; version?: Common.VersionString; } +export type ToolAttributes = { + input_schema?: string; + strict?: boolean; + [key: string]: any | Record; +} + export type ToolItems = { + attributes?: ToolAttributes; + description?: string; include_output_in_agent_response?: boolean; name?: string; parameters?: Parameters; diff --git a/api/_types/neural._common.d.ts b/api/_types/neural._common.d.ts new file mode 100644 index 000000000..1bd07c759 --- /dev/null +++ b/api/_types/neural._common.d.ts @@ -0,0 +1,87 @@ +/* + * 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 * as Nodes_Common from './nodes._common' + +export type FlatNeuralInfoStats = { + cluster_version?: InfoStringStat; + 'processors.ingest.text_embedding_processors_in_pipelines'?: InfoCounterStat; +} + +export type FlatNeuralNodeStats = { + 'processors.ingest.text_embedding_executions'?: TimestampedEventCounterStat; +} + +export type FlatNeuralStats = Nodes_Common.NodesResponseBase & { + all_nodes?: FlatNeuralNodeStats; + cluster_name?: string; + info?: FlatNeuralInfoStats; + nodes?: Record; +} + +export type InfoCounterStat = number | (StatMetadata & { + stat_type?: 'info_counter'; +}) + +export type InfoStringStat = string | (StatMetadata & { + stat_type?: 'info_string'; +}) + +export type NestedNeuralInfoStats = { + cluster_version?: InfoStringStat; + processors?: NestedNeuralInfoStatsProcessors; +} + +export type NestedNeuralInfoStatsProcessors = { + ingest?: NestedNeuralInfoStatsProcessorsIngest; +} + +export type NestedNeuralInfoStatsProcessorsIngest = { + text_embedding_processors_in_pipelines?: InfoCounterStat; +} + +export type NestedNeuralNodeStats = { + processors?: NestedNeuralNodeStatsProcessors; +} + +export type NestedNeuralNodeStatsProcessors = { + ingest?: NestedNeuralNodeStatsProcessorsIngest; +} + +export type NestedNeuralNodeStatsProcessorsIngest = { + text_embedding_executions?: TimestampedEventCounterStat; +} + +export type NestedNeuralStats = Nodes_Common.NodesResponseBase & { + all_nodes?: NestedNeuralNodeStats; + cluster_name?: string; + info?: NestedNeuralInfoStats; + nodes?: Record; +} + +export type NeuralStats = NestedNeuralStats | FlatNeuralStats + +export type StatMetadata = { + stat_type: 'info_counter' | 'info_string' | 'timestamped_event_counter'; + value: number | string; +} + +export type TimestampedEventCounterStat = number | (StatMetadata & { + minutes_since_last_event?: number; + stat_type?: 'timestamped_event_counter'; + trailing_interval_value?: number; +}) + diff --git a/api/_types/nodes._common.d.ts b/api/_types/nodes._common.d.ts index 8d7a894c9..131242e62 100644 --- a/api/_types/nodes._common.d.ts +++ b/api/_types/nodes._common.d.ts @@ -20,5 +20,5 @@ export type NodesResponseBase = { _nodes?: Common.NodeStatistics; } -export type SampleType = 'block' | 'cpu' | 'wait' +export type SampleType = string diff --git a/api/_types/nodes.stats.d.ts b/api/_types/nodes.stats.d.ts index c8a012af6..506f03db2 100644 --- a/api/_types/nodes.stats.d.ts +++ b/api/_types/nodes.stats.d.ts @@ -583,6 +583,7 @@ export type ShardSegmentReplicationBackpressureStats = { export type ShardTaskCancellationStats = { search_shard_task?: ShardTaskCancellationStatsDetail; + search_task?: ShardTaskCancellationStatsDetail; } export type ShardTaskCancellationStatsDetail = { diff --git a/api/_types/search_pipeline._common.d.ts b/api/_types/search_pipeline._common.d.ts index 11a6e0341..7beef9c7c 100644 --- a/api/_types/search_pipeline._common.d.ts +++ b/api/_types/search_pipeline._common.d.ts @@ -73,6 +73,8 @@ export type PersonalizeSearchRankingResponseProcessor = { export type PhaseResultsProcessor = { 'normalization-processor': NormalizationPhaseResultsProcessor; +} | { + 'score-ranker-processor': ScoreRankerPhaseResultsProcessor; } export type RenameFieldResponseProcessor = { @@ -133,10 +135,14 @@ export type RetrievalAugmentedGenerationResponseProcessor = { } export type ScoreCombination = { - parameters?: number[]; + parameters?: ScoreCombinationParameters; technique?: ScoreCombinationTechnique; } +export type ScoreCombinationParameters = { + weights?: number[]; +} + export type ScoreCombinationTechnique = 'arithmetic_mean' | 'geometric_mean' | 'harmonic_mean' export type ScoreNormalization = { @@ -145,9 +151,21 @@ export type ScoreNormalization = { export type ScoreNormalizationTechnique = 'l2' | 'min_max' +export type ScoreRankerCombination = { + rank_constant?: number; + technique: ScoreRankerCombinationTechnique; +} + +export type ScoreRankerCombinationTechnique = 'rrf' + +export type ScoreRankerPhaseResultsProcessor = { + combination: ScoreRankerCombination; +} + export type SearchPipelineMap = Record export type SearchPipelineStructure = { + description?: string; phase_results_processors?: PhaseResultsProcessor[]; request_processors?: RequestProcessor[]; response_processors?: ResponseProcessor[]; diff --git a/api/_types/search_relevance._common.d.ts b/api/_types/search_relevance._common.d.ts new file mode 100644 index 000000000..6b07b1911 --- /dev/null +++ b/api/_types/search_relevance._common.d.ts @@ -0,0 +1,64 @@ +/* + * 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 Experiment = { + id?: string; + judgmentList?: string[]; + querySetId?: string; + results?: Record; + searchConfigurationList?: string[]; + size?: number; + status?: string; + timestamp?: string; + type?: string; +} + +export type GenericObject = { + _shards?: Record; + hits?: Record; + timed_out?: boolean; + took?: number; +} + +export type Judgment = { + id?: string; + judgmentScores?: Record; + metadata?: Record; + name?: string; + status?: string; + timestamp?: string; + type?: string; +} + +export type QuerySet = { + description?: string; + id?: string; + name?: string; + querySetQueries?: Record; + sampling?: string; + timestamp?: string; +} + +export type SearchConfiguration = { + id?: string; + index?: string; + name?: string; + query?: string; + searchPipeline?: string; + timestamp?: string; +} + diff --git a/api/_types/security._common.d.ts b/api/_types/security._common.d.ts index d6420aa0d..6ff6b702c 100644 --- a/api/_types/security._common.d.ts +++ b/api/_types/security._common.d.ts @@ -14,6 +14,7 @@ * modify the API generator. */ +import * as Nodes_Common from './nodes._common' export type AccountDetails = { backend_roles?: string[]; @@ -40,7 +41,7 @@ export type ActionGroupsMap = Record export type AllowListConfig = { enabled?: boolean; - requests?: Record; + requests?: Record; } export type AuditConfig = { @@ -80,18 +81,12 @@ export type AuthInfo = { size_of_custom_attributes?: string; size_of_user?: string; sso_logout_url?: undefined | string; - tenants?: Record; + tenants?: Record; user?: string; user_name?: string; user_requested_tenant?: undefined | string; } -export type CertificateCountPerNode = { - failed?: number; - successful?: number; - total?: number; -} - export type CertificatesDetail = { issuer_dn?: string; not_after?: string; @@ -204,8 +199,7 @@ export type GetCertificates = { transport_certificates_list?: CertificatesDetail[]; } -export type GetCertificatesNew = { - _nodes?: Record; +export type GetCertificatesNew = Nodes_Common.NodesResponseBase & { cluster_name?: string; nodes?: Record; } @@ -252,10 +246,8 @@ export type PatchOperation = { value?: Record; } -export type PatchOperations = PatchOperation[] - export type PermissionsInfo = { - disabled_endpoints?: Record; + disabled_endpoints?: Record; has_api_access?: boolean; user?: string; user_name?: string; @@ -295,12 +287,12 @@ export type SSLInfo = { peer_certificates_list?: string[]; principal: undefined | string; ssl_cipher: undefined | string; - ssl_openssl_available: boolean; - ssl_openssl_non_available_cause: undefined | string; - ssl_openssl_supports_hostname_validation: boolean; - ssl_openssl_supports_key_manager_factory: boolean; - ssl_openssl_version: number | string; - ssl_openssl_version_string: undefined | string; + ssl_openssl_available?: boolean; + ssl_openssl_non_available_cause?: undefined | string; + ssl_openssl_supports_hostname_validation?: boolean; + ssl_openssl_supports_key_manager_factory?: boolean; + ssl_openssl_version?: number | string; + ssl_openssl_version_string?: undefined | string; ssl_protocol: undefined | string; ssl_provider_http: undefined | string; ssl_provider_transport_client: string; @@ -325,13 +317,13 @@ export type TenantsMap = Record export type UpgradeCheck = { status?: string; - upgradeActions?: Record; + upgradeActions?: Record>; upgradeAvailable?: boolean; } export type UpgradePerform = { status?: string; - upgrades?: Record; + upgrades?: Record>; } export type User = { diff --git a/api/cluster/existsComponentTemplate.js b/api/cluster/existsComponentTemplate.js index b4f90bfde..f235aae9a 100644 --- a/api/cluster/existsComponentTemplate.js +++ b/api/cluster/existsComponentTemplate.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). - * @param {boolean} [params.local=false] - When `true`, the request retrieves information from the local node only. When `false, information is retrieved from the cluster manager node. + * @param {boolean} [params.local=false] - When `true`, the request retrieves information from the local node only. When `false`, information is retrieved from the cluster manager node. * @param {string} [params.master_timeout] DEPRECATED - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts `0` without a unit and `-1` to indicate an unspecified value. * @param {string} params.name - The name of the component template. Wildcard (*) expressions are supported. * diff --git a/api/cluster/health.d.ts b/api/cluster/health.d.ts index 22729f6c0..968afff86 100644 --- a/api/cluster/health.d.ts +++ b/api/cluster/health.d.ts @@ -15,6 +15,7 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Cluster_Common from '../_types/cluster._common' import * as Cluster_Health from '../_types/cluster.health' import * as Common from '../_types/_common' import * as Global from '../_types/_global' @@ -32,7 +33,7 @@ export interface Cluster_Health_Request extends Global.Params { wait_for_events?: Common.WaitForEvents; wait_for_no_initializing_shards?: boolean; wait_for_no_relocating_shards?: boolean; - wait_for_nodes?: string | number; + wait_for_nodes?: Cluster_Common.WaitForNodes; wait_for_status?: Common.HealthStatus; } diff --git a/api/danglingIndices/listDanglingIndices.d.ts b/api/danglingIndices/listDanglingIndices.d.ts index 58e009145..744d7df81 100644 --- a/api/danglingIndices/listDanglingIndices.d.ts +++ b/api/danglingIndices/listDanglingIndices.d.ts @@ -18,6 +18,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Common from '../_types/_common' import * as DanglingIndices_ListDanglingIndices from '../_types/dangling_indices.list_dangling_indices' import * as Global from '../_types/_global' +import * as Nodes_Common from '../_types/nodes._common' export type DanglingIndices_ListDanglingIndices_Request = Global.Params & Record @@ -25,8 +26,7 @@ export interface DanglingIndices_ListDanglingIndices_Response extends ApiRespons body: DanglingIndices_ListDanglingIndices_ResponseBody; } -export type DanglingIndices_ListDanglingIndices_ResponseBody = { - _nodes?: Common.NodeStatistics; +export interface DanglingIndices_ListDanglingIndices_ResponseBody extends Nodes_Common.NodesResponseBase { cluster_name?: Common.Name; dangling_indices: DanglingIndices_ListDanglingIndices.DanglingIndex[]; } diff --git a/api/geospatial/_api.js b/api/geospatial/_api.js new file mode 100644 index 000000000..372eb0b24 --- /dev/null +++ b/api/geospatial/_api.js @@ -0,0 +1,46 @@ +/* + * 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-Geospatial */ + +function GeospatialApi(bindObj) { + this.deleteIp2GeoDatasource = require('./deleteIp2GeoDatasource').bind(bindObj); + this.geojsonUploadPost = require('./geojsonUploadPost').bind(bindObj); + this.geojsonUploadPut = require('./geojsonUploadPut').bind(bindObj); + this.getIp2GeoDatasource = require('./getIp2GeoDatasource').bind(bindObj); + this.getUploadStats = require('./getUploadStats').bind(bindObj); + this.putIp2GeoDatasource = require('./putIp2GeoDatasource').bind(bindObj); + this.putIp2GeoDatasourceSettings = require('./putIp2GeoDatasourceSettings').bind(bindObj); + + // Deprecated: Use deleteIp2GeoDatasource instead. + this.delete_ip2geo_datasource = require('./deleteIp2GeoDatasource').bind(bindObj); + // Deprecated: Use geojsonUploadPost instead. + this.geojson_upload_post = require('./geojsonUploadPost').bind(bindObj); + // Deprecated: Use geojsonUploadPut instead. + this.geojson_upload_put = require('./geojsonUploadPut').bind(bindObj); + // Deprecated: Use getIp2GeoDatasource instead. + this.get_ip2geo_datasource = require('./getIp2GeoDatasource').bind(bindObj); + // Deprecated: Use getUploadStats instead. + this.get_upload_stats = require('./getUploadStats').bind(bindObj); + // Deprecated: Use putIp2GeoDatasource instead. + this.put_ip2geo_datasource = require('./putIp2GeoDatasource').bind(bindObj); + // Deprecated: Use putIp2GeoDatasourceSettings instead. + this.put_ip2geo_datasource_settings = require('./putIp2GeoDatasourceSettings').bind(bindObj); +} + +module.exports = GeospatialApi; diff --git a/api/geospatial/deleteIp2GeoDatasource.d.ts b/api/geospatial/deleteIp2GeoDatasource.d.ts new file mode 100644 index 000000000..a6182fb11 --- /dev/null +++ b/api/geospatial/deleteIp2GeoDatasource.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 Common from '../_types/_common' +import * as Global from '../_types/_global' + +export interface Geospatial_DeleteIp2GeoDatasource_Request extends Global.Params { + name: string; +} + +export interface Geospatial_DeleteIp2GeoDatasource_Response extends ApiResponse { + body: Geospatial_DeleteIp2GeoDatasource_ResponseBody; +} + +export type Geospatial_DeleteIp2GeoDatasource_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/geospatial/deleteIp2GeoDatasource.js b/api/geospatial/deleteIp2GeoDatasource.js new file mode 100644 index 000000000..21149bfb3 --- /dev/null +++ b/api/geospatial/deleteIp2GeoDatasource.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'); + +/** + * Delete a specific IP2Geo data source. + *
See Also: {@link https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#deleting-the-ip2geo-data-source - geospatial.delete_ip2geo_datasource} + * + * @memberOf API-Geospatial + * + * @param {object} params + * @param {string} params.name + * + * @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 deleteIp2GeoDatasourceFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.name == null) return handleMissingParam('name', this, callback); + + let { body, name, ...querystring } = params; + name = parsePathParam(name); + + const path = '/_plugins/geospatial/ip2geo/datasource/' + name; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteIp2GeoDatasourceFunc; diff --git a/api/geospatial/geojsonUploadPost.d.ts b/api/geospatial/geojsonUploadPost.d.ts new file mode 100644 index 000000000..68a3bc1e6 --- /dev/null +++ b/api/geospatial/geojsonUploadPost.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 Geospatial_Common from '../_types/geospatial._common' +import * as Global from '../_types/_global' + +export interface Geospatial_GeojsonUploadPost_Request extends Global.Params { + body: Geospatial_Common.GeoJSONRequest; +} + +export interface Geospatial_GeojsonUploadPost_Response extends ApiResponse { + body: Geospatial_GeojsonUploadPost_ResponseBody; +} + +export type Geospatial_GeojsonUploadPost_ResponseBody = Geospatial_Common.GeoSpatialGeojsonUploadResponse + diff --git a/api/geospatial/geojsonUploadPost.js b/api/geospatial/geojsonUploadPost.js new file mode 100644 index 000000000..586c4f7d0 --- /dev/null +++ b/api/geospatial/geojsonUploadPost.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, handleMissingParam } = require('../utils'); + +/** + * Use an OpenSearch query to upload `GeoJSON`, operation will fail if index exists. +- When type is `geo_point`, only Point geometry is allowed +- When type is `geo_shape`, all geometry types are allowed (Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Envelope). + *
See Also: {@link undefined - geospatial.geojson_upload_post} + * + * @memberOf API-Geospatial + * + * @param {object} params + * @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 geojsonUploadPostFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/geospatial/geojson/_upload'; + const method = 'POST'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = geojsonUploadPostFunc; diff --git a/api/geospatial/geojsonUploadPut.d.ts b/api/geospatial/geojsonUploadPut.d.ts new file mode 100644 index 000000000..89f3c7a69 --- /dev/null +++ b/api/geospatial/geojsonUploadPut.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 Geospatial_Common from '../_types/geospatial._common' +import * as Global from '../_types/_global' + +export interface Geospatial_GeojsonUploadPut_Request extends Global.Params { + body: Geospatial_Common.GeoJSONRequest; +} + +export interface Geospatial_GeojsonUploadPut_Response extends ApiResponse { + body: Geospatial_GeojsonUploadPut_ResponseBody; +} + +export type Geospatial_GeojsonUploadPut_ResponseBody = Geospatial_Common.GeoSpatialGeojsonUploadResponse + diff --git a/api/geospatial/geojsonUploadPut.js b/api/geospatial/geojsonUploadPut.js new file mode 100644 index 000000000..7eab590cb --- /dev/null +++ b/api/geospatial/geojsonUploadPut.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, handleMissingParam } = require('../utils'); + +/** + * Use an OpenSearch query to upload `GeoJSON` regardless if index exists. +- When type is `geo_point`, only Point geometry is allowed +- When type is `geo_shape`, all geometry types are allowed (Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Envelope). + *
See Also: {@link undefined - geospatial.geojson_upload_put} + * + * @memberOf API-Geospatial + * + * @param {object} params + * @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 geojsonUploadPutFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/geospatial/geojson/_upload'; + const method = 'PUT'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = geojsonUploadPutFunc; diff --git a/api/geospatial/getIp2GeoDatasource.d.ts b/api/geospatial/getIp2GeoDatasource.d.ts new file mode 100644 index 000000000..f56efabe3 --- /dev/null +++ b/api/geospatial/getIp2GeoDatasource.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 Common from '../_types/_common' +import * as Geospatial_Common from '../_types/geospatial._common' +import * as Global from '../_types/_global' + +export interface Geospatial_GetIp2GeoDatasource_Request extends Global.Params { + name?: Common.StringOrStringArray; +} + +export interface Geospatial_GetIp2GeoDatasource_Response extends ApiResponse { + body: Geospatial_GetIp2GeoDatasource_ResponseBody; +} + +export type Geospatial_GetIp2GeoDatasource_ResponseBody = Geospatial_Common.GetDataSourceResponse + diff --git a/api/geospatial/getIp2GeoDatasource.js b/api/geospatial/getIp2GeoDatasource.js new file mode 100644 index 000000000..937e9ced9 --- /dev/null +++ b/api/geospatial/getIp2GeoDatasource.js @@ -0,0 +1,48 @@ +/* + * 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 } = require('../utils'); + +/** + * Get one or more IP2Geo data sources, defaulting to returning all if no names specified. + *
See Also: {@link https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#sending-a-get-request - geospatial.get_ip2geo_datasource} + * + * @memberOf API-Geospatial + * + * @param {object} [params] + * @param {string} [params.name] + * + * @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 getIp2GeoDatasourceFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, name, ...querystring } = params; + name = parsePathParam(name); + + const path = ['/_plugins/geospatial/ip2geo/datasource', name].filter(c => c != null).join('/'); + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getIp2GeoDatasourceFunc; diff --git a/api/geospatial/getUploadStats.d.ts b/api/geospatial/getUploadStats.d.ts new file mode 100644 index 000000000..6e93c2033 --- /dev/null +++ b/api/geospatial/getUploadStats.d.ts @@ -0,0 +1,28 @@ +/* + * 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 Geospatial_Common from '../_types/geospatial._common' +import * as Global from '../_types/_global' + +export type Geospatial_GetUploadStats_Request = Global.Params & Record + +export interface Geospatial_GetUploadStats_Response extends ApiResponse { + body: Geospatial_GetUploadStats_ResponseBody; +} + +export type Geospatial_GetUploadStats_ResponseBody = Geospatial_Common.GeoSpatialUploadStats + diff --git a/api/geospatial/getUploadStats.js b/api/geospatial/getUploadStats.js new file mode 100644 index 000000000..119f41c97 --- /dev/null +++ b/api/geospatial/getUploadStats.js @@ -0,0 +1,45 @@ +/* + * 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 statistics for all geospatial uploads. + *
See Also: {@link undefined - geospatial.get_upload_stats} + * + * @memberOf API-Geospatial + * + * @param {object} [params] - (Unused) + * @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 getUploadStatsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/geospatial/_upload/stats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getUploadStatsFunc; diff --git a/api/geospatial/putIp2GeoDatasource.d.ts b/api/geospatial/putIp2GeoDatasource.d.ts new file mode 100644 index 000000000..ba34c3aee --- /dev/null +++ b/api/geospatial/putIp2GeoDatasource.d.ts @@ -0,0 +1,32 @@ +/* + * 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 Common from '../_types/_common' +import * as Geospatial_Common from '../_types/geospatial._common' +import * as Global from '../_types/_global' + +export interface Geospatial_PutIp2GeoDatasource_Request extends Global.Params { + body?: Geospatial_Common.PutIP2GeoDataSourceRequest; + name: string; +} + +export interface Geospatial_PutIp2GeoDatasource_Response extends ApiResponse { + body: Geospatial_PutIp2GeoDatasource_ResponseBody; +} + +export type Geospatial_PutIp2GeoDatasource_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/geospatial/putIp2GeoDatasource.js b/api/geospatial/putIp2GeoDatasource.js new file mode 100644 index 000000000..8c59ae2c5 --- /dev/null +++ b/api/geospatial/putIp2GeoDatasource.js @@ -0,0 +1,53 @@ +/* + * 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'); + +/** + * Create a specific IP2Geo data source. +Default values: + - `endpoint`: `"https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json"` + - `update_interval_in_days`: 3. + *
See Also: {@link https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#data-source-options - geospatial.put_ip2geo_datasource} + * + * @memberOf API-Geospatial + * + * @param {object} params + * @param {string} params.name + * @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 putIp2GeoDatasourceFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.name == null) return handleMissingParam('name', this, callback); + + let { body, name, ...querystring } = params; + name = parsePathParam(name); + + const path = '/_plugins/geospatial/ip2geo/datasource/' + name; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putIp2GeoDatasourceFunc; diff --git a/api/geospatial/putIp2GeoDatasourceSettings.d.ts b/api/geospatial/putIp2GeoDatasourceSettings.d.ts new file mode 100644 index 000000000..80e3d2b5e --- /dev/null +++ b/api/geospatial/putIp2GeoDatasourceSettings.d.ts @@ -0,0 +1,32 @@ +/* + * 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 Common from '../_types/_common' +import * as Geospatial_Common from '../_types/geospatial._common' +import * as Global from '../_types/_global' + +export interface Geospatial_PutIp2GeoDatasourceSettings_Request extends Global.Params { + body: Geospatial_Common.PutIP2GeoDataSourceRequest; + name: string; +} + +export interface Geospatial_PutIp2GeoDatasourceSettings_Response extends ApiResponse { + body: Geospatial_PutIp2GeoDatasourceSettings_ResponseBody; +} + +export type Geospatial_PutIp2GeoDatasourceSettings_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/geospatial/putIp2GeoDatasourceSettings.js b/api/geospatial/putIp2GeoDatasourceSettings.js new file mode 100644 index 000000000..cc8f3e225 --- /dev/null +++ b/api/geospatial/putIp2GeoDatasourceSettings.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'); + +/** + * Update a specific IP2Geo data source. + *
See Also: {@link https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#updating-an-ip2geo-data-source - geospatial.put_ip2geo_datasource_settings} + * + * @memberOf API-Geospatial + * + * @param {object} params + * @param {string} params.name + * @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 putIp2GeoDatasourceSettingsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.name == null) return handleMissingParam('name', this, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, name, ...querystring } = params; + name = parsePathParam(name); + + const path = '/_plugins/geospatial/ip2geo/datasource/' + name + '/_settings'; + const method = 'PUT'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putIp2GeoDatasourceSettingsFunc; diff --git a/api/index.d.ts b/api/index.d.ts index 84e5fc406..0439ef1f4 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'; @@ -162,6 +162,15 @@ import { Insights_TopQueries_Request, Insights_TopQueries_Response, Insights_Top import { List_Help_Request, List_Help_Response, List_Help_ResponseBody } from './list/help'; import { List_Indices_Request, List_Indices_Response, List_Indices_ResponseBody } from './list/indices'; import { List_Shards_Request, List_Shards_Response, List_Shards_ResponseBody } from './list/shards'; +import { Ltr_DeleteDefaultStore_Request, Ltr_DeleteDefaultStore_Response, Ltr_DeleteDefaultStore_ResponseBody } from './ltr/deleteDefaultStore'; +import { Ltr_ListStores_Request, Ltr_ListStores_Response, Ltr_ListStores_ResponseBody } from './ltr/listStores'; +import { Ltr_CreateDefaultStore_Request, Ltr_CreateDefaultStore_Response, Ltr_CreateDefaultStore_ResponseBody } from './ltr/createDefaultStore'; +import { Ltr_CacheStats_Request, Ltr_CacheStats_Response, Ltr_CacheStats_ResponseBody } from './ltr/cacheStats'; +import { Ltr_ClearCache_Request, Ltr_ClearCache_Response, Ltr_ClearCache_ResponseBody } from './ltr/clearCache'; +import { Ltr_DeleteStore_Request, Ltr_DeleteStore_Response, Ltr_DeleteStore_ResponseBody } from './ltr/deleteStore'; +import { Ltr_GetStore_Request, Ltr_GetStore_Response, Ltr_GetStore_ResponseBody } from './ltr/getStore'; +import { Ltr_CreateStore_Request, Ltr_CreateStore_Response, Ltr_CreateStore_ResponseBody } from './ltr/createStore'; +import { Ltr_Stats_Request, Ltr_Stats_Response, Ltr_Stats_ResponseBody } from './ltr/stats'; import { Nodes_Info_Request, Nodes_Info_Response, Nodes_Info_ResponseBody } from './nodes/info'; import { Nodes_HotThreads_Request, Nodes_HotThreads_Response, Nodes_HotThreads_ResponseBody } from './nodes/hotThreads'; import { Nodes_ReloadSecureSettings_Request, Nodes_ReloadSecureSettings_RequestBody, Nodes_ReloadSecureSettings_Response, Nodes_ReloadSecureSettings_ResponseBody } from './nodes/reloadSecureSettings'; @@ -201,7 +210,7 @@ import { Security_GetDistinguishedNames_Request, Security_GetDistinguishedNames_ import { Security_PatchDistinguishedNames_Request, Security_PatchDistinguishedNames_RequestBody, Security_PatchDistinguishedNames_Response, Security_PatchDistinguishedNames_ResponseBody } from './security/patchDistinguishedNames'; import { Security_DeleteDistinguishedName_Request, Security_DeleteDistinguishedName_Response, Security_DeleteDistinguishedName_ResponseBody } from './security/deleteDistinguishedName'; import { Security_GetDistinguishedName_Request, Security_GetDistinguishedName_Response, Security_GetDistinguishedName_ResponseBody } from './security/getDistinguishedName'; -import { Security_PatchDistinguishedName_Request, Security_PatchDistinguishedName_Response, Security_PatchDistinguishedName_ResponseBody } from './security/patchDistinguishedName'; +import { Security_PatchDistinguishedName_Request, Security_PatchDistinguishedName_RequestBody, Security_PatchDistinguishedName_Response, Security_PatchDistinguishedName_ResponseBody } from './security/patchDistinguishedName'; import { Security_UpdateDistinguishedName_Request, Security_UpdateDistinguishedName_Response, Security_UpdateDistinguishedName_ResponseBody } from './security/updateDistinguishedName'; import { Security_GetPermissionsInfo_Request, Security_GetPermissionsInfo_Response, Security_GetPermissionsInfo_ResponseBody } from './security/getPermissionsInfo'; import { Security_GetRoles_Request, Security_GetRoles_Response, Security_GetRoles_ResponseBody } from './security/getRoles'; @@ -275,7 +284,6 @@ import { Knn_TrainModel_Request, Knn_TrainModel_Response, Knn_TrainModel_Respons 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 { Ltr_Stats_Request, Ltr_Stats_Response, Ltr_Stats_ResponseBody } from './ltr/stats'; import { Ml_ExecuteAlgorithm_Request, Ml_ExecuteAlgorithm_RequestBody, Ml_ExecuteAlgorithm_Response, Ml_ExecuteAlgorithm_ResponseBody } from './ml/executeAlgorithm'; import { Ml_Predict_Request, Ml_Predict_RequestBody, Ml_Predict_Response, Ml_Predict_ResponseBody } from './ml/predict'; import { Ml_TrainPredict_Request, Ml_TrainPredict_RequestBody, Ml_TrainPredict_Response, Ml_TrainPredict_ResponseBody } from './ml/trainPredict'; @@ -335,6 +343,7 @@ import { Ml_DeleteTask_Request, Ml_DeleteTask_Response, Ml_DeleteTask_ResponseBo import { Ml_GetTask_Request, Ml_GetTask_Response, Ml_GetTask_ResponseBody } from './ml/getTask'; import { Ml_GetAllTools_Request, Ml_GetAllTools_Response, Ml_GetAllTools_ResponseBody } from './ml/getAllTools'; import { Ml_GetTool_Request, Ml_GetTool_Response, Ml_GetTool_ResponseBody } from './ml/getTool'; +import { Neural_Stats_Request, Neural_Stats_Response, Neural_Stats_ResponseBody } from './neural/stats'; import { Notifications_ListChannels_Request, Notifications_ListChannels_Response, Notifications_ListChannels_ResponseBody } from './notifications/listChannels'; import { Notifications_DeleteConfigs_Request, Notifications_DeleteConfigs_Response, Notifications_DeleteConfigs_ResponseBody } from './notifications/deleteConfigs'; import { Notifications_GetConfigs_Request, Notifications_GetConfigs_RequestBody, Notifications_GetConfigs_Response, Notifications_GetConfigs_ResponseBody } from './notifications/getConfigs'; @@ -399,6 +408,26 @@ import { Transforms_Put_Request, Transforms_Put_Response, Transforms_Put_Respons import { Transforms_Explain_Request, Transforms_Explain_Response, Transforms_Explain_ResponseBody } from './transforms/explain'; import { Transforms_Start_Request, Transforms_Start_Response, Transforms_Start_ResponseBody } from './transforms/start'; import { Transforms_Stop_Request, Transforms_Stop_Response, Transforms_Stop_ResponseBody } from './transforms/stop'; +import { Geospatial_GetUploadStats_Request, Geospatial_GetUploadStats_Response, Geospatial_GetUploadStats_ResponseBody } from './geospatial/getUploadStats'; +import { Geospatial_GeojsonUploadPost_Request, Geospatial_GeojsonUploadPost_Response, Geospatial_GeojsonUploadPost_ResponseBody } from './geospatial/geojsonUploadPost'; +import { Geospatial_GeojsonUploadPut_Request, Geospatial_GeojsonUploadPut_Response, Geospatial_GeojsonUploadPut_ResponseBody } from './geospatial/geojsonUploadPut'; +import { Geospatial_GetIp2GeoDatasource_Request, Geospatial_GetIp2GeoDatasource_Response, Geospatial_GetIp2GeoDatasource_ResponseBody } from './geospatial/getIp2GeoDatasource'; +import { Geospatial_DeleteIp2GeoDatasource_Request, Geospatial_DeleteIp2GeoDatasource_Response, Geospatial_DeleteIp2GeoDatasource_ResponseBody } from './geospatial/deleteIp2GeoDatasource'; +import { Geospatial_PutIp2GeoDatasource_Request, Geospatial_PutIp2GeoDatasource_Response, Geospatial_PutIp2GeoDatasource_ResponseBody } from './geospatial/putIp2GeoDatasource'; +import { Geospatial_PutIp2GeoDatasourceSettings_Request, Geospatial_PutIp2GeoDatasourceSettings_Response, Geospatial_PutIp2GeoDatasourceSettings_ResponseBody } from './geospatial/putIp2GeoDatasourceSettings'; +import { SearchRelevance_GetExperiments_Request, SearchRelevance_GetExperiments_Response, SearchRelevance_GetExperiments_ResponseBody } from './searchRelevance/getExperiments'; +import { SearchRelevance_PutExperiments_Request, SearchRelevance_PutExperiments_RequestBody, SearchRelevance_PutExperiments_Response, SearchRelevance_PutExperiments_ResponseBody } from './searchRelevance/putExperiments'; +import { SearchRelevance_DeleteExperiments_Request, SearchRelevance_DeleteExperiments_Response, SearchRelevance_DeleteExperiments_ResponseBody } from './searchRelevance/deleteExperiments'; +import { SearchRelevance_GetJudgments_Request, SearchRelevance_GetJudgments_Response, SearchRelevance_GetJudgments_ResponseBody } from './searchRelevance/getJudgments'; +import { SearchRelevance_PutJudgments_Request, SearchRelevance_PutJudgments_RequestBody, SearchRelevance_PutJudgments_Response, SearchRelevance_PutJudgments_ResponseBody } from './searchRelevance/putJudgments'; +import { SearchRelevance_DeleteJudgments_Request, SearchRelevance_DeleteJudgments_Response, SearchRelevance_DeleteJudgments_ResponseBody } from './searchRelevance/deleteJudgments'; +import { SearchRelevance_GetQuerySets_Request, SearchRelevance_GetQuerySets_Response, SearchRelevance_GetQuerySets_ResponseBody } from './searchRelevance/getQuerySets'; +import { SearchRelevance_PostQuerySets_Request, SearchRelevance_PostQuerySets_RequestBody, SearchRelevance_PostQuerySets_Response, SearchRelevance_PostQuerySets_ResponseBody } from './searchRelevance/postQuerySets'; +import { SearchRelevance_PutQuerySets_Request, SearchRelevance_PutQuerySets_RequestBody, SearchRelevance_PutQuerySets_Response, SearchRelevance_PutQuerySets_ResponseBody } from './searchRelevance/putQuerySets'; +import { SearchRelevance_DeleteQuerySets_Request, SearchRelevance_DeleteQuerySets_Response, SearchRelevance_DeleteQuerySets_ResponseBody } from './searchRelevance/deleteQuerySets'; +import { SearchRelevance_GetSearchConfigurations_Request, SearchRelevance_GetSearchConfigurations_Response, SearchRelevance_GetSearchConfigurations_ResponseBody } from './searchRelevance/getSearchConfigurations'; +import { SearchRelevance_PutSearchConfigurations_Request, SearchRelevance_PutSearchConfigurations_RequestBody, SearchRelevance_PutSearchConfigurations_Response, SearchRelevance_PutSearchConfigurations_ResponseBody } from './searchRelevance/putSearchConfigurations'; +import { SearchRelevance_DeleteSearchConfigurations_Request, SearchRelevance_DeleteSearchConfigurations_Response, SearchRelevance_DeleteSearchConfigurations_ResponseBody } from './searchRelevance/deleteSearchConfigurations'; import { RemoteStore_Restore_Request, RemoteStore_Restore_RequestBody, RemoteStore_Restore_Response, RemoteStore_Restore_ResponseBody } from './remoteStore/restore'; import { SearchPipeline_Get_Request, SearchPipeline_Get_Response, SearchPipeline_Get_ResponseBody } from './searchPipeline/get'; import { SearchPipeline_Delete_Request, SearchPipeline_Delete_Response, SearchPipeline_Delete_ResponseBody } from './searchPipeline/delete'; @@ -445,7 +474,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, @@ -571,6 +600,15 @@ export { List_Help_Request, List_Help_Response, List_Help_ResponseBody, List_Indices_Request, List_Indices_Response, List_Indices_ResponseBody, List_Shards_Request, List_Shards_Response, List_Shards_ResponseBody, + Ltr_DeleteDefaultStore_Request, Ltr_DeleteDefaultStore_Response, Ltr_DeleteDefaultStore_ResponseBody, + Ltr_ListStores_Request, Ltr_ListStores_Response, Ltr_ListStores_ResponseBody, + Ltr_CreateDefaultStore_Request, Ltr_CreateDefaultStore_Response, Ltr_CreateDefaultStore_ResponseBody, + Ltr_CacheStats_Request, Ltr_CacheStats_Response, Ltr_CacheStats_ResponseBody, + Ltr_ClearCache_Request, Ltr_ClearCache_Response, Ltr_ClearCache_ResponseBody, + Ltr_DeleteStore_Request, Ltr_DeleteStore_Response, Ltr_DeleteStore_ResponseBody, + Ltr_GetStore_Request, Ltr_GetStore_Response, Ltr_GetStore_ResponseBody, + Ltr_CreateStore_Request, Ltr_CreateStore_Response, Ltr_CreateStore_ResponseBody, + Ltr_Stats_Request, Ltr_Stats_Response, Ltr_Stats_ResponseBody, Nodes_Info_Request, Nodes_Info_Response, Nodes_Info_ResponseBody, Nodes_HotThreads_Request, Nodes_HotThreads_Response, Nodes_HotThreads_ResponseBody, Nodes_ReloadSecureSettings_Request, Nodes_ReloadSecureSettings_RequestBody, Nodes_ReloadSecureSettings_Response, Nodes_ReloadSecureSettings_ResponseBody, @@ -610,7 +648,7 @@ export { Security_PatchDistinguishedNames_Request, Security_PatchDistinguishedNames_RequestBody, Security_PatchDistinguishedNames_Response, Security_PatchDistinguishedNames_ResponseBody, Security_DeleteDistinguishedName_Request, Security_DeleteDistinguishedName_Response, Security_DeleteDistinguishedName_ResponseBody, Security_GetDistinguishedName_Request, Security_GetDistinguishedName_Response, Security_GetDistinguishedName_ResponseBody, - Security_PatchDistinguishedName_Request, Security_PatchDistinguishedName_Response, Security_PatchDistinguishedName_ResponseBody, + Security_PatchDistinguishedName_Request, Security_PatchDistinguishedName_RequestBody, Security_PatchDistinguishedName_Response, Security_PatchDistinguishedName_ResponseBody, Security_UpdateDistinguishedName_Request, Security_UpdateDistinguishedName_Response, Security_UpdateDistinguishedName_ResponseBody, Security_GetPermissionsInfo_Request, Security_GetPermissionsInfo_Response, Security_GetPermissionsInfo_ResponseBody, Security_GetRoles_Request, Security_GetRoles_Response, Security_GetRoles_ResponseBody, @@ -684,7 +722,6 @@ export { 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, - Ltr_Stats_Request, Ltr_Stats_Response, Ltr_Stats_ResponseBody, Ml_ExecuteAlgorithm_Request, Ml_ExecuteAlgorithm_RequestBody, Ml_ExecuteAlgorithm_Response, Ml_ExecuteAlgorithm_ResponseBody, Ml_Predict_Request, Ml_Predict_RequestBody, Ml_Predict_Response, Ml_Predict_ResponseBody, Ml_TrainPredict_Request, Ml_TrainPredict_RequestBody, Ml_TrainPredict_Response, Ml_TrainPredict_ResponseBody, @@ -744,6 +781,7 @@ export { Ml_GetTask_Request, Ml_GetTask_Response, Ml_GetTask_ResponseBody, Ml_GetAllTools_Request, Ml_GetAllTools_Response, Ml_GetAllTools_ResponseBody, Ml_GetTool_Request, Ml_GetTool_Response, Ml_GetTool_ResponseBody, + Neural_Stats_Request, Neural_Stats_Response, Neural_Stats_ResponseBody, Notifications_ListChannels_Request, Notifications_ListChannels_Response, Notifications_ListChannels_ResponseBody, Notifications_DeleteConfigs_Request, Notifications_DeleteConfigs_Response, Notifications_DeleteConfigs_ResponseBody, Notifications_GetConfigs_Request, Notifications_GetConfigs_RequestBody, Notifications_GetConfigs_Response, Notifications_GetConfigs_ResponseBody, @@ -808,6 +846,26 @@ export { Transforms_Explain_Request, Transforms_Explain_Response, Transforms_Explain_ResponseBody, Transforms_Start_Request, Transforms_Start_Response, Transforms_Start_ResponseBody, Transforms_Stop_Request, Transforms_Stop_Response, Transforms_Stop_ResponseBody, + Geospatial_GetUploadStats_Request, Geospatial_GetUploadStats_Response, Geospatial_GetUploadStats_ResponseBody, + Geospatial_GeojsonUploadPost_Request, Geospatial_GeojsonUploadPost_Response, Geospatial_GeojsonUploadPost_ResponseBody, + Geospatial_GeojsonUploadPut_Request, Geospatial_GeojsonUploadPut_Response, Geospatial_GeojsonUploadPut_ResponseBody, + Geospatial_GetIp2GeoDatasource_Request, Geospatial_GetIp2GeoDatasource_Response, Geospatial_GetIp2GeoDatasource_ResponseBody, + Geospatial_DeleteIp2GeoDatasource_Request, Geospatial_DeleteIp2GeoDatasource_Response, Geospatial_DeleteIp2GeoDatasource_ResponseBody, + Geospatial_PutIp2GeoDatasource_Request, Geospatial_PutIp2GeoDatasource_Response, Geospatial_PutIp2GeoDatasource_ResponseBody, + Geospatial_PutIp2GeoDatasourceSettings_Request, Geospatial_PutIp2GeoDatasourceSettings_Response, Geospatial_PutIp2GeoDatasourceSettings_ResponseBody, + SearchRelevance_GetExperiments_Request, SearchRelevance_GetExperiments_Response, SearchRelevance_GetExperiments_ResponseBody, + SearchRelevance_PutExperiments_Request, SearchRelevance_PutExperiments_RequestBody, SearchRelevance_PutExperiments_Response, SearchRelevance_PutExperiments_ResponseBody, + SearchRelevance_DeleteExperiments_Request, SearchRelevance_DeleteExperiments_Response, SearchRelevance_DeleteExperiments_ResponseBody, + SearchRelevance_GetJudgments_Request, SearchRelevance_GetJudgments_Response, SearchRelevance_GetJudgments_ResponseBody, + SearchRelevance_PutJudgments_Request, SearchRelevance_PutJudgments_RequestBody, SearchRelevance_PutJudgments_Response, SearchRelevance_PutJudgments_ResponseBody, + SearchRelevance_DeleteJudgments_Request, SearchRelevance_DeleteJudgments_Response, SearchRelevance_DeleteJudgments_ResponseBody, + SearchRelevance_GetQuerySets_Request, SearchRelevance_GetQuerySets_Response, SearchRelevance_GetQuerySets_ResponseBody, + SearchRelevance_PostQuerySets_Request, SearchRelevance_PostQuerySets_RequestBody, SearchRelevance_PostQuerySets_Response, SearchRelevance_PostQuerySets_ResponseBody, + SearchRelevance_PutQuerySets_Request, SearchRelevance_PutQuerySets_RequestBody, SearchRelevance_PutQuerySets_Response, SearchRelevance_PutQuerySets_ResponseBody, + SearchRelevance_DeleteQuerySets_Request, SearchRelevance_DeleteQuerySets_Response, SearchRelevance_DeleteQuerySets_ResponseBody, + SearchRelevance_GetSearchConfigurations_Request, SearchRelevance_GetSearchConfigurations_Response, SearchRelevance_GetSearchConfigurations_ResponseBody, + SearchRelevance_PutSearchConfigurations_Request, SearchRelevance_PutSearchConfigurations_RequestBody, SearchRelevance_PutSearchConfigurations_Response, SearchRelevance_PutSearchConfigurations_ResponseBody, + SearchRelevance_DeleteSearchConfigurations_Request, SearchRelevance_DeleteSearchConfigurations_Response, SearchRelevance_DeleteSearchConfigurations_ResponseBody, RemoteStore_Restore_Request, RemoteStore_Restore_RequestBody, RemoteStore_Restore_Response, RemoteStore_Restore_ResponseBody, SearchPipeline_Get_Request, SearchPipeline_Get_Response, SearchPipeline_Get_ResponseBody, SearchPipeline_Delete_Request, SearchPipeline_Delete_Response, SearchPipeline_Delete_ResponseBody, diff --git a/api/indices/putSettings.js b/api/indices/putSettings.js index 93168b73d..75063d475 100644 --- a/api/indices/putSettings.js +++ b/api/indices/putSettings.js @@ -34,7 +34,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {boolean} [params.preserve_existing=false] - If `true`, existing index settings remain unchanged. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - * @param {object} params.body - The index settings to be updated. + * @param {object} params.body - The configuration settings for an index. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/indices/simulateTemplate.js b/api/indices/simulateTemplate.js index f4009ff93..845a9f502 100644 --- a/api/indices/simulateTemplate.js +++ b/api/indices/simulateTemplate.js @@ -30,7 +30,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.create=false] - If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. - * @param {object} [params.body] - New index template definition to be simulated, if no index template name is specified. + * @param {object} [params.body] - The configuration for an index template. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/ltr/_api.js b/api/ltr/_api.js index 71a8aebcf..f098629bf 100644 --- a/api/ltr/_api.js +++ b/api/ltr/_api.js @@ -19,8 +19,32 @@ /** @namespace API-Ltr */ function LtrApi(bindObj) { + this.cacheStats = require('./cacheStats').bind(bindObj); + this.clearCache = require('./clearCache').bind(bindObj); + this.createDefaultStore = require('./createDefaultStore').bind(bindObj); + this.createStore = require('./createStore').bind(bindObj); + this.deleteDefaultStore = require('./deleteDefaultStore').bind(bindObj); + this.deleteStore = require('./deleteStore').bind(bindObj); + this.getStore = require('./getStore').bind(bindObj); + this.listStores = require('./listStores').bind(bindObj); this.stats = require('./stats').bind(bindObj); + // Deprecated: Use cacheStats instead. + this.cache_stats = require('./cacheStats').bind(bindObj); + // Deprecated: Use clearCache instead. + this.clear_cache = require('./clearCache').bind(bindObj); + // Deprecated: Use createDefaultStore instead. + this.create_default_store = require('./createDefaultStore').bind(bindObj); + // Deprecated: Use createStore instead. + this.create_store = require('./createStore').bind(bindObj); + // Deprecated: Use deleteDefaultStore instead. + this.delete_default_store = require('./deleteDefaultStore').bind(bindObj); + // Deprecated: Use deleteStore instead. + this.delete_store = require('./deleteStore').bind(bindObj); + // Deprecated: Use getStore instead. + this.get_store = require('./getStore').bind(bindObj); + // Deprecated: Use listStores instead. + this.list_stores = require('./listStores').bind(bindObj); } module.exports = LtrApi; diff --git a/api/ltr/cacheStats.d.ts b/api/ltr/cacheStats.d.ts new file mode 100644 index 000000000..86f37ee38 --- /dev/null +++ b/api/ltr/cacheStats.d.ts @@ -0,0 +1,28 @@ +/* + * 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 Ltr_Common from '../_types/ltr._common' + +export type Ltr_CacheStats_Request = Global.Params & Record + +export interface Ltr_CacheStats_Response extends ApiResponse { + body: Ltr_CacheStats_ResponseBody; +} + +export type Ltr_CacheStats_ResponseBody = Ltr_Common.CacheStatsResponse + diff --git a/api/ltr/cacheStats.js b/api/ltr/cacheStats.js new file mode 100644 index 000000000..c144cddda --- /dev/null +++ b/api/ltr/cacheStats.js @@ -0,0 +1,45 @@ +/* + * 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 cache statistics for all feature stores. + *
See Also: {@link undefined - ltr.cache_stats} + * + * @memberOf API-Ltr + * + * @param {object} [params] - (Unused) + * @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 cacheStatsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_ltr/_cachestats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = cacheStatsFunc; diff --git a/api/ltr/clearCache.d.ts b/api/ltr/clearCache.d.ts new file mode 100644 index 000000000..a68c5e4f4 --- /dev/null +++ b/api/ltr/clearCache.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 Ltr_Common from '../_types/ltr._common' + +export interface Ltr_ClearCache_Request extends Global.Params { + store?: string; +} + +export interface Ltr_ClearCache_Response extends ApiResponse { + body: Ltr_ClearCache_ResponseBody; +} + +export type Ltr_ClearCache_ResponseBody = Ltr_Common.AcknowledgedResponse + diff --git a/api/ltr/clearCache.js b/api/ltr/clearCache.js new file mode 100644 index 000000000..bf79b9e83 --- /dev/null +++ b/api/ltr/clearCache.js @@ -0,0 +1,48 @@ +/* + * 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 } = require('../utils'); + +/** + * Clears the store caches. + *
See Also: {@link undefined - ltr.clear_cache} + * + * @memberOf API-Ltr + * + * @param {object} [params] + * @param {string} [params.store] - The name of the feature store for which to clear the cache. + * + * @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 clearCacheFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, store, ...querystring } = params; + store = parsePathParam(store); + + const path = ['/_ltr', store, '_clearcache'].filter(c => c != null).join('/'); + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = clearCacheFunc; diff --git a/api/ltr/createDefaultStore.d.ts b/api/ltr/createDefaultStore.d.ts new file mode 100644 index 000000000..f3cdd518e --- /dev/null +++ b/api/ltr/createDefaultStore.d.ts @@ -0,0 +1,28 @@ +/* + * 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 Ltr_Common from '../_types/ltr._common' + +export type Ltr_CreateDefaultStore_Request = Global.Params & Record + +export interface Ltr_CreateDefaultStore_Response extends ApiResponse { + body: Ltr_CreateDefaultStore_ResponseBody; +} + +export type Ltr_CreateDefaultStore_ResponseBody = Ltr_Common.AcknowledgedResponse + diff --git a/api/ltr/createDefaultStore.js b/api/ltr/createDefaultStore.js new file mode 100644 index 000000000..f8c2b3fc1 --- /dev/null +++ b/api/ltr/createDefaultStore.js @@ -0,0 +1,45 @@ +/* + * 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'); + +/** + * Creates the default feature store. + *
See Also: {@link undefined - ltr.create_default_store} + * + * @memberOf API-Ltr + * + * @param {object} [params] - (Unused) + * @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 createDefaultStoreFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_ltr'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createDefaultStoreFunc; diff --git a/api/ltr/createStore.d.ts b/api/ltr/createStore.d.ts new file mode 100644 index 000000000..ccb54b972 --- /dev/null +++ b/api/ltr/createStore.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 Ltr_Common from '../_types/ltr._common' + +export interface Ltr_CreateStore_Request extends Global.Params { + store: string; +} + +export interface Ltr_CreateStore_Response extends ApiResponse { + body: Ltr_CreateStore_ResponseBody; +} + +export type Ltr_CreateStore_ResponseBody = Ltr_Common.AcknowledgedResponse + diff --git a/api/ltr/createStore.js b/api/ltr/createStore.js new file mode 100644 index 000000000..336e00b63 --- /dev/null +++ b/api/ltr/createStore.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'); + +/** + * Creates a new feature store with the specified name. + *
See Also: {@link undefined - ltr.create_store} + * + * @memberOf API-Ltr + * + * @param {object} params + * @param {string} params.store - The name of the feature store. + * + * @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 createStoreFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.store == null) return handleMissingParam('store', this, callback); + + let { body, store, ...querystring } = params; + store = parsePathParam(store); + + const path = '/_ltr/' + store; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createStoreFunc; diff --git a/api/ltr/deleteDefaultStore.d.ts b/api/ltr/deleteDefaultStore.d.ts new file mode 100644 index 000000000..1930aaafd --- /dev/null +++ b/api/ltr/deleteDefaultStore.d.ts @@ -0,0 +1,28 @@ +/* + * 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 Ltr_Common from '../_types/ltr._common' + +export type Ltr_DeleteDefaultStore_Request = Global.Params & Record + +export interface Ltr_DeleteDefaultStore_Response extends ApiResponse { + body: Ltr_DeleteDefaultStore_ResponseBody; +} + +export type Ltr_DeleteDefaultStore_ResponseBody = Ltr_Common.AcknowledgedResponse + diff --git a/api/ltr/deleteDefaultStore.js b/api/ltr/deleteDefaultStore.js new file mode 100644 index 000000000..34fabb398 --- /dev/null +++ b/api/ltr/deleteDefaultStore.js @@ -0,0 +1,45 @@ +/* + * 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'); + +/** + * Deletes the default feature store. + *
See Also: {@link undefined - ltr.delete_default_store} + * + * @memberOf API-Ltr + * + * @param {object} [params] - (Unused) + * @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 deleteDefaultStoreFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_ltr'; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteDefaultStoreFunc; diff --git a/api/ltr/deleteStore.d.ts b/api/ltr/deleteStore.d.ts new file mode 100644 index 000000000..20d156f2c --- /dev/null +++ b/api/ltr/deleteStore.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 Ltr_Common from '../_types/ltr._common' + +export interface Ltr_DeleteStore_Request extends Global.Params { + store: string; +} + +export interface Ltr_DeleteStore_Response extends ApiResponse { + body: Ltr_DeleteStore_ResponseBody; +} + +export type Ltr_DeleteStore_ResponseBody = Ltr_Common.AcknowledgedResponse + diff --git a/api/ltr/deleteStore.js b/api/ltr/deleteStore.js new file mode 100644 index 000000000..a00c89f3b --- /dev/null +++ b/api/ltr/deleteStore.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 feature store with the specified name. + *
See Also: {@link undefined - ltr.delete_store} + * + * @memberOf API-Ltr + * + * @param {object} params + * @param {string} params.store - The name of the feature store. + * + * @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 deleteStoreFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.store == null) return handleMissingParam('store', this, callback); + + let { body, store, ...querystring } = params; + store = parsePathParam(store); + + const path = '/_ltr/' + store; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteStoreFunc; diff --git a/api/ltr/getStore.d.ts b/api/ltr/getStore.d.ts new file mode 100644 index 000000000..995185e29 --- /dev/null +++ b/api/ltr/getStore.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 Ltr_Common from '../_types/ltr._common' + +export interface Ltr_GetStore_Request extends Global.Params { + store: string; +} + +export interface Ltr_GetStore_Response extends ApiResponse { + body: Ltr_GetStore_ResponseBody; +} + +export type Ltr_GetStore_ResponseBody = Ltr_Common.StoreExistsResponse + diff --git a/api/ltr/getStore.js b/api/ltr/getStore.js new file mode 100644 index 000000000..7ab200a6a --- /dev/null +++ b/api/ltr/getStore.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'); + +/** + * Checks if a store exists. + *
See Also: {@link undefined - ltr.get_store} + * + * @memberOf API-Ltr + * + * @param {object} params + * @param {string} params.store - The name of the feature store. + * + * @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 getStoreFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.store == null) return handleMissingParam('store', this, callback); + + let { body, store, ...querystring } = params; + store = parsePathParam(store); + + const path = '/_ltr/' + store; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getStoreFunc; diff --git a/api/ltr/listStores.d.ts b/api/ltr/listStores.d.ts new file mode 100644 index 000000000..e5ca718b3 --- /dev/null +++ b/api/ltr/listStores.d.ts @@ -0,0 +1,28 @@ +/* + * 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 Ltr_Common from '../_types/ltr._common' + +export type Ltr_ListStores_Request = Global.Params & Record + +export interface Ltr_ListStores_Response extends ApiResponse { + body: Ltr_ListStores_ResponseBody; +} + +export type Ltr_ListStores_ResponseBody = Ltr_Common.ListStoresResponse + diff --git a/api/ltr/listStores.js b/api/ltr/listStores.js new file mode 100644 index 000000000..7f23b2316 --- /dev/null +++ b/api/ltr/listStores.js @@ -0,0 +1,45 @@ +/* + * 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'); + +/** + * Lists all available feature stores. + *
See Also: {@link undefined - ltr.list_stores} + * + * @memberOf API-Ltr + * + * @param {object} [params] - (Unused) + * @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 listStoresFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_ltr'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = listStoresFunc; diff --git a/api/ml/getTool.d.ts b/api/ml/getTool.d.ts index c2edc3491..d444058ed 100644 --- a/api/ml/getTool.d.ts +++ b/api/ml/getTool.d.ts @@ -19,7 +19,7 @@ import * as Global from '../_types/_global' import * as Ml_Common from '../_types/ml._common' export interface Ml_GetTool_Request extends Global.Params { - tool_name: 'AgentTool' | 'CatIndexTool' | 'ConnectorTool' | 'CreateAnomalyDetectorTool' | 'IndexMappingTool' | 'LogPatternTool' | 'MLModelTool' | 'NeuralSparseSearchTool' | 'PPLTool' | 'RAGTool' | 'SearchAlertsTool' | 'SearchAnomalyDetectorsTool' | 'SearchAnomalyResultsTool' | 'SearchIndexTool' | 'SearchMonitorsTool' | 'VectorDBTool' | 'VisualizationTool'; + tool_name: 'AgentTool' | 'CatIndexTool' | 'ConnectorTool' | 'CreateAnomalyDetectorTool' | 'IndexMappingTool' | 'ListIndexTool' | 'LogPatternTool' | 'MLModelTool' | 'NeuralSparseSearchTool' | 'PPLTool' | 'RAGTool' | 'SearchAlertsTool' | 'SearchAnomalyDetectorsTool' | 'SearchAnomalyResultsTool' | 'SearchIndexTool' | 'SearchMonitorsTool' | 'VectorDBTool' | 'VisualizationTool'; } export interface Ml_GetTool_Response extends ApiResponse { diff --git a/api/neural/_api.js b/api/neural/_api.js new file mode 100644 index 000000000..6c9360c20 --- /dev/null +++ b/api/neural/_api.js @@ -0,0 +1,26 @@ +/* + * 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-Neural */ + +function NeuralApi(bindObj) { + this.stats = require('./stats').bind(bindObj); + +} + +module.exports = NeuralApi; diff --git a/api/neural/stats.d.ts b/api/neural/stats.d.ts new file mode 100644 index 000000000..022c0ec92 --- /dev/null +++ b/api/neural/stats.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 Neural_Common from '../_types/neural._common' + +export interface Neural_Stats_Request extends Global.Params { + flat_stat_paths?: boolean; + include_metadata?: boolean; + node_id?: string; + stat?: 'cluster_version' | 'text_embedding_executions' | 'text_embedding_processors_in_pipelines'; +} + +export interface Neural_Stats_Response extends ApiResponse { + body: Neural_Stats_ResponseBody; +} + +export type Neural_Stats_ResponseBody = Neural_Common.NeuralStats + diff --git a/api/neural/stats.js b/api/neural/stats.js new file mode 100644 index 000000000..6500ce538 --- /dev/null +++ b/api/neural/stats.js @@ -0,0 +1,52 @@ +/* + * 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 } = require('../utils'); + +/** + * Provides information about the current status of the neural-search plugin. + *
See Also: {@link undefined - neural.stats} + * + * @memberOf API-Neural + * + * @param {object} [params] + * @param {boolean} [params.flat_stat_paths=false] - Whether to return stats in the flat form, which can improve readability, especially for heavily nested stats. For example, the flat form of `"processors": { "ingest": { "text_embedding_executions": 20181212 } }` is `"processors.ingest.text_embedding_executions": "20181212"`. + * @param {boolean} [params.include_metadata=false] - Whether to return stat metadata instead of the raw stat value, includes additional information about the stat. These can include things like type hints, time since last stats being recorded, or recent rolling interval values + * @param {string} [params.node_id] - Comma-separated list of node IDs or names to limit the returned information; leave empty to get information from all nodes. + * @param {string} [params.stat] - Comma-separated list of stats to retrieve; use empty string to retrieve all stats. + * + * @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 statsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, node_id, stat, ...querystring } = params; + node_id = parsePathParam(node_id); + stat = parsePathParam(stat); + + const path = ['/_plugins/_neural', node_id, 'stats', stat].filter(c => c != null).join('/'); + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = statsFunc; diff --git a/api/nodes/hotThreads.js b/api/nodes/hotThreads.js index 733b84248..432671289 100644 --- a/api/nodes/hotThreads.js +++ b/api/nodes/hotThreads.js @@ -25,13 +25,13 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Nodes * * @param {object} [params] - * @param {boolean} [params.ignore_idle_threads=true] - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue. - * @param {string} [params.interval] - The interval for the second sampling of threads. - * @param {number} [params.snapshots=10] - Number of samples of thread stack trace. - * @param {number} [params.threads=3] - Specify the number of threads to provide information for. - * @param {string} [params.timeout] - Operation timeout. + * @param {boolean} [params.ignore_idle_threads=true] - Whether to show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue. + * @param {string} [params.interval] - The time interval between thread stack trace samples. + * @param {number} [params.snapshots=10] - The number of thread stack trace samples to collect. + * @param {number} [params.threads=3] - The number of threads to provide information for. + * @param {string} [params.timeout] - The amount of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.type] - The type to sample. - * @param {array} [params.node_id] - Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + * @param {array} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/nodes/info.js b/api/nodes/info.js index cb4bedcfd..f4e69d03d 100644 --- a/api/nodes/info.js +++ b/api/nodes/info.js @@ -25,10 +25,10 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Nodes * * @param {object} [params] - * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. - * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.flat_settings=false] - When `true`, returns settings in flat format. + * @param {string} [params.timeout] - The amount of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {array} [params.metric] - Limits the information returned to the specific metrics. Supports a comma-separated list, such as `http,ingest`. - * @param {string} [params.node_id] - Comma-separated list of node IDs or names used to limit returned information. + * @param {string} [params.node_id] - A comma-separated list of node IDs or names used to limit returned information. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/nodes/reloadSecureSettings.js b/api/nodes/reloadSecureSettings.js index b8c9b4f82..19af874f4 100644 --- a/api/nodes/reloadSecureSettings.js +++ b/api/nodes/reloadSecureSettings.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Nodes * * @param {object} [params] - * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.timeout] - The amount of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.node_id] - The names of particular nodes in the cluster to target. * @param {object} [params.body] - An object containing the password for the OpenSearch keystore. * diff --git a/api/nodes/stats.js b/api/nodes/stats.js index 08d663cea..f9e7160b1 100644 --- a/api/nodes/stats.js +++ b/api/nodes/stats.js @@ -25,17 +25,17 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Nodes * * @param {object} [params] - * @param {string} [params.completion_fields] - Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. - * @param {string} [params.fielddata_fields] - Comma-separated list or wildcard expressions of fields to include in field data statistics. - * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. - * @param {array} [params.groups] - Comma-separated list of search groups to include in the search statistics. - * @param {boolean} [params.include_segment_file_sizes=false] - If `true`, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + * @param {string} [params.completion_fields] - A comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. + * @param {string} [params.fielddata_fields] - A comma-separated list or wildcard expressions of fields to include in field data statistics. + * @param {string} [params.fields] - A comma-separated list or wildcard expressions of fields to include in the statistics. + * @param {array} [params.groups] - A comma-separated list of search groups to include in the search statistics. + * @param {boolean} [params.include_segment_file_sizes=false] - When `true`, reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). * @param {string} [params.level] - Indicates whether statistics are aggregated at the cluster, index, or shard level. - * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.timeout] - The amount of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {array} [params.types] - A comma-separated list of document types for the indexing index metric. - * @param {string} [params.node_id] - Comma-separated list of node IDs or names used to limit returned information. - * @param {array} [params.metric] - Limit the information returned to the specified metrics - * @param {array} [params.index_metric] - Limit the information returned for indexes metric to the specific index metrics. It can be used only if indexes (or all) metric is specified. + * @param {string} [params.node_id] - A comma-separated list of node IDs or names used to limit returned information. + * @param {array} [params.metric] - Limit the information returned to the specified metrics. + * @param {array} [params.index_metric] - Limit the information returned for indexes metric to the specified index metrics. It can be used only if indexes (or all) metric is specified. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/query/datasourcesList.js b/api/query/datasourcesList.js index e81f192b1..65a636c06 100644 --- a/api/query/datasourcesList.js +++ b/api/query/datasourcesList.js @@ -19,7 +19,7 @@ const { normalizeArguments } = require('../utils'); /** - * Retrieves a list of all available datasources. + * Retrieves a list of all available data sources. *
See Also: {@link undefined - query.datasources_list} * * @memberOf API-Query diff --git a/api/searchRelevance/_api.js b/api/searchRelevance/_api.js new file mode 100644 index 000000000..7d3d6d386 --- /dev/null +++ b/api/searchRelevance/_api.js @@ -0,0 +1,64 @@ +/* + * 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-Search-Relevance */ + +function SearchRelevanceApi(bindObj) { + this.deleteExperiments = require('./deleteExperiments').bind(bindObj); + this.deleteJudgments = require('./deleteJudgments').bind(bindObj); + this.deleteQuerySets = require('./deleteQuerySets').bind(bindObj); + this.deleteSearchConfigurations = require('./deleteSearchConfigurations').bind(bindObj); + this.getExperiments = require('./getExperiments').bind(bindObj); + this.getJudgments = require('./getJudgments').bind(bindObj); + this.getQuerySets = require('./getQuerySets').bind(bindObj); + this.getSearchConfigurations = require('./getSearchConfigurations').bind(bindObj); + this.postQuerySets = require('./postQuerySets').bind(bindObj); + this.putExperiments = require('./putExperiments').bind(bindObj); + this.putJudgments = require('./putJudgments').bind(bindObj); + this.putQuerySets = require('./putQuerySets').bind(bindObj); + this.putSearchConfigurations = require('./putSearchConfigurations').bind(bindObj); + + // Deprecated: Use deleteExperiments instead. + this.delete_experiments = require('./deleteExperiments').bind(bindObj); + // Deprecated: Use deleteJudgments instead. + this.delete_judgments = require('./deleteJudgments').bind(bindObj); + // Deprecated: Use deleteQuerySets instead. + this.delete_query_sets = require('./deleteQuerySets').bind(bindObj); + // Deprecated: Use deleteSearchConfigurations instead. + this.delete_search_configurations = require('./deleteSearchConfigurations').bind(bindObj); + // Deprecated: Use getExperiments instead. + this.get_experiments = require('./getExperiments').bind(bindObj); + // Deprecated: Use getJudgments instead. + this.get_judgments = require('./getJudgments').bind(bindObj); + // Deprecated: Use getQuerySets instead. + this.get_query_sets = require('./getQuerySets').bind(bindObj); + // Deprecated: Use getSearchConfigurations instead. + this.get_search_configurations = require('./getSearchConfigurations').bind(bindObj); + // Deprecated: Use postQuerySets instead. + this.post_query_sets = require('./postQuerySets').bind(bindObj); + // Deprecated: Use putExperiments instead. + this.put_experiments = require('./putExperiments').bind(bindObj); + // Deprecated: Use putJudgments instead. + this.put_judgments = require('./putJudgments').bind(bindObj); + // Deprecated: Use putQuerySets instead. + this.put_query_sets = require('./putQuerySets').bind(bindObj); + // Deprecated: Use putSearchConfigurations instead. + this.put_search_configurations = require('./putSearchConfigurations').bind(bindObj); +} + +module.exports = SearchRelevanceApi; diff --git a/api/searchRelevance/deleteExperiments.d.ts b/api/searchRelevance/deleteExperiments.d.ts new file mode 100644 index 000000000..f2107f4b8 --- /dev/null +++ b/api/searchRelevance/deleteExperiments.d.ts @@ -0,0 +1,29 @@ +/* + * 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 interface SearchRelevance_DeleteExperiments_Request extends Global.Params { + experiment_id: string; +} + +export interface SearchRelevance_DeleteExperiments_Response extends ApiResponse { + body: SearchRelevance_DeleteExperiments_ResponseBody; +} + +export type SearchRelevance_DeleteExperiments_ResponseBody = Record + diff --git a/api/searchRelevance/deleteExperiments.js b/api/searchRelevance/deleteExperiments.js new file mode 100644 index 000000000..898317ae9 --- /dev/null +++ b/api/searchRelevance/deleteExperiments.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 specified experiment. + *
See Also: {@link undefined - search_relevance.delete_experiments} + * + * @memberOf API-Search-Relevance + * + * @param {object} params + * @param {string} params.experiment_id - The experiment id + * + * @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 deleteExperimentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.experiment_id == null) return handleMissingParam('experiment_id', this, callback); + + let { body, experiment_id, ...querystring } = params; + experiment_id = parsePathParam(experiment_id); + + const path = '/_plugins/search_relevance/experiments/' + experiment_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteExperimentsFunc; diff --git a/api/searchRelevance/deleteJudgments.d.ts b/api/searchRelevance/deleteJudgments.d.ts new file mode 100644 index 000000000..6a090686a --- /dev/null +++ b/api/searchRelevance/deleteJudgments.d.ts @@ -0,0 +1,29 @@ +/* + * 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 interface SearchRelevance_DeleteJudgments_Request extends Global.Params { + judgment_id: string; +} + +export interface SearchRelevance_DeleteJudgments_Response extends ApiResponse { + body: SearchRelevance_DeleteJudgments_ResponseBody; +} + +export type SearchRelevance_DeleteJudgments_ResponseBody = Record + diff --git a/api/searchRelevance/deleteJudgments.js b/api/searchRelevance/deleteJudgments.js new file mode 100644 index 000000000..229cd3e70 --- /dev/null +++ b/api/searchRelevance/deleteJudgments.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 specified judgment. + *
See Also: {@link undefined - search_relevance.delete_judgments} + * + * @memberOf API-Search-Relevance + * + * @param {object} params + * @param {string} params.judgment_id - The judgment id + * + * @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 deleteJudgmentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.judgment_id == null) return handleMissingParam('judgment_id', this, callback); + + let { body, judgment_id, ...querystring } = params; + judgment_id = parsePathParam(judgment_id); + + const path = '/_plugins/search_relevance/judgments/' + judgment_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteJudgmentsFunc; diff --git a/api/searchRelevance/deleteQuerySets.d.ts b/api/searchRelevance/deleteQuerySets.d.ts new file mode 100644 index 000000000..755a3646d --- /dev/null +++ b/api/searchRelevance/deleteQuerySets.d.ts @@ -0,0 +1,29 @@ +/* + * 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 interface SearchRelevance_DeleteQuerySets_Request extends Global.Params { + query_set_id: string; +} + +export interface SearchRelevance_DeleteQuerySets_Response extends ApiResponse { + body: SearchRelevance_DeleteQuerySets_ResponseBody; +} + +export type SearchRelevance_DeleteQuerySets_ResponseBody = Record + diff --git a/api/searchRelevance/deleteQuerySets.js b/api/searchRelevance/deleteQuerySets.js new file mode 100644 index 000000000..cded94e18 --- /dev/null +++ b/api/searchRelevance/deleteQuerySets.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 query set. + *
See Also: {@link undefined - search_relevance.delete_query_sets} + * + * @memberOf API-Search-Relevance + * + * @param {object} params + * @param {string} params.query_set_id - The query set id + * + * @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 deleteQuerySetsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.query_set_id == null) return handleMissingParam('query_set_id', this, callback); + + let { body, query_set_id, ...querystring } = params; + query_set_id = parsePathParam(query_set_id); + + const path = '/_plugins/search_relevance/query_sets/' + query_set_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteQuerySetsFunc; diff --git a/api/searchRelevance/deleteSearchConfigurations.d.ts b/api/searchRelevance/deleteSearchConfigurations.d.ts new file mode 100644 index 000000000..01cbbb458 --- /dev/null +++ b/api/searchRelevance/deleteSearchConfigurations.d.ts @@ -0,0 +1,29 @@ +/* + * 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 interface SearchRelevance_DeleteSearchConfigurations_Request extends Global.Params { + search_configuration_id: string; +} + +export interface SearchRelevance_DeleteSearchConfigurations_Response extends ApiResponse { + body: SearchRelevance_DeleteSearchConfigurations_ResponseBody; +} + +export type SearchRelevance_DeleteSearchConfigurations_ResponseBody = Record + diff --git a/api/searchRelevance/deleteSearchConfigurations.js b/api/searchRelevance/deleteSearchConfigurations.js new file mode 100644 index 000000000..2af539dd1 --- /dev/null +++ b/api/searchRelevance/deleteSearchConfigurations.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 specified search configuration. + *
See Also: {@link undefined - search_relevance.delete_search_configurations} + * + * @memberOf API-Search-Relevance + * + * @param {object} params + * @param {string} params.search_configuration_id - The search configuration id + * + * @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 deleteSearchConfigurationsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.search_configuration_id == null) return handleMissingParam('search_configuration_id', this, callback); + + let { body, search_configuration_id, ...querystring } = params; + search_configuration_id = parsePathParam(search_configuration_id); + + const path = '/_plugins/search_relevance/search_configurations/' + search_configuration_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteSearchConfigurationsFunc; diff --git a/api/searchRelevance/getExperiments.d.ts b/api/searchRelevance/getExperiments.d.ts new file mode 100644 index 000000000..c6257346c --- /dev/null +++ b/api/searchRelevance/getExperiments.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 SearchRelevance_Common from '../_types/search_relevance._common' + +export interface SearchRelevance_GetExperiments_Request extends Global.Params { + experiment_id?: string; +} + +export interface SearchRelevance_GetExperiments_Response extends ApiResponse { + body: SearchRelevance_GetExperiments_ResponseBody; +} + +export type SearchRelevance_GetExperiments_ResponseBody = SearchRelevance_Common.Experiment | SearchRelevance_Common.GenericObject + diff --git a/api/searchRelevance/getExperiments.js b/api/searchRelevance/getExperiments.js new file mode 100644 index 000000000..d59f44140 --- /dev/null +++ b/api/searchRelevance/getExperiments.js @@ -0,0 +1,48 @@ +/* + * 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 } = require('../utils'); + +/** + * Gets experiments. + *
See Also: {@link undefined - search_relevance.get_experiments} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @param {string} [params.experiment_id] - The experiment id + * + * @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 getExperimentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, experiment_id, ...querystring } = params; + experiment_id = parsePathParam(experiment_id); + + const path = ['/_plugins/search_relevance/experiments', experiment_id].filter(c => c != null).join('/'); + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getExperimentsFunc; diff --git a/api/searchRelevance/getJudgments.d.ts b/api/searchRelevance/getJudgments.d.ts new file mode 100644 index 000000000..2e4ff6773 --- /dev/null +++ b/api/searchRelevance/getJudgments.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 SearchRelevance_Common from '../_types/search_relevance._common' + +export interface SearchRelevance_GetJudgments_Request extends Global.Params { + judgment_id?: string; +} + +export interface SearchRelevance_GetJudgments_Response extends ApiResponse { + body: SearchRelevance_GetJudgments_ResponseBody; +} + +export type SearchRelevance_GetJudgments_ResponseBody = SearchRelevance_Common.Judgment | SearchRelevance_Common.GenericObject + diff --git a/api/searchRelevance/getJudgments.js b/api/searchRelevance/getJudgments.js new file mode 100644 index 000000000..11c30f099 --- /dev/null +++ b/api/searchRelevance/getJudgments.js @@ -0,0 +1,48 @@ +/* + * 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 } = require('../utils'); + +/** + * Gets judgments. + *
See Also: {@link undefined - search_relevance.get_judgments} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @param {string} [params.judgment_id] - The judgment id + * + * @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 getJudgmentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, judgment_id, ...querystring } = params; + judgment_id = parsePathParam(judgment_id); + + const path = ['/_plugins/search_relevance/judgments', judgment_id].filter(c => c != null).join('/'); + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getJudgmentsFunc; diff --git a/api/searchRelevance/getQuerySets.d.ts b/api/searchRelevance/getQuerySets.d.ts new file mode 100644 index 000000000..58d5e7373 --- /dev/null +++ b/api/searchRelevance/getQuerySets.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 SearchRelevance_Common from '../_types/search_relevance._common' + +export interface SearchRelevance_GetQuerySets_Request extends Global.Params { + query_set_id?: string; +} + +export interface SearchRelevance_GetQuerySets_Response extends ApiResponse { + body: SearchRelevance_GetQuerySets_ResponseBody; +} + +export type SearchRelevance_GetQuerySets_ResponseBody = SearchRelevance_Common.QuerySet | SearchRelevance_Common.GenericObject + diff --git a/api/searchRelevance/getQuerySets.js b/api/searchRelevance/getQuerySets.js new file mode 100644 index 000000000..caedf7c30 --- /dev/null +++ b/api/searchRelevance/getQuerySets.js @@ -0,0 +1,48 @@ +/* + * 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 } = require('../utils'); + +/** + * Lists the current query sets available. + *
See Also: {@link undefined - search_relevance.get_query_sets} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @param {string} [params.query_set_id] - The query set id + * + * @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 getQuerySetsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, query_set_id, ...querystring } = params; + query_set_id = parsePathParam(query_set_id); + + const path = ['/_plugins/search_relevance/query_sets', query_set_id].filter(c => c != null).join('/'); + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getQuerySetsFunc; diff --git a/api/searchRelevance/getSearchConfigurations.d.ts b/api/searchRelevance/getSearchConfigurations.d.ts new file mode 100644 index 000000000..8c2ebcfba --- /dev/null +++ b/api/searchRelevance/getSearchConfigurations.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 SearchRelevance_Common from '../_types/search_relevance._common' + +export interface SearchRelevance_GetSearchConfigurations_Request extends Global.Params { + search_configuration_id?: string; +} + +export interface SearchRelevance_GetSearchConfigurations_Response extends ApiResponse { + body: SearchRelevance_GetSearchConfigurations_ResponseBody; +} + +export type SearchRelevance_GetSearchConfigurations_ResponseBody = SearchRelevance_Common.SearchConfiguration | SearchRelevance_Common.GenericObject + diff --git a/api/searchRelevance/getSearchConfigurations.js b/api/searchRelevance/getSearchConfigurations.js new file mode 100644 index 000000000..9f15e4bb7 --- /dev/null +++ b/api/searchRelevance/getSearchConfigurations.js @@ -0,0 +1,48 @@ +/* + * 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 } = require('../utils'); + +/** + * Gets the search configurations. + *
See Also: {@link undefined - search_relevance.get_search_configurations} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @param {string} [params.search_configuration_id] - The search configuration id + * + * @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 getSearchConfigurationsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, search_configuration_id, ...querystring } = params; + search_configuration_id = parsePathParam(search_configuration_id); + + const path = ['/_plugins/search_relevance/search_configurations', search_configuration_id].filter(c => c != null).join('/'); + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getSearchConfigurationsFunc; diff --git a/api/searchRelevance/postQuerySets.d.ts b/api/searchRelevance/postQuerySets.d.ts new file mode 100644 index 000000000..2b7931aa6 --- /dev/null +++ b/api/searchRelevance/postQuerySets.d.ts @@ -0,0 +1,39 @@ +/* + * 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 interface SearchRelevance_PostQuerySets_Request extends Global.Params { + body?: SearchRelevance_PostQuerySets_RequestBody; +} + +export type SearchRelevance_PostQuerySets_RequestBody = { + description?: string; + name?: string; + querySetSize?: number; + sampling?: string; +} + +export interface SearchRelevance_PostQuerySets_Response extends ApiResponse { + body: SearchRelevance_PostQuerySets_ResponseBody; +} + +export type SearchRelevance_PostQuerySets_ResponseBody = { + query_set_id?: string; + query_set_result?: string; +} + diff --git a/api/searchRelevance/postQuerySets.js b/api/searchRelevance/postQuerySets.js new file mode 100644 index 000000000..0d0bdac1a --- /dev/null +++ b/api/searchRelevance/postQuerySets.js @@ -0,0 +1,47 @@ +/* + * 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'); + +/** + * Creates a new query set by sampling queries from the user behavior data. + *
See Also: {@link undefined - search_relevance.post_query_sets} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @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 postQuerySetsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/search_relevance/query_sets'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = postQuerySetsFunc; diff --git a/api/searchRelevance/putExperiments.d.ts b/api/searchRelevance/putExperiments.d.ts new file mode 100644 index 000000000..45af396a0 --- /dev/null +++ b/api/searchRelevance/putExperiments.d.ts @@ -0,0 +1,36 @@ +/* + * 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 interface SearchRelevance_PutExperiments_Request extends Global.Params { + body?: SearchRelevance_PutExperiments_RequestBody; +} + +export type SearchRelevance_PutExperiments_RequestBody = { + querySetId?: string; + searchConfigurationList?: string[]; + size?: number; + type?: string; +} + +export interface SearchRelevance_PutExperiments_Response extends ApiResponse { + body: SearchRelevance_PutExperiments_ResponseBody; +} + +export type SearchRelevance_PutExperiments_ResponseBody = Record + diff --git a/api/searchRelevance/putExperiments.js b/api/searchRelevance/putExperiments.js new file mode 100644 index 000000000..7801eade2 --- /dev/null +++ b/api/searchRelevance/putExperiments.js @@ -0,0 +1,47 @@ +/* + * 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'); + +/** + * Creates an experiment. + *
See Also: {@link undefined - search_relevance.put_experiments} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @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 putExperimentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/search_relevance/experiments'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putExperimentsFunc; diff --git a/api/searchRelevance/putJudgments.d.ts b/api/searchRelevance/putJudgments.d.ts new file mode 100644 index 000000000..55de83332 --- /dev/null +++ b/api/searchRelevance/putJudgments.d.ts @@ -0,0 +1,48 @@ +/* + * 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 interface SearchRelevance_PutJudgments_Request extends Global.Params { + body?: SearchRelevance_PutJudgments_RequestBody; +} + +export type SearchRelevance_PutJudgments_RequestBody = { + clickModel?: string; + description?: string; + maxRank?: number; + name?: string; + querySetId?: string; + type?: string; +} | { + description?: string; + modelId?: string; + name?: string; + querySetId?: string; + searchConfigurationList?: string[]; + size?: number; + type?: string; +} + +export interface SearchRelevance_PutJudgments_Response extends ApiResponse { + body: SearchRelevance_PutJudgments_ResponseBody; +} + +export type SearchRelevance_PutJudgments_ResponseBody = { + judgment_id?: string; +} + diff --git a/api/searchRelevance/putJudgments.js b/api/searchRelevance/putJudgments.js new file mode 100644 index 000000000..d25d02db7 --- /dev/null +++ b/api/searchRelevance/putJudgments.js @@ -0,0 +1,47 @@ +/* + * 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'); + +/** + * Creates a judgment. + *
See Also: {@link undefined - search_relevance.put_judgments} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @param {string} [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 putJudgmentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/search_relevance/judgments'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putJudgmentsFunc; diff --git a/api/searchRelevance/putQuerySets.d.ts b/api/searchRelevance/putQuerySets.d.ts new file mode 100644 index 000000000..ed796cbbc --- /dev/null +++ b/api/searchRelevance/putQuerySets.d.ts @@ -0,0 +1,39 @@ +/* + * 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 interface SearchRelevance_PutQuerySets_Request extends Global.Params { + body?: SearchRelevance_PutQuerySets_RequestBody; +} + +export type SearchRelevance_PutQuerySets_RequestBody = { + description?: string; + name?: string; + querySetQueries?: Record[]; + sampling?: string; +} + +export interface SearchRelevance_PutQuerySets_Response extends ApiResponse { + body: SearchRelevance_PutQuerySets_ResponseBody; +} + +export type SearchRelevance_PutQuerySets_ResponseBody = { + query_set_id?: string; + query_set_result?: string; +} + diff --git a/api/searchRelevance/putQuerySets.js b/api/searchRelevance/putQuerySets.js new file mode 100644 index 000000000..1ac51bd15 --- /dev/null +++ b/api/searchRelevance/putQuerySets.js @@ -0,0 +1,47 @@ +/* + * 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'); + +/** + * Creates a new query set by uploading manually. + *
See Also: {@link undefined - search_relevance.put_query_sets} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @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 putQuerySetsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/search_relevance/query_sets'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putQuerySetsFunc; diff --git a/api/searchRelevance/putSearchConfigurations.d.ts b/api/searchRelevance/putSearchConfigurations.d.ts new file mode 100644 index 000000000..8c428d20b --- /dev/null +++ b/api/searchRelevance/putSearchConfigurations.d.ts @@ -0,0 +1,38 @@ +/* + * 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 interface SearchRelevance_PutSearchConfigurations_Request extends Global.Params { + body?: SearchRelevance_PutSearchConfigurations_RequestBody; +} + +export type SearchRelevance_PutSearchConfigurations_RequestBody = { + index?: string; + name?: string; + query?: string; +} + +export interface SearchRelevance_PutSearchConfigurations_Response extends ApiResponse { + body: SearchRelevance_PutSearchConfigurations_ResponseBody; +} + +export type SearchRelevance_PutSearchConfigurations_ResponseBody = { + search_configuration_id?: string; + search_configuration_result?: string; +} + diff --git a/api/searchRelevance/putSearchConfigurations.js b/api/searchRelevance/putSearchConfigurations.js new file mode 100644 index 000000000..f0228feb6 --- /dev/null +++ b/api/searchRelevance/putSearchConfigurations.js @@ -0,0 +1,47 @@ +/* + * 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'); + +/** + * Creates a search configuration. + *
See Also: {@link undefined - search_relevance.put_search_configurations} + * + * @memberOf API-Search-Relevance + * + * @param {object} [params] + * @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 putSearchConfigurationsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/search_relevance/search_configurations'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putSearchConfigurationsFunc; diff --git a/api/security/getSslinfo.d.ts b/api/security/getSslinfo.d.ts index 095db3f1c..e4b3354f3 100644 --- a/api/security/getSslinfo.d.ts +++ b/api/security/getSslinfo.d.ts @@ -15,11 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_GetSslinfo_Request extends Global.Params { - show_dn?: boolean | string; + show_dn?: Common.StringifiedBoolean; } export interface Security_GetSslinfo_Response extends ApiResponse { diff --git a/api/security/getSslinfo.js b/api/security/getSslinfo.js index 5ce540133..d2ffa98f3 100644 --- a/api/security/getSslinfo.js +++ b/api/security/getSslinfo.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Security * * @param {object} [params] - * @param {boolean | string} [params.show_dn] - Whether to include all domain names in the response. + * @param {string} [params.show_dn] - Whether to include all domain names in the response. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/patchDistinguishedName.d.ts b/api/security/patchDistinguishedName.d.ts index 5af5d9bf8..5d8e4464d 100644 --- a/api/security/patchDistinguishedName.d.ts +++ b/api/security/patchDistinguishedName.d.ts @@ -19,10 +19,12 @@ import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_PatchDistinguishedName_Request extends Global.Params { - body?: Security_Common.PatchOperations; + body?: Security_PatchDistinguishedName_RequestBody; cluster_name: string; } +export type Security_PatchDistinguishedName_RequestBody = Security_Common.PatchOperation[] + export interface Security_PatchDistinguishedName_Response extends ApiResponse { body: Security_PatchDistinguishedName_ResponseBody; } diff --git a/api/sql/query.js b/api/sql/query.js index 7ab7f0a71..5187861a7 100644 --- a/api/sql/query.js +++ b/api/sql/query.js @@ -19,7 +19,7 @@ const { normalizeArguments } = require('../utils'); /** - * Executes SQL or PPL queries against OpenSearch indices. + * Executes SQL or PPL queries against OpenSearch indexes. *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ - sql.query} * * @memberOf API-Sql