From f4f7758b333ab9d9dd6f8cbd6634a0919fc7d0e9 Mon Sep 17 00:00:00 2001 From: "Theo N. Truong" Date: Tue, 24 Sep 2024 09:57:49 -0600 Subject: [PATCH] Fixed Generator: TypesFileRenderer (#878) - Handle edge case where allOf comprises only named schemas. - Imported objects are now sorted alphabetically instead of by order of reference. Signed-off-by: Theo Truong --- api/OpenSearchAPI.d.ts | 104 +++++++ api/OpenSearchAPI.js | 2 + api/_core/bulk.d.ts | 4 +- api/_core/clearScroll.d.ts | 2 +- api/_core/count.d.ts | 4 +- api/_core/create.d.ts | 2 +- api/_core/createPit.d.ts | 4 +- api/_core/createPit.js | 2 +- api/_core/delete.d.ts | 2 +- api/_core/deleteAllPits.d.ts | 2 +- api/_core/deleteByQuery.d.ts | 19 +- api/_core/deleteByQueryRethrottle.d.ts | 2 +- api/_core/deletePit.d.ts | 2 +- api/_core/deleteScript.d.ts | 2 +- api/_core/exists.d.ts | 4 +- api/_core/existsSource.d.ts | 4 +- api/_core/explain.d.ts | 4 +- api/_core/fieldCaps.d.ts | 4 +- api/_core/get.d.ts | 4 +- api/_core/getAllPits.d.ts | 2 +- api/_core/getScript.d.ts | 2 +- api/_core/getScriptContext.d.ts | 2 +- api/_core/getScriptLanguages.d.ts | 2 +- api/_core/getSource.d.ts | 4 +- api/_core/index.d.ts | 2 +- api/_core/info.d.ts | 2 +- api/_core/mget.d.ts | 4 +- api/_core/msearch.d.ts | 2 +- api/_core/msearchTemplate.d.ts | 4 +- api/_core/mtermvectors.d.ts | 2 +- api/_core/putScript.d.ts | 2 +- api/_core/putScript.js | 2 +- api/_core/rankEval.d.ts | 4 +- api/_core/reindex.d.ts | 19 +- api/_core/reindexRethrottle.d.ts | 2 +- api/_core/renderSearchTemplate.d.ts | 2 +- api/_core/scriptsPainlessExecute.d.ts | 4 +- api/_core/scroll.d.ts | 2 +- api/_core/search.d.ts | 7 +- api/_core/searchShards.d.ts | 2 +- api/_core/searchTemplate.d.ts | 2 +- api/_core/termvectors.d.ts | 2 +- api/_core/update.d.ts | 4 +- api/_core/updateByQuery.d.ts | 19 +- api/_core/updateByQueryRethrottle.d.ts | 2 +- api/_types/_common.aggregations.d.ts | 2 +- api/_types/_common.d.ts | 212 ++++++++------ api/_types/_common.mapping.d.ts | 2 +- api/_types/_common.query_dsl.d.ts | 15 +- api/_types/_core.bulk.d.ts | 6 +- api/_types/_core.mget.d.ts | 2 +- api/_types/_core.msearch.d.ts | 6 +- api/_types/_core.msearch_template.d.ts | 2 +- api/_types/_core.reindex.d.ts | 2 +- api/_types/_core.search.d.ts | 4 +- api/_types/asynchronous_search._common.d.ts | 6 +- api/_types/cat._common.d.ts | 5 +- api/_types/cat.allocation.d.ts | 2 +- api/_types/cat.health.d.ts | 2 +- api/_types/cat.nodes.d.ts | 8 +- api/_types/cat.recovery.d.ts | 6 +- api/_types/cat.segments.d.ts | 2 +- api/_types/cluster._common.d.ts | 2 +- api/_types/cluster.allocation_explain.d.ts | 20 +- api/_types/cluster.health.d.ts | 3 +- api/_types/cluster.reroute.d.ts | 2 + api/_types/cluster.stats.d.ts | 62 ++--- api/_types/flow_framework.common.d.ts | 113 ++++++++ api/_types/flow_framework.errors.d.ts | 47 +++- api/_types/indices._common.d.ts | 14 +- api/_types/indices.data_streams_stats.d.ts | 4 +- api/_types/indices.get_index_template.d.ts | 2 +- api/_types/indices.put_index_template.d.ts | 2 +- api/_types/indices.recovery.d.ts | 22 +- api/_types/indices.rollover.d.ts | 16 +- api/_types/indices.segments.d.ts | 8 +- api/_types/indices.shard_stores.d.ts | 4 +- api/_types/indices.simulate_template.d.ts | 2 +- api/_types/indices.stats.d.ts | 12 +- api/_types/ism._common.d.ts | 259 ++++++++++++++++++ api/_types/ml._common.d.ts | 72 +++++ api/_types/nodes._common.d.ts | 203 +++++++------- api/_types/nodes.info.d.ts | 34 +-- api/_types/nodes.reload_secure_settings.d.ts | 2 +- api/_types/nodes.stats.d.ts | 2 +- api/_types/snapshot._common.d.ts | 8 +- api/_types/tasks._common.d.ts | 32 ++- api/asynchronousSearch/get.d.ts | 2 +- api/asynchronousSearch/search.d.ts | 2 +- api/asynchronousSearch/stats.d.ts | 2 +- api/cat/aliases.d.ts | 4 +- api/cat/allPitSegments.d.ts | 6 +- api/cat/allocation.d.ts | 6 +- api/cat/clusterManager.d.ts | 4 +- api/cat/count.d.ts | 4 +- api/cat/fielddata.d.ts | 6 +- api/cat/health.d.ts | 4 +- api/cat/indices.d.ts | 6 +- api/cat/master.d.ts | 4 +- api/cat/nodeattrs.d.ts | 4 +- api/cat/nodes.d.ts | 6 +- api/cat/pendingTasks.d.ts | 4 +- api/cat/pitSegments.d.ts | 6 +- api/cat/plugins.d.ts | 4 +- api/cat/recovery.d.ts | 6 +- api/cat/repositories.d.ts | 4 +- api/cat/segmentReplication.d.ts | 6 +- api/cat/segments.d.ts | 6 +- api/cat/shards.d.ts | 6 +- api/cat/snapshots.d.ts | 4 +- api/cat/tasks.d.ts | 4 +- api/cat/templates.d.ts | 4 +- api/cat/threadPool.d.ts | 4 +- api/cluster/allocationExplain.d.ts | 4 +- api/cluster/deleteComponentTemplate.d.ts | 2 +- api/cluster/deleteDecommissionAwareness.d.ts | 2 +- api/cluster/deleteWeightedRouting.d.ts | 2 +- api/cluster/existsComponentTemplate.d.ts | 2 +- api/cluster/getComponentTemplate.d.ts | 4 +- api/cluster/getDecommissionAwareness.d.ts | 2 +- api/cluster/getSettings.d.ts | 2 +- api/cluster/getWeightedRouting.d.ts | 2 +- api/cluster/health.d.ts | 4 +- api/cluster/pendingTasks.d.ts | 4 +- api/cluster/postVotingConfigExclusions.d.ts | 2 +- api/cluster/putComponentTemplate.d.ts | 2 +- api/cluster/putDecommissionAwareness.d.ts | 2 +- api/cluster/putSettings.d.ts | 2 +- api/cluster/putWeightedRouting.d.ts | 2 +- api/cluster/remoteInfo.d.ts | 2 +- api/cluster/reroute.d.ts | 6 +- api/cluster/state.d.ts | 4 +- api/cluster/stats.d.ts | 4 +- api/danglingIndices/deleteDanglingIndex.d.ts | 2 +- api/danglingIndices/importDanglingIndex.d.ts | 2 +- api/danglingIndices/listDanglingIndices.d.ts | 2 +- api/flowFramework/_api.js | 12 + api/flowFramework/create.d.ts | 11 +- api/flowFramework/create.js | 3 +- api/flowFramework/delete.d.ts | 3 +- api/flowFramework/deprovision.d.ts | 31 +++ api/flowFramework/deprovision.js | 50 ++++ api/flowFramework/get.d.ts | 3 +- api/flowFramework/getStatus.d.ts | 31 +++ api/flowFramework/getStatus.js | 50 ++++ api/flowFramework/getSteps.d.ts | 30 ++ api/flowFramework/getSteps.js | 47 ++++ api/flowFramework/provision.d.ts | 31 +++ api/flowFramework/provision.js | 50 ++++ api/flowFramework/search.d.ts | 30 ++ api/flowFramework/search.js | 47 ++++ api/flowFramework/searchState.d.ts | 30 ++ api/flowFramework/searchState.js | 47 ++++ api/flowFramework/update.d.ts | 10 +- api/flowFramework/update.js | 4 + api/index.d.ts | 50 +++- api/indices/addBlock.d.ts | 2 +- api/indices/analyze.d.ts | 2 +- api/indices/clearCache.d.ts | 2 +- api/indices/clone.d.ts | 2 +- api/indices/close.d.ts | 2 +- api/indices/create.d.ts | 4 +- api/indices/createDataStream.d.ts | 2 +- api/indices/dataStreamsStats.d.ts | 6 +- api/indices/delete.d.ts | 2 +- api/indices/deleteAlias.d.ts | 2 +- api/indices/deleteDataStream.d.ts | 2 +- api/indices/deleteIndexTemplate.d.ts | 2 +- api/indices/deleteTemplate.d.ts | 2 +- api/indices/exists.d.ts | 2 +- api/indices/existsAlias.d.ts | 2 +- api/indices/existsIndexTemplate.d.ts | 2 +- api/indices/existsTemplate.d.ts | 2 +- api/indices/flush.d.ts | 2 +- api/indices/forcemerge.d.ts | 2 +- api/indices/get.d.ts | 2 +- api/indices/getAlias.d.ts | 2 +- api/indices/getDataStream.d.ts | 2 +- api/indices/getFieldMapping.d.ts | 2 +- api/indices/getIndexTemplate.d.ts | 2 +- api/indices/getMapping.d.ts | 2 +- api/indices/getSettings.d.ts | 2 +- api/indices/getTemplate.d.ts | 2 +- api/indices/getUpgrade.d.ts | 2 +- api/indices/open.d.ts | 2 +- api/indices/putAlias.d.ts | 2 +- api/indices/putIndexTemplate.d.ts | 2 +- api/indices/putMapping.d.ts | 2 +- api/indices/putSettings.d.ts | 2 +- api/indices/putTemplate.d.ts | 4 +- api/indices/recovery.d.ts | 2 +- api/indices/refresh.d.ts | 2 +- api/indices/resolveIndex.d.ts | 2 +- api/indices/rollover.d.ts | 4 +- api/indices/segments.d.ts | 2 +- api/indices/shardStores.d.ts | 4 +- api/indices/shrink.d.ts | 2 +- api/indices/simulateIndexTemplate.d.ts | 2 +- api/indices/simulateTemplate.d.ts | 2 +- api/indices/split.d.ts | 2 +- api/indices/stats.d.ts | 4 +- api/indices/updateAliases.d.ts | 2 +- api/indices/upgrade.d.ts | 2 +- api/indices/validateQuery.d.ts | 4 +- api/ingest/deletePipeline.d.ts | 2 +- api/ingest/getPipeline.d.ts | 2 +- api/ingest/putPipeline.d.ts | 2 +- api/ingest/simulate.d.ts | 4 +- api/ism/_api.js | 61 +++++ api/ism/addPolicy.d.ts | 32 +++ api/ism/addPolicy.js | 49 ++++ api/ism/changePolicy.d.ts | 32 +++ api/ism/changePolicy.js | 49 ++++ api/ism/deletePolicy.d.ts | 30 ++ api/ism/deletePolicy.js | 49 ++++ api/ism/existsPolicy.d.ts | 29 ++ api/ism/existsPolicy.js | 49 ++++ api/ism/explainPolicy.d.ts | 34 +++ api/ism/explainPolicy.js | 49 ++++ api/ism/getPolicies.d.ts | 28 ++ api/ism/getPolicies.js | 45 +++ api/ism/getPolicy.d.ts | 30 ++ api/ism/getPolicy.js | 49 ++++ api/ism/putPolicies.d.ts | 34 +++ api/ism/putPolicies.js | 51 ++++ api/ism/putPolicy.d.ts | 34 +++ api/ism/putPolicy.js | 52 ++++ api/ism/refreshSearchAnalyzers.d.ts | 31 +++ api/ism/refreshSearchAnalyzers.js | 49 ++++ api/ism/removePolicy.d.ts | 31 +++ api/ism/removePolicy.js | 48 ++++ api/ism/retryIndex.d.ts | 32 +++ api/ism/retryIndex.js | 49 ++++ api/knn/searchModels.d.ts | 4 +- api/knn/searchModels.js | 2 +- api/knn/stats.d.ts | 2 +- api/ml/_api.js | 12 + api/ml/createConnector.d.ts | 32 +++ api/ml/createConnector.js | 47 ++++ api/ml/deleteAgent.d.ts | 30 ++ api/ml/deleteAgent.js | 49 ++++ api/ml/deleteConnector.d.ts | 30 ++ api/ml/deleteConnector.js | 49 ++++ api/ml/deleteModel.d.ts | 2 +- api/ml/deleteModelGroup.d.ts | 2 +- api/ml/deleteTask.d.ts | 2 +- api/ml/registerAgents.d.ts | 32 +++ api/ml/registerAgents.js | 47 ++++ api/nodes/hotThreads.d.ts | 2 +- api/nodes/info.d.ts | 2 +- api/nodes/reloadSecureSettings.d.ts | 2 +- api/nodes/stats.d.ts | 2 +- api/nodes/usage.d.ts | 2 +- api/remoteStore/restore.d.ts | 2 +- api/rollups/delete.d.ts | 2 +- api/rollups/explain.d.ts | 2 +- api/rollups/get.d.ts | 2 +- api/rollups/put.d.ts | 2 +- api/rollups/start.d.ts | 2 +- api/rollups/stop.d.ts | 2 +- api/searchPipeline/delete.d.ts | 2 +- api/searchPipeline/get.d.ts | 2 +- api/searchPipeline/put.d.ts | 2 +- api/security/_api.js | 3 + api/security/generateUserTokenLegacy.d.ts | 29 ++ api/security/generateUserTokenLegacy.js | 49 ++++ api/security/getAllCertificates.d.ts | 2 +- api/security/getNodeCertificates.d.ts | 2 +- api/snapshot/cleanupRepository.d.ts | 2 +- api/snapshot/clone.d.ts | 2 +- api/snapshot/create.d.ts | 2 +- api/snapshot/createRepository.d.ts | 2 +- api/snapshot/delete.d.ts | 2 +- api/snapshot/deleteRepository.d.ts | 2 +- api/snapshot/get.d.ts | 4 +- api/snapshot/getRepository.d.ts | 2 +- api/snapshot/restore.d.ts | 2 +- api/snapshot/status.d.ts | 2 +- api/snapshot/verifyRepository.d.ts | 2 +- api/tasks/cancel.d.ts | 2 +- api/tasks/get.d.ts | 4 +- api/tasks/list.d.ts | 2 +- api/transforms/delete.d.ts | 2 +- api/transforms/explain.d.ts | 2 +- api/transforms/get.d.ts | 2 +- api/transforms/preview.d.ts | 8 +- api/transforms/preview.js | 6 +- api/transforms/put.d.ts | 2 +- api/transforms/start.d.ts | 2 +- api/transforms/stop.d.ts | 2 +- .../render_types/TypesFileRenderder.ts | 39 +-- index.js | 2 - 292 files changed, 3277 insertions(+), 684 deletions(-) create mode 100644 api/_types/ism._common.d.ts create mode 100644 api/flowFramework/deprovision.d.ts create mode 100644 api/flowFramework/deprovision.js create mode 100644 api/flowFramework/getStatus.d.ts create mode 100644 api/flowFramework/getStatus.js create mode 100644 api/flowFramework/getSteps.d.ts create mode 100644 api/flowFramework/getSteps.js create mode 100644 api/flowFramework/provision.d.ts create mode 100644 api/flowFramework/provision.js create mode 100644 api/flowFramework/search.d.ts create mode 100644 api/flowFramework/search.js create mode 100644 api/flowFramework/searchState.d.ts create mode 100644 api/flowFramework/searchState.js create mode 100644 api/ism/_api.js create mode 100644 api/ism/addPolicy.d.ts create mode 100644 api/ism/addPolicy.js create mode 100644 api/ism/changePolicy.d.ts create mode 100644 api/ism/changePolicy.js create mode 100644 api/ism/deletePolicy.d.ts create mode 100644 api/ism/deletePolicy.js create mode 100644 api/ism/existsPolicy.d.ts create mode 100644 api/ism/existsPolicy.js create mode 100644 api/ism/explainPolicy.d.ts create mode 100644 api/ism/explainPolicy.js create mode 100644 api/ism/getPolicies.d.ts create mode 100644 api/ism/getPolicies.js create mode 100644 api/ism/getPolicy.d.ts create mode 100644 api/ism/getPolicy.js create mode 100644 api/ism/putPolicies.d.ts create mode 100644 api/ism/putPolicies.js create mode 100644 api/ism/putPolicy.d.ts create mode 100644 api/ism/putPolicy.js create mode 100644 api/ism/refreshSearchAnalyzers.d.ts create mode 100644 api/ism/refreshSearchAnalyzers.js create mode 100644 api/ism/removePolicy.d.ts create mode 100644 api/ism/removePolicy.js create mode 100644 api/ism/retryIndex.d.ts create mode 100644 api/ism/retryIndex.js create mode 100644 api/ml/createConnector.d.ts create mode 100644 api/ml/createConnector.js create mode 100644 api/ml/deleteAgent.d.ts create mode 100644 api/ml/deleteAgent.js create mode 100644 api/ml/deleteConnector.d.ts create mode 100644 api/ml/deleteConnector.js create mode 100644 api/ml/registerAgents.d.ts create mode 100644 api/ml/registerAgents.js create mode 100644 api/security/generateUserTokenLegacy.d.ts create mode 100644 api/security/generateUserTokenLegacy.js diff --git a/api/OpenSearchAPI.d.ts b/api/OpenSearchAPI.d.ts index cfe95d16e..b735dafc8 100644 --- a/api/OpenSearchAPI.d.ts +++ b/api/OpenSearchAPI.d.ts @@ -300,6 +300,15 @@ export default class OpenSearchAPI { create (params: API.FlowFramework_Create_Request, callback: callbackFn): TransportRequestCallback; create (params: API.FlowFramework_Create_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + search (params: API.FlowFramework_Search_Request, options?: TransportRequestOptions): TransportRequestPromise; + search (params: API.FlowFramework_Search_Request, callback: callbackFn): TransportRequestCallback; + search (params: API.FlowFramework_Search_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getSteps (params?: API.FlowFramework_GetSteps_Request, options?: TransportRequestOptions): TransportRequestPromise; + getSteps (callback: callbackFn): TransportRequestCallback; + getSteps (params: API.FlowFramework_GetSteps_Request, callback: callbackFn): TransportRequestCallback; + getSteps (params: API.FlowFramework_GetSteps_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + delete (params: API.FlowFramework_Delete_Request, options?: TransportRequestOptions): TransportRequestPromise; delete (params: API.FlowFramework_Delete_Request, callback: callbackFn): TransportRequestCallback; delete (params: API.FlowFramework_Delete_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; @@ -312,6 +321,22 @@ export default class OpenSearchAPI { update (params: API.FlowFramework_Update_Request, callback: callbackFn): TransportRequestCallback; update (params: API.FlowFramework_Update_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + deprovision (params: API.FlowFramework_Deprovision_Request, options?: TransportRequestOptions): TransportRequestPromise; + deprovision (params: API.FlowFramework_Deprovision_Request, callback: callbackFn): TransportRequestCallback; + deprovision (params: API.FlowFramework_Deprovision_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + provision (params: API.FlowFramework_Provision_Request, options?: TransportRequestOptions): TransportRequestPromise; + provision (params: API.FlowFramework_Provision_Request, callback: callbackFn): TransportRequestCallback; + provision (params: API.FlowFramework_Provision_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getStatus (params: API.FlowFramework_GetStatus_Request, options?: TransportRequestOptions): TransportRequestPromise; + getStatus (params: API.FlowFramework_GetStatus_Request, callback: callbackFn): TransportRequestCallback; + getStatus (params: API.FlowFramework_GetStatus_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + searchState (params: API.FlowFramework_SearchState_Request, options?: TransportRequestOptions): TransportRequestPromise; + searchState (params: API.FlowFramework_SearchState_Request, callback: callbackFn): TransportRequestCallback; + searchState (params: API.FlowFramework_SearchState_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + }; indices: { @@ -555,6 +580,63 @@ export default class OpenSearchAPI { }; + ism: { + addPolicy (params?: API.Ism_AddPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + addPolicy (callback: callbackFn): TransportRequestCallback; + addPolicy (params: API.Ism_AddPolicy_Request, callback: callbackFn): TransportRequestCallback; + addPolicy (params: API.Ism_AddPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + changePolicy (params?: API.Ism_ChangePolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + changePolicy (callback: callbackFn): TransportRequestCallback; + changePolicy (params: API.Ism_ChangePolicy_Request, callback: callbackFn): TransportRequestCallback; + changePolicy (params: API.Ism_ChangePolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + explainPolicy (params?: API.Ism_ExplainPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + explainPolicy (callback: callbackFn): TransportRequestCallback; + explainPolicy (params: API.Ism_ExplainPolicy_Request, callback: callbackFn): TransportRequestCallback; + explainPolicy (params: API.Ism_ExplainPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getPolicies (params?: API.Ism_GetPolicies_Request, options?: TransportRequestOptions): TransportRequestPromise; + getPolicies (callback: callbackFn): TransportRequestCallback; + getPolicies (params: API.Ism_GetPolicies_Request, callback: callbackFn): TransportRequestCallback; + getPolicies (params: API.Ism_GetPolicies_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putPolicies (params: API.Ism_PutPolicies_Request, options?: TransportRequestOptions): TransportRequestPromise; + putPolicies (params: API.Ism_PutPolicies_Request, callback: callbackFn): TransportRequestCallback; + putPolicies (params: API.Ism_PutPolicies_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deletePolicy (params: API.Ism_DeletePolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + deletePolicy (params: API.Ism_DeletePolicy_Request, callback: callbackFn): TransportRequestCallback; + deletePolicy (params: API.Ism_DeletePolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getPolicy (params: API.Ism_GetPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + getPolicy (params: API.Ism_GetPolicy_Request, callback: callbackFn): TransportRequestCallback; + getPolicy (params: API.Ism_GetPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + existsPolicy (params: API.Ism_ExistsPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + existsPolicy (params: API.Ism_ExistsPolicy_Request, callback: callbackFn): TransportRequestCallback; + existsPolicy (params: API.Ism_ExistsPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + putPolicy (params: API.Ism_PutPolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + putPolicy (params: API.Ism_PutPolicy_Request, callback: callbackFn): TransportRequestCallback; + putPolicy (params: API.Ism_PutPolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + removePolicy (params?: API.Ism_RemovePolicy_Request, options?: TransportRequestOptions): TransportRequestPromise; + removePolicy (callback: callbackFn): TransportRequestCallback; + removePolicy (params: API.Ism_RemovePolicy_Request, callback: callbackFn): TransportRequestCallback; + removePolicy (params: API.Ism_RemovePolicy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + retryIndex (params?: API.Ism_RetryIndex_Request, options?: TransportRequestOptions): TransportRequestPromise; + retryIndex (callback: callbackFn): TransportRequestCallback; + retryIndex (params: API.Ism_RetryIndex_Request, callback: callbackFn): TransportRequestCallback; + retryIndex (params: API.Ism_RetryIndex_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + refreshSearchAnalyzers (params: API.Ism_RefreshSearchAnalyzers_Request, options?: TransportRequestOptions): TransportRequestPromise; + refreshSearchAnalyzers (params: API.Ism_RefreshSearchAnalyzers_Request, callback: callbackFn): TransportRequestCallback; + refreshSearchAnalyzers (params: API.Ism_RefreshSearchAnalyzers_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + knn: { stats (params?: API.Knn_Stats_Request, options?: TransportRequestOptions): TransportRequestPromise; stats (callback: callbackFn): TransportRequestCallback; @@ -585,6 +667,24 @@ export default class OpenSearchAPI { }; ml: { + registerAgents (params?: API.Ml_RegisterAgents_Request, options?: TransportRequestOptions): TransportRequestPromise; + registerAgents (callback: callbackFn): TransportRequestCallback; + registerAgents (params: API.Ml_RegisterAgents_Request, callback: callbackFn): TransportRequestCallback; + registerAgents (params: API.Ml_RegisterAgents_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteAgent (params: API.Ml_DeleteAgent_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteAgent (params: API.Ml_DeleteAgent_Request, callback: callbackFn): TransportRequestCallback; + deleteAgent (params: API.Ml_DeleteAgent_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + createConnector (params?: API.Ml_CreateConnector_Request, options?: TransportRequestOptions): TransportRequestPromise; + createConnector (callback: callbackFn): TransportRequestCallback; + createConnector (params: API.Ml_CreateConnector_Request, callback: callbackFn): TransportRequestCallback; + createConnector (params: API.Ml_CreateConnector_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteConnector (params: API.Ml_DeleteConnector_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteConnector (params: API.Ml_DeleteConnector_Request, callback: callbackFn): TransportRequestCallback; + deleteConnector (params: API.Ml_DeleteConnector_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + registerModelGroup (params?: API.Ml_RegisterModelGroup_Request, options?: TransportRequestOptions): TransportRequestPromise; registerModelGroup (callback: callbackFn): TransportRequestCallback; registerModelGroup (params: API.Ml_RegisterModelGroup_Request, callback: callbackFn): TransportRequestCallback; @@ -1123,6 +1223,10 @@ export default class OpenSearchAPI { createUserLegacy (params: API.Security_CreateUserLegacy_Request, callback: callbackFn): TransportRequestCallback; createUserLegacy (params: API.Security_CreateUserLegacy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + generateUserTokenLegacy (params: API.Security_GenerateUserTokenLegacy_Request, options?: TransportRequestOptions): TransportRequestPromise; + generateUserTokenLegacy (params: API.Security_GenerateUserTokenLegacy_Request, callback: callbackFn): TransportRequestCallback; + generateUserTokenLegacy (params: API.Security_GenerateUserTokenLegacy_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + validate (params?: API.Security_Validate_Request, options?: TransportRequestOptions): TransportRequestPromise; validate (callback: callbackFn): TransportRequestCallback; validate (params: API.Security_Validate_Request, callback: callbackFn): TransportRequestCallback; diff --git a/api/OpenSearchAPI.js b/api/OpenSearchAPI.js index b990fb980..272ddbbbf 100644 --- a/api/OpenSearchAPI.js +++ b/api/OpenSearchAPI.js @@ -31,6 +31,7 @@ class OpenSearchAPI { http: new(require('./http/_api'))(this), indices: new(require('./indices/_api'))(this), ingest: new(require('./ingest/_api'))(this), + ism: new(require('./ism/_api'))(this), knn: new(require('./knn/_api'))(this), ml: new(require('./ml/_api'))(this), nodes: new(require('./nodes/_api'))(this), @@ -152,6 +153,7 @@ class OpenSearchAPI { http: { get() { return this[kApiModules].http } }, indices: { get() { return this[kApiModules].indices } }, ingest: { get() { return this[kApiModules].ingest } }, + ism: { get() { return this[kApiModules].ism } }, knn: { get() { return this[kApiModules].knn } }, ml: { get() { return this[kApiModules].ml } }, nodes: { get() { return this[kApiModules].nodes } }, diff --git a/api/_core/bulk.d.ts b/api/_core/bulk.d.ts index ccbaa1abc..c98ba8c92 100644 --- a/api/_core/bulk.d.ts +++ b/api/_core/bulk.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' import * as Core_Bulk from '../_types/_core.bulk' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Bulk_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/clearScroll.d.ts b/api/_core/clearScroll.d.ts index 96d9b5d27..154dc980e 100644 --- a/api/_core/clearScroll.d.ts +++ b/api/_core/clearScroll.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface ClearScroll_Request extends Global.Params { body?: ClearScroll_RequestBody; diff --git a/api/_core/count.d.ts b/api/_core/count.d.ts index 7ba4468c7..0fae9dfcf 100644 --- a/api/_core/count.d.ts +++ b/api/_core/count.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common_QueryDsl from '../_types/_common.query_dsl' import * as Common from '../_types/_common' +import * as Common_QueryDsl from '../_types/_common.query_dsl' +import * as Global from '../_types/_global' export interface Count_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/_core/create.d.ts b/api/_core/create.d.ts index 09507a36c..f9ba49b75 100644 --- a/api/_core/create.d.ts +++ b/api/_core/create.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Create_Request extends Global.Params { body: Create_RequestBody; diff --git a/api/_core/createPit.d.ts b/api/_core/createPit.d.ts index 7dee1a66f..b91431475 100644 --- a/api/_core/createPit.d.ts +++ b/api/_core/createPit.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_Common from '../_types/_core._common' +import * as Global from '../_types/_global' export interface CreatePit_Request extends Global.Params { allow_partial_pit_creation?: boolean; @@ -25,7 +25,7 @@ export interface CreatePit_Request extends Global.Params { index: string[]; keep_alive?: Common.Duration; preference?: string; - routing?: string[]; + routing?: Common.Routing; } export interface CreatePit_Response extends ApiResponse { diff --git a/api/_core/createPit.js b/api/_core/createPit.js index dc671c0bc..9a827f3a1 100644 --- a/api/_core/createPit.js +++ b/api/_core/createPit.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {string} [params.keep_alive] - Specify the keep alive for point in time. * @param {string} [params.preference=random] - Specify the node or shard the operation should be performed on. - * @param {array} [params.routing] - Comma-separated list of specific routing values. + * @param {string} [params.routing] - Comma-separated list of specific routing values. * @param {array} params.index - Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/_core/delete.d.ts b/api/_core/delete.d.ts index f645cf79a..f63c75380 100644 --- a/api/_core/delete.d.ts +++ b/api/_core/delete.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Delete_Request extends Global.Params { id: Common.Id; diff --git a/api/_core/deleteAllPits.d.ts b/api/_core/deleteAllPits.d.ts index 271d8ee2d..5da0ae7bb 100644 --- a/api/_core/deleteAllPits.d.ts +++ b/api/_core/deleteAllPits.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Core_Common from '../_types/_core._common' +import * as Global from '../_types/_global' export type DeleteAllPits_Request = Global.Params & Record diff --git a/api/_core/deleteByQuery.d.ts b/api/_core/deleteByQuery.d.ts index 42ab27676..68fb26ed8 100644 --- a/api/_core/deleteByQuery.d.ts +++ b/api/_core/deleteByQuery.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Common_QueryDsl from '../_types/_common.query_dsl' +import * as Global from '../_types/_global' export interface DeleteByQuery_Request extends Global.Params { _source?: string[]; @@ -67,22 +67,7 @@ export interface DeleteByQuery_Response extends ApiResponse { body: DeleteByQuery_ResponseBody; } -export interface DeleteByQuery_ResponseBody { - batches?: number; - deleted?: number; - failures?: Common.BulkIndexByScrollFailure[]; - noops?: number; - requests_per_second?: number; - retries?: Common.Retries; - slice_id?: number; +export type DeleteByQuery_ResponseBody = Common.BulkByScrollResponseBase | { task?: Common.TaskId; - throttled?: Common.Duration; - throttled_millis?: Common.DurationValueUnitMillis; - throttled_until?: Common.Duration; - throttled_until_millis?: Common.DurationValueUnitMillis; - timed_out?: boolean; - took?: Common.DurationValueUnitMillis; - total?: number; - version_conflicts?: number; } diff --git a/api/_core/deleteByQueryRethrottle.d.ts b/api/_core/deleteByQueryRethrottle.d.ts index 8afec3d6c..97da7a082 100644 --- a/api/_core/deleteByQueryRethrottle.d.ts +++ b/api/_core/deleteByQueryRethrottle.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Tasks_Common from '../_types/tasks._common' export interface DeleteByQueryRethrottle_Request extends Global.Params { diff --git a/api/_core/deletePit.d.ts b/api/_core/deletePit.d.ts index 973c61adb..e6c5aaab8 100644 --- a/api/_core/deletePit.d.ts +++ b/api/_core/deletePit.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Core_Common from '../_types/_core._common' +import * as Global from '../_types/_global' export interface DeletePit_Request extends Global.Params { body?: DeletePit_RequestBody; diff --git a/api/_core/deleteScript.d.ts b/api/_core/deleteScript.d.ts index 3c28250f6..53fd9c3be 100644 --- a/api/_core/deleteScript.d.ts +++ b/api/_core/deleteScript.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface DeleteScript_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/_core/exists.d.ts b/api/_core/exists.d.ts index 2f3e8c59e..fb3d7e4cf 100644 --- a/api/_core/exists.d.ts +++ b/api/_core/exists.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Exists_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/existsSource.d.ts b/api/_core/existsSource.d.ts index 94c73664e..2bbf27fa1 100644 --- a/api/_core/existsSource.d.ts +++ b/api/_core/existsSource.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface ExistsSource_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/explain.d.ts b/api/_core/explain.d.ts index e7117aa5f..a0f8fed74 100644 --- a/api/_core/explain.d.ts +++ b/api/_core/explain.d.ts @@ -15,11 +15,11 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' import * as Common_QueryDsl from '../_types/_common.query_dsl' import * as Core_Explain from '../_types/_core.explain' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Explain_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/fieldCaps.d.ts b/api/_core/fieldCaps.d.ts index b8919816d..6bb3f3f38 100644 --- a/api/_core/fieldCaps.d.ts +++ b/api/_core/fieldCaps.d.ts @@ -15,11 +15,11 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' -import * as Common_QueryDsl from '../_types/_common.query_dsl' import * as Common_Mapping from '../_types/_common.mapping' +import * as Common_QueryDsl from '../_types/_common.query_dsl' import * as Core_FieldCaps from '../_types/_core.field_caps' +import * as Global from '../_types/_global' export interface FieldCaps_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/_core/get.d.ts b/api/_core/get.d.ts index 0693d0d9d..330d00d53 100644 --- a/api/_core/get.d.ts +++ b/api/_core/get.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' import * as Core_Get from '../_types/_core.get' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Get_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/getAllPits.d.ts b/api/_core/getAllPits.d.ts index 7040ff7dd..0584cc767 100644 --- a/api/_core/getAllPits.d.ts +++ b/api/_core/getAllPits.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Core_Common from '../_types/_core._common' +import * as Global from '../_types/_global' export type GetAllPits_Request = Global.Params & Record diff --git a/api/_core/getScript.d.ts b/api/_core/getScript.d.ts index 3cc41db19..1e58698e9 100644 --- a/api/_core/getScript.d.ts +++ b/api/_core/getScript.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface GetScript_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/_core/getScriptContext.d.ts b/api/_core/getScriptContext.d.ts index 0ca9318b0..216b57e3c 100644 --- a/api/_core/getScriptContext.d.ts +++ b/api/_core/getScriptContext.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Core_GetScriptContext from '../_types/_core.get_script_context' +import * as Global from '../_types/_global' export type GetScriptContext_Request = Global.Params & Record diff --git a/api/_core/getScriptLanguages.d.ts b/api/_core/getScriptLanguages.d.ts index 2e11a1a14..9dd187dab 100644 --- a/api/_core/getScriptLanguages.d.ts +++ b/api/_core/getScriptLanguages.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Core_GetScriptLanguages from '../_types/_core.get_script_languages' +import * as Global from '../_types/_global' export type GetScriptLanguages_Request = Global.Params & Record diff --git a/api/_core/getSource.d.ts b/api/_core/getSource.d.ts index 77573b3e5..14a5cedbc 100644 --- a/api/_core/getSource.d.ts +++ b/api/_core/getSource.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface GetSource_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/index.d.ts b/api/_core/index.d.ts index c6f2493ce..7c2774b24 100644 --- a/api/_core/index.d.ts +++ b/api/_core/index.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Index_Request extends Global.Params { body: Index_RequestBody; diff --git a/api/_core/info.d.ts b/api/_core/info.d.ts index b2d26e5ea..692a08671 100644 --- a/api/_core/info.d.ts +++ b/api/_core/info.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export type Info_Request = Global.Params & Record diff --git a/api/_core/mget.d.ts b/api/_core/mget.d.ts index ebc0fc65f..522b28586 100644 --- a/api/_core/mget.d.ts +++ b/api/_core/mget.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' import * as Core_Mget from '../_types/_core.mget' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Mget_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/msearch.d.ts b/api/_core/msearch.d.ts index 7e88423fc..159a0eede 100644 --- a/api/_core/msearch.d.ts +++ b/api/_core/msearch.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_Msearch from '../_types/_core.msearch' +import * as Global from '../_types/_global' export interface Msearch_Request extends Global.Params { body: Msearch_RequestBody; diff --git a/api/_core/msearchTemplate.d.ts b/api/_core/msearchTemplate.d.ts index eed44c15c..665ecc10f 100644 --- a/api/_core/msearchTemplate.d.ts +++ b/api/_core/msearchTemplate.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' -import * as Core_MsearchTemplate from '../_types/_core.msearch_template' import * as Core_Msearch from '../_types/_core.msearch' +import * as Core_MsearchTemplate from '../_types/_core.msearch_template' +import * as Global from '../_types/_global' export interface MsearchTemplate_Request extends Global.Params { body: MsearchTemplate_RequestBody; diff --git a/api/_core/mtermvectors.d.ts b/api/_core/mtermvectors.d.ts index e6803a950..cb6649161 100644 --- a/api/_core/mtermvectors.d.ts +++ b/api/_core/mtermvectors.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_Mtermvectors from '../_types/_core.mtermvectors' +import * as Global from '../_types/_global' export interface Mtermvectors_Request extends Global.Params { body?: Mtermvectors_RequestBody; diff --git a/api/_core/putScript.d.ts b/api/_core/putScript.d.ts index deb7751a2..df2eb81ce 100644 --- a/api/_core/putScript.d.ts +++ b/api/_core/putScript.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface PutScript_Request extends Global.Params { body: PutScript_RequestBody; diff --git a/api/_core/putScript.js b/api/_core/putScript.js index d637baa04..86e81a67d 100644 --- a/api/_core/putScript.js +++ b/api/_core/putScript.js @@ -26,10 +26,10 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. + * @param {string} [params.context] - Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. * @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.id - Identifier for the stored script or search template. Must be unique within the cluster. - * @param {string} [params.context] - Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. * @param {object} params.body - The document * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/_core/rankEval.d.ts b/api/_core/rankEval.d.ts index 108e9e6b3..561bca9ca 100644 --- a/api/_core/rankEval.d.ts +++ b/api/_core/rankEval.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_RankEval from '../_types/_core.rank_eval' +import * as Global from '../_types/_global' export interface RankEval_Request extends Global.Params { allow_no_indices?: boolean; @@ -25,7 +25,7 @@ export interface RankEval_Request extends Global.Params { expand_wildcards?: Common.ExpandWildcards; ignore_unavailable?: boolean; index?: Common.Indices; - search_type?: string; + search_type?: Common.SearchType; } export interface RankEval_RequestBody { diff --git a/api/_core/reindex.d.ts b/api/_core/reindex.d.ts index 57c506c69..bfc2c7dfa 100644 --- a/api/_core/reindex.d.ts +++ b/api/_core/reindex.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_Reindex from '../_types/_core.reindex' +import * as Global from '../_types/_global' export interface Reindex_Request extends Global.Params { body: Reindex_RequestBody; @@ -44,22 +44,7 @@ export interface Reindex_Response extends ApiResponse { body: Reindex_ResponseBody; } -export interface Reindex_ResponseBody { - batches?: number; - created?: number; - deleted?: number; - failures?: Common.BulkIndexByScrollFailure[]; - noops?: number; - requests_per_second?: number; - retries?: Common.Retries; - slice_id?: number; +export type Reindex_ResponseBody = Common.BulkByScrollResponseBase | { task?: Common.TaskId; - throttled_millis?: Common.EpochTimeUnitMillis; - throttled_until_millis?: Common.EpochTimeUnitMillis; - timed_out?: boolean; - took?: Common.DurationValueUnitMillis; - total?: number; - updated?: number; - version_conflicts?: number; } diff --git a/api/_core/reindexRethrottle.d.ts b/api/_core/reindexRethrottle.d.ts index 8eeb2d274..da2938e60 100644 --- a/api/_core/reindexRethrottle.d.ts +++ b/api/_core/reindexRethrottle.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_ReindexRethrottle from '../_types/_core.reindex_rethrottle' +import * as Global from '../_types/_global' export interface ReindexRethrottle_Request extends Global.Params { requests_per_second?: number; diff --git a/api/_core/renderSearchTemplate.d.ts b/api/_core/renderSearchTemplate.d.ts index b95a63f03..6b1c4cd1f 100644 --- a/api/_core/renderSearchTemplate.d.ts +++ b/api/_core/renderSearchTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface RenderSearchTemplate_Request extends Global.Params { body?: RenderSearchTemplate_RequestBody; diff --git a/api/_core/scriptsPainlessExecute.d.ts b/api/_core/scriptsPainlessExecute.d.ts index 519307550..a6658732d 100644 --- a/api/_core/scriptsPainlessExecute.d.ts +++ b/api/_core/scriptsPainlessExecute.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_ScriptsPainlessExecute from '../_types/_core.scripts_painless_execute' import * as Common from '../_types/_common' +import * as Core_ScriptsPainlessExecute from '../_types/_core.scripts_painless_execute' +import * as Global from '../_types/_global' export interface ScriptsPainlessExecute_Request extends Global.Params { body?: ScriptsPainlessExecute_RequestBody; diff --git a/api/_core/scroll.d.ts b/api/_core/scroll.d.ts index 8cfc2f2d7..b5fb2cdf9 100644 --- a/api/_core/scroll.d.ts +++ b/api/_core/scroll.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Scroll_Request extends Global.Params { body?: Scroll_RequestBody; diff --git a/api/_core/search.d.ts b/api/_core/search.d.ts index c940e7a76..de44dc581 100644 --- a/api/_core/search.d.ts +++ b/api/_core/search.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' -import * as Common_QueryDsl from '../_types/_common.query_dsl' import * as Common_Aggregations from '../_types/_common.aggregations' import * as Common_Mapping from '../_types/_common.mapping' +import * as Common_QueryDsl from '../_types/_common.query_dsl' +import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface Search_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; @@ -84,7 +84,6 @@ export interface Search_RequestBody { from?: number; highlight?: Core_Search.Highlight; indices_boost?: Record[]; - knn?: Common_QueryDsl.KnnQuery | Common_QueryDsl.KnnQuery[]; min_score?: number; pit?: Core_Search.PointInTimeReference; post_filter?: Common_QueryDsl.QueryContainer; diff --git a/api/_core/searchShards.d.ts b/api/_core/searchShards.d.ts index af3e980fc..ee46a3630 100644 --- a/api/_core/searchShards.d.ts +++ b/api/_core/searchShards.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_SearchShards from '../_types/_core.search_shards' +import * as Global from '../_types/_global' export interface SearchShards_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/_core/searchTemplate.d.ts b/api/_core/searchTemplate.d.ts index cfb9b9dfd..ba4f15643 100644 --- a/api/_core/searchTemplate.d.ts +++ b/api/_core/searchTemplate.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Common_Aggregations from '../_types/_common.aggregations' import * as Core_Search from '../_types/_core.search' +import * as Global from '../_types/_global' export interface SearchTemplate_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/_core/termvectors.d.ts b/api/_core/termvectors.d.ts index 158382d4b..b3b3ef07b 100644 --- a/api/_core/termvectors.d.ts +++ b/api/_core/termvectors.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_Termvectors from '../_types/_core.termvectors' +import * as Global from '../_types/_global' export interface Termvectors_Request extends Global.Params { body?: Termvectors_RequestBody; diff --git a/api/_core/update.d.ts b/api/_core/update.d.ts index fc75e570f..58529f821 100644 --- a/api/_core/update.d.ts +++ b/api/_core/update.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Core_Search from '../_types/_core.search' import * as Common from '../_types/_common' +import * as Core_Search from '../_types/_core.search' import * as Core_Update from '../_types/_core.update' +import * as Global from '../_types/_global' export interface Update_Request extends Global.Params { _source?: Core_Search.SourceConfigParam; diff --git a/api/_core/updateByQuery.d.ts b/api/_core/updateByQuery.d.ts index d4d8deb44..9636a87e2 100644 --- a/api/_core/updateByQuery.d.ts +++ b/api/_core/updateByQuery.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Common_QueryDsl from '../_types/_common.query_dsl' +import * as Global from '../_types/_global' export interface UpdateByQuery_Request extends Global.Params { _source?: string[]; @@ -70,22 +70,7 @@ export interface UpdateByQuery_Response extends ApiResponse { body: UpdateByQuery_ResponseBody; } -export interface UpdateByQuery_ResponseBody { - batches?: number; - deleted?: number; - failures?: Common.BulkIndexByScrollFailure[]; - noops?: number; - requests_per_second?: number; - retries?: Common.Retries; +export type UpdateByQuery_ResponseBody = Common.BulkByScrollResponseBase | { task?: Common.TaskId; - throttled?: Common.Duration; - throttled_millis?: Common.DurationValueUnitMillis; - throttled_until?: Common.Duration; - throttled_until_millis?: Common.DurationValueUnitMillis; - timed_out?: boolean; - took?: Common.DurationValueUnitMillis; - total?: number; - updated?: number; - version_conflicts?: number; } diff --git a/api/_core/updateByQueryRethrottle.d.ts b/api/_core/updateByQueryRethrottle.d.ts index 001677a08..b6021c188 100644 --- a/api/_core/updateByQueryRethrottle.d.ts +++ b/api/_core/updateByQueryRethrottle.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Core_UpdateByQueryRethrottle from '../_types/_core.update_by_query_rethrottle' +import * as Global from '../_types/_global' export interface UpdateByQueryRethrottle_Request extends Global.Params { requests_per_second?: number; diff --git a/api/_types/_common.aggregations.d.ts b/api/_types/_common.aggregations.d.ts index 663ddfd60..2242f3366 100644 --- a/api/_types/_common.aggregations.d.ts +++ b/api/_types/_common.aggregations.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Common_QueryDsl from './_common.query_dsl' import * as Common from './_common' +import * as Common_QueryDsl from './_common.query_dsl' import * as Core_Search from './_core.search' export type AdjacencyMatrixAggregate = MultiBucketAggregateBaseAdjacencyMatrixBucket & Record diff --git a/api/_types/_common.d.ts b/api/_types/_common.d.ts index 24a1a0367..f30168ed9 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -14,9 +14,9 @@ * modify the API generator. */ +import * as Cluster_AllocationExplain from './cluster.allocation_explain' import * as Common_QueryDsl from './_common.query_dsl' import * as Indices_Stats from './indices.stats' -import * as Cluster_AllocationExplain from './cluster.allocation_explain' export interface AcknowledgedResponseBase { acknowledged: boolean; @@ -25,25 +25,55 @@ export interface AcknowledgedResponseBase { export type ActionStatusOptions = 'failure' | 'simulated' | 'success' | 'throttled' export interface BaseNode { - attributes: Record; - host: Host; - ip: Ip; + attributes?: Record; + host?: Host; + ip?: Ip; name: Name; roles?: NodeRoles; - transport_address: TransportAddress; + transport_address?: TransportAddress; +} + +export type BulkByScrollFailure = BulkItemResponseFailure | ScrollableHitSourceSearchFailure + +export interface BulkByScrollResponseBase extends BulkByScrollTaskStatus { + failures: BulkByScrollFailure[]; + timed_out: boolean; + took: number; +} + +export interface BulkByScrollTaskStatus { + batches: number; + canceled?: string; + created?: number; + deleted: number; + noops: number; + requests_per_second: number; + retries: Retries; + slice_id?: number; + slices?: BulkByScrollTaskStatusOrException[]; + throttled?: Duration; + throttled_millis: DurationValueUnitMillis; + throttled_until?: Duration; + throttled_until_millis: DurationValueUnitMillis; + total: number; + updated?: number; + version_conflicts: number; } -export interface BulkIndexByScrollFailure { +export type BulkByScrollTaskStatusOrException = BulkByScrollTaskStatus | ErrorCause + +export interface BulkItemResponseFailure { cause: ErrorCause; - id: Id; + id?: Id; index: IndexName; status: number; - type: string; } export type byte = number -export type Bytes = number +export type ByteCount = number + +export type ByteUnit = 'b' | 'g' | 'gb' | 'k' | 'kb' | 'm' | 'mb' | 'p' | 'pb' | 't' | 'tb' export interface ClusterDetails { _shards?: ShardStatistics; @@ -68,8 +98,8 @@ export interface ClusterStatistics { export interface CompletionStats { fields?: Record; - size?: StorageSize; - size_in_bytes: Bytes; + size?: HumanReadableByteCount; + size_in_bytes: ByteCount; } export type Conflicts = 'abort' | 'proceed' @@ -118,15 +148,15 @@ export type Duration = string export type DurationLarge = string -export type DurationValueUnitMillis = UnitMillis & Record +export type DurationValueUnitMillis = UnitMillis -export type DurationValueUnitNanos = UnitNanos & Record +export type DurationValueUnitNanos = UnitNanos export type EmptyObject = Record -export type EpochTimeUnitMillis = UnitMillis & Record +export type EpochTimeUnitMillis = UnitMillis -export type EpochTimeUnitSeconds = UnitSeconds & Record +export type EpochTimeUnitSeconds = UnitSeconds export interface ErrorCause { caused_by?: ErrorCause; @@ -152,20 +182,20 @@ export type Field = string export interface FielddataStats { evictions?: number; fields?: Record; - memory_size?: StorageSize; - memory_size_in_bytes: Bytes; + memory_size?: HumanReadableByteCount; + memory_size_in_bytes: ByteCount; } export interface FieldMemoryUsage { - memory_size?: StorageSize; - memory_size_in_bytes: Bytes; + memory_size?: HumanReadableByteCount; + memory_size_in_bytes: ByteCount; } export type Fields = Field | Field[] export interface FieldSizeUsage { - size?: StorageSize; - size_in_bytes: Bytes; + size?: HumanReadableByteCount; + size_in_bytes: ByteCount; } export type FieldValue = boolean | undefined | number | Record | string @@ -242,6 +272,8 @@ export interface HourAndMinute { export type HttpHeaders = Record +export type HumanReadableByteCount = string + export type IBDistribution = 'll' | 'spl' export type IBLambda = 'df' | 'ttf' @@ -323,14 +355,14 @@ export type Level = 'cluster' | 'indices' | 'shards' export interface MergesStats { current: number; current_docs: number; - current_size?: StorageSize; - current_size_in_bytes: Bytes; + current_size?: HumanReadableByteCount; + current_size_in_bytes: ByteCount; total: number; - total_auto_throttle?: StorageSize; - total_auto_throttle_in_bytes: Bytes; + total_auto_throttle?: HumanReadableByteCount; + total_auto_throttle_in_bytes: ByteCount; total_docs: number; - total_size?: StorageSize; - total_size_in_bytes: Bytes; + total_size?: HumanReadableByteCount; + total_size_in_bytes: ByteCount; total_stopped_time?: Duration; total_stopped_time_in_millis: DurationValueUnitMillis; total_throttled_time?: Duration; @@ -342,8 +374,6 @@ export interface MergesStats { export type Metadata = Record -export type Metrics = string | string[] - export type MinimumShouldMatch = number | string export type MultiTermQueryRewrite = 'constant_score' | 'constant_score_boolean' | 'scoring_boolean' | 'top_terms_N' | 'top_terms_blended_freqs_N' | 'top_terms_boost_N' @@ -375,7 +405,7 @@ export type NodeIds = NodeId | NodeId[] export type NodeName = string -export type NodeRole = 'client' | 'cluster_manager' | 'coordinating_only' | 'data' | 'data_cold' | 'data_content' | 'data_frozen' | 'data_hot' | 'data_warm' | 'ingest' | 'master' | 'ml' | 'remote_cluster_client' | 'transform' | 'voting_only' +export type NodeRole = 'client' | 'coordinating_only' | 'data' | 'data_cold' | 'data_content' | 'data_frozen' | 'data_hot' | 'data_warm' | 'ingest' | 'ml' | 'remote_cluster_client' | 'transform' | 'voting_only' | 'master' | 'cluster_manager' export type NodeRoles = NodeRole[] @@ -418,7 +448,9 @@ export type OpType = 'create' | 'index' export type Password = string -export type Percentage = string | number +export type PercentageNumber = number + +export type PercentageString = string export interface PhaseTook { can_match: uint; @@ -451,8 +483,8 @@ export interface QueryCacheStats { cache_size: number; evictions: number; hit_count: number; - memory_size?: StorageSize; - memory_size_in_bytes: Bytes; + memory_size?: HumanReadableByteCount; + memory_size_in_bytes: ByteCount; miss_count: number; total_count: number; } @@ -511,12 +543,12 @@ export interface RemoteStoreTranslogUploadStats { } export interface RemoteStoreTranslogUploadTotalUploadSizeStats { - failed?: StorageSize; - failed_bytes: Bytes; - started?: StorageSize; - started_bytes: Bytes; - succeeded?: StorageSize; - succeeded_bytes: Bytes; + failed?: HumanReadableByteCount; + failed_bytes: ByteCount; + started?: HumanReadableByteCount; + started_bytes: ByteCount; + succeeded?: HumanReadableByteCount; + succeeded_bytes: ByteCount; } export interface RemoteStoreTranslogUploadTotalUploadsStats { @@ -526,12 +558,12 @@ export interface RemoteStoreTranslogUploadTotalUploadsStats { } export interface RemoteStoreUploadDownloadStats { - failed?: StorageSize; - failed_bytes: Bytes; - started?: StorageSize; - started_bytes: Bytes; - succeeded?: StorageSize; - succeeded_bytes: Bytes; + failed?: HumanReadableByteCount; + failed_bytes: ByteCount; + started?: HumanReadableByteCount; + started_bytes: ByteCount; + succeeded?: HumanReadableByteCount; + succeeded_bytes: ByteCount; } export interface RemoteStoreUploadPressureStats { @@ -539,10 +571,10 @@ export interface RemoteStoreUploadPressureStats { } export interface RemoteStoreUploadRefreshSizeLagStats { - max?: StorageSize; - max_bytes: Bytes; - total?: StorageSize; - total_bytes: Bytes; + max?: HumanReadableByteCount; + max_bytes: ByteCount; + total?: HumanReadableByteCount; + total_bytes: ByteCount; } export interface RemoteStoreUploadStats { @@ -558,8 +590,8 @@ export interface RemoteStoreUploadStats { export interface RequestCacheStats { evictions: number; hit_count: number; - memory_size?: StorageSize; - memory_size_in_bytes: Bytes; + memory_size?: HumanReadableByteCount; + memory_size_in_bytes: ByteCount; miss_count: number; } @@ -577,7 +609,7 @@ export interface Retries { search: number; } -export type Routing = string +export type Routing = string | string[] export interface RrfRank extends RankBase { rank_constant?: number; @@ -613,6 +645,14 @@ export interface ScriptSort { export type ScriptSortType = 'number' | 'string' | 'version' +export interface ScrollableHitSourceSearchFailure { + index?: IndexName; + node?: string; + reason: ErrorCause; + shard?: number; + status: number; +} + export type ScrollId = string export type ScrollIds = ScrollId | ScrollId[] @@ -652,38 +692,38 @@ export interface SearchStats { export type SearchType = 'dfs_query_then_fetch' | 'query_then_fetch' export interface SegmentReplicationStats { - max_bytes_behind: Bytes; - max_replication_lag: Bytes; - total_bytes_behind: Bytes; + max_bytes_behind: ByteCount; + max_replication_lag: ByteCount; + total_bytes_behind: ByteCount; } export interface SegmentsStats { count: number; - doc_values_memory?: StorageSize; - doc_values_memory_in_bytes: Bytes; + doc_values_memory?: HumanReadableByteCount; + doc_values_memory_in_bytes: ByteCount; file_sizes: Record; - fixed_bit_set?: StorageSize; - fixed_bit_set_memory_in_bytes: Bytes; - index_writer_max_memory_in_bytes?: Bytes; - index_writer_memory?: StorageSize; - index_writer_memory_in_bytes: Bytes; + fixed_bit_set?: HumanReadableByteCount; + fixed_bit_set_memory_in_bytes: ByteCount; + index_writer_max_memory_in_bytes?: ByteCount; + index_writer_memory?: HumanReadableByteCount; + index_writer_memory_in_bytes: ByteCount; max_unsafe_auto_id_timestamp: number; - memory?: StorageSize; - memory_in_bytes: Bytes; - norms_memory?: StorageSize; - norms_memory_in_bytes: Bytes; - points_memory?: StorageSize; - points_memory_in_bytes: Bytes; + memory?: HumanReadableByteCount; + memory_in_bytes: ByteCount; + norms_memory?: HumanReadableByteCount; + norms_memory_in_bytes: ByteCount; + points_memory?: HumanReadableByteCount; + points_memory_in_bytes: ByteCount; remote_store?: RemoteStoreStats; segment_replication?: SegmentReplicationStats; - stored_fields_memory?: StorageSize; - stored_fields_memory_in_bytes: Bytes; - term_vectors_memory?: StorageSize; - term_vectors_memory_in_bytes: Bytes; - terms_memory?: StorageSize; - terms_memory_in_bytes: Bytes; - version_map_memory?: StorageSize; - version_map_memory_in_bytes: Bytes; + stored_fields_memory?: HumanReadableByteCount; + stored_fields_memory_in_bytes: ByteCount; + term_vectors_memory?: HumanReadableByteCount; + term_vectors_memory_in_bytes: ByteCount; + terms_memory?: HumanReadableByteCount; + terms_memory_in_bytes: ByteCount; + version_map_memory?: HumanReadableByteCount; + version_map_memory_in_bytes: ByteCount; } export type SequenceNumber = number @@ -737,10 +777,6 @@ export type SortOrder = 'asc' | 'desc' export type SortResults = FieldValue[] -export type StorageSize = string - -export type StorageType = 'b' | 'g' | 'gb' | 'k' | 'kb' | 'm' | 'mb' | 'p' | 'pb' | 't' | 'tb' - export interface StoredScript { lang: ScriptLanguage; options?: Record; @@ -752,10 +788,10 @@ export interface StoredScriptId extends ScriptBase { } export interface StoreStats { - reserved?: StorageSize; - reserved_in_bytes: Bytes; - size?: StorageSize; - size_in_bytes: Bytes; + reserved?: HumanReadableByteCount; + reserved_in_bytes: ByteCount; + size?: HumanReadableByteCount; + size_in_bytes: ByteCount; } export type Stringifiedboolean = boolean | string @@ -799,11 +835,11 @@ export interface TranslogStats { earliest_last_modified_age: number; operations: number; remote_store?: RemoteStoreTranslogStats; - size?: StorageSize; - size_in_bytes: Bytes; + size?: HumanReadableByteCount; + size_in_bytes: ByteCount; uncommitted_operations: number; - uncommitted_size?: StorageSize; - uncommitted_size_in_bytes: Bytes; + uncommitted_size?: HumanReadableByteCount; + uncommitted_size_in_bytes: ByteCount; } export type TransportAddress = string diff --git a/api/_types/_common.mapping.d.ts b/api/_types/_common.mapping.d.ts index 44ca9d20f..bfbd7b7e4 100644 --- a/api/_types/_common.mapping.d.ts +++ b/api/_types/_common.mapping.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Indices_Common from './indices._common' import * as Common from './_common' +import * as Indices_Common from './indices._common' export interface AggregateMetricDoubleProperty extends PropertyBase { default_metric: string; diff --git a/api/_types/_common.query_dsl.d.ts b/api/_types/_common.query_dsl.d.ts index 42f718970..9d9e4d37e 100644 --- a/api/_types/_common.query_dsl.d.ts +++ b/api/_types/_common.query_dsl.d.ts @@ -15,8 +15,8 @@ */ import * as Common from './_common' -import * as Core_Search from './_core.search' import * as Common_Analysis from './_common.analysis' +import * as Core_Search from './_core.search' export interface BoolQuery extends QueryBase { filter?: QueryContainer | QueryContainer[]; @@ -306,7 +306,7 @@ export interface LikeDocument { version_type?: Common.VersionType; } -export type MatchAllQuery = QueryBase & Record +export type MatchAllQuery = QueryBase export interface MatchBoolPrefixQuery extends QueryBase { analyzer?: string; @@ -518,7 +518,7 @@ export interface QueryContainer { span_term?: Record; span_within?: SpanWithinQuery; term?: Record; - terms?: Record; + terms?: TermsQueryField; terms_set?: Record; text_expansion?: Record; type?: TypeQuery; @@ -624,7 +624,7 @@ export interface ScriptScoreQuery extends QueryBase { export type SimpleQueryStringFlag = 'ALL' | 'AND' | 'ESCAPE' | 'FUZZY' | 'NEAR' | 'NONE' | 'NOT' | 'OR' | 'PHRASE' | 'PRECEDENCE' | 'PREFIX' | 'SLOP' | 'WHITESPACE' -export type SimpleQueryStringFlags = Common.PipeSeparatedFlagsSimpleQueryStringFlag & Record +export type SimpleQueryStringFlags = Common.PipeSeparatedFlagsSimpleQueryStringFlag export interface SimpleQueryStringQuery extends QueryBase { analyze_wildcard?: boolean; @@ -708,13 +708,18 @@ export interface TermQuery extends QueryBase { value: Common.FieldValue; } -export type TermsQuery = QueryBase | { +export interface TermsLookupField { id?: Common.Id; index?: Common.IndexName; path?: Common.Field; routing?: Common.Routing; } +export interface TermsQueryField { + boost?: number; + [key: string]: any | TermsLookupField | string[]; +} + export interface TermsSetQuery extends 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 2545b249f..6d2caad42 100644 --- a/api/_types/_core.bulk.d.ts +++ b/api/_types/_core.bulk.d.ts @@ -17,11 +17,11 @@ import * as Common from './_common' import * as Core_Search from './_core.search' -export type CreateOperation = WriteOperation & Record +export type CreateOperation = WriteOperation -export type DeleteOperation = OperationBase & Record +export type DeleteOperation = OperationBase -export type IndexOperation = WriteOperation & Record +export type IndexOperation = WriteOperation export interface OperationBase { _id?: Common.Id; diff --git a/api/_types/_core.mget.d.ts b/api/_types/_core.mget.d.ts index 6ac0e6ed5..005cb2a80 100644 --- a/api/_types/_core.mget.d.ts +++ b/api/_types/_core.mget.d.ts @@ -15,8 +15,8 @@ */ import * as Common from './_common' -import * as Core_Search from './_core.search' import * as Core_Get from './_core.get' +import * as Core_Search from './_core.search' export interface MultiGetError { _id: Common.Id; diff --git a/api/_types/_core.msearch.d.ts b/api/_types/_core.msearch.d.ts index 2f755e223..5817c3d79 100644 --- a/api/_types/_core.msearch.d.ts +++ b/api/_types/_core.msearch.d.ts @@ -14,11 +14,11 @@ * modify the API generator. */ -import * as Core_Search from './_core.search' +import * as Common from './_common' import * as Common_Aggregations from './_common.aggregations' -import * as Common_QueryDsl from './_common.query_dsl' import * as Common_Mapping from './_common.mapping' -import * as Common from './_common' +import * as Common_QueryDsl from './_common.query_dsl' +import * as Core_Search from './_core.search' export interface MultisearchBody { _source?: Core_Search.SourceConfig; diff --git a/api/_types/_core.msearch_template.d.ts b/api/_types/_core.msearch_template.d.ts index 529dc3bd8..0405d9055 100644 --- a/api/_types/_core.msearch_template.d.ts +++ b/api/_types/_core.msearch_template.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Core_Msearch from './_core.msearch' import * as Common from './_common' +import * as Core_Msearch from './_core.msearch' export type RequestItem = Core_Msearch.MultisearchHeader | TemplateConfig diff --git a/api/_types/_core.reindex.d.ts b/api/_types/_core.reindex.d.ts index c7a285a6c..c5e60fa9a 100644 --- a/api/_types/_core.reindex.d.ts +++ b/api/_types/_core.reindex.d.ts @@ -15,8 +15,8 @@ */ import * as Common from './_common' -import * as Common_QueryDsl from './_common.query_dsl' import * as Common_Mapping from './_common.mapping' +import * as Common_QueryDsl from './_common.query_dsl' export interface Destination { index: Common.IndexName; diff --git a/api/_types/_core.search.d.ts b/api/_types/_core.search.d.ts index 3a676d973..19257340f 100644 --- a/api/_types/_core.search.d.ts +++ b/api/_types/_core.search.d.ts @@ -15,10 +15,10 @@ */ import * as Common from './_common' -import * as Common_QueryDsl from './_common.query_dsl' +import * as Common_Aggregations from './_common.aggregations' import * as Common_Analysis from './_common.analysis' +import * as Common_QueryDsl from './_common.query_dsl' import * as Core_Explain from './_core.explain' -import * as Common_Aggregations from './_common.aggregations' export interface AggregationBreakdown { build_aggregation: number; diff --git a/api/_types/asynchronous_search._common.d.ts b/api/_types/asynchronous_search._common.d.ts index d0c8ae255..fb97bb907 100644 --- a/api/_types/asynchronous_search._common.d.ts +++ b/api/_types/asynchronous_search._common.d.ts @@ -14,11 +14,11 @@ * modify the API generator. */ -import * as Core_Search from './_core.search' -import * as Common_Aggregations from './_common.aggregations' -import * as Common_QueryDsl from './_common.query_dsl' import * as Common from './_common' +import * as Common_Aggregations from './_common.aggregations' import * as Common_Mapping from './_common.mapping' +import * as Common_QueryDsl from './_common.query_dsl' +import * as Core_Search from './_core.search' export interface AsynchronousSearchStats { cancelled?: number; diff --git a/api/_types/cat._common.d.ts b/api/_types/cat._common.d.ts index 77be2a789..debe5fcf3 100644 --- a/api/_types/cat._common.d.ts +++ b/api/_types/cat._common.d.ts @@ -14,6 +14,7 @@ * modify the API generator. */ +import * as Common from './_common' export interface CatPitSegmentsRecord { committed?: string; @@ -36,14 +37,14 @@ export interface CatSegmentReplicationRecord { bytes?: string; bytes_behind?: string; bytes_fetched?: string; - bytes_percent?: string; + bytes_percent?: Common.PercentageString; bytes_total?: string; checkpoints_behind?: string; current_lag?: string; file_diff_stage_time_taken?: string; files?: string; files_fetched?: string; - files_percent?: string; + files_percent?: Common.PercentageString; files_total?: string; finalize_replication_stage_time_taken?: string; get_checkpoint_info_stage_time_taken?: string; diff --git a/api/_types/cat.allocation.d.ts b/api/_types/cat.allocation.d.ts index 8a8cbc0a3..0aaa51ea2 100644 --- a/api/_types/cat.allocation.d.ts +++ b/api/_types/cat.allocation.d.ts @@ -19,7 +19,7 @@ import * as Common from './_common' export interface AllocationRecord { 'disk.avail'?: undefined | string; 'disk.indices'?: undefined | string; - 'disk.percent'?: Common.Percentage | undefined; + 'disk.percent'?: Common.PercentageString | undefined; 'disk.total'?: undefined | string; 'disk.used'?: undefined | string; host?: Common.Host | undefined; diff --git a/api/_types/cat.health.d.ts b/api/_types/cat.health.d.ts index 5097f26dc..e48fb1a4c 100644 --- a/api/_types/cat.health.d.ts +++ b/api/_types/cat.health.d.ts @@ -17,7 +17,7 @@ import * as Common from './_common' export interface HealthRecord { - active_shards_percent?: string; + active_shards_percent?: Common.PercentageString; cluster?: string; discovered_cluster_manager?: string; discovered_master?: string; diff --git a/api/_types/cat.nodes.d.ts b/api/_types/cat.nodes.d.ts index 22b9c4e09..680ee6877 100644 --- a/api/_types/cat.nodes.d.ts +++ b/api/_types/cat.nodes.d.ts @@ -29,12 +29,12 @@ export interface NodesRecord { 'disk.avail'?: string; 'disk.total'?: string; 'disk.used'?: string; - 'disk.used_percent'?: Common.Percentage; + 'disk.used_percent'?: Common.PercentageString; 'fielddata.evictions'?: string; 'fielddata.memory_size'?: string; 'file_desc.current'?: string; 'file_desc.max'?: string; - 'file_desc.percent'?: Common.Percentage; + 'file_desc.percent'?: Common.PercentageString; flavor?: string; 'flush.total'?: string; 'flush.total_time'?: string; @@ -47,7 +47,7 @@ export interface NodesRecord { 'get.total'?: string; 'heap.current'?: string; 'heap.max'?: string; - 'heap.percent'?: Common.Percentage; + 'heap.percent'?: Common.PercentageString; http_address?: string; id?: Common.Id; 'indexing.delete_current'?: string; @@ -81,7 +81,7 @@ export interface NodesRecord { 'query_cache.miss_count'?: string; 'ram.current'?: string; 'ram.max'?: string; - 'ram.percent'?: Common.Percentage; + 'ram.percent'?: Common.PercentageString; 'refresh.external_time'?: string; 'refresh.external_total'?: string; 'refresh.listeners'?: string; diff --git a/api/_types/cat.recovery.d.ts b/api/_types/cat.recovery.d.ts index ad0ceffb6..4c69c80a5 100644 --- a/api/_types/cat.recovery.d.ts +++ b/api/_types/cat.recovery.d.ts @@ -18,11 +18,11 @@ import * as Common from './_common' export interface RecoveryRecord { bytes?: string; - bytes_percent?: Common.Percentage; + bytes_percent?: Common.PercentageString; bytes_recovered?: string; bytes_total?: string; files?: string; - files_percent?: Common.Percentage; + files_percent?: Common.PercentageString; files_recovered?: string; files_total?: string; index?: Common.IndexName; @@ -40,7 +40,7 @@ export interface RecoveryRecord { target_node?: string; time?: Common.Duration; translog_ops?: string; - translog_ops_percent?: Common.Percentage; + translog_ops_percent?: Common.PercentageString; translog_ops_recovered?: string; type?: string; } diff --git a/api/_types/cat.segments.d.ts b/api/_types/cat.segments.d.ts index c0319b293..12fd767b0 100644 --- a/api/_types/cat.segments.d.ts +++ b/api/_types/cat.segments.d.ts @@ -29,7 +29,7 @@ export interface SegmentsRecord { searchable?: string; segment?: string; shard?: string; - size?: Common.StorageSize; + size?: Common.HumanReadableByteCount; 'size.memory'?: string; version?: Common.VersionString; } diff --git a/api/_types/cluster._common.d.ts b/api/_types/cluster._common.d.ts index 60f256631..d641d2aab 100644 --- a/api/_types/cluster._common.d.ts +++ b/api/_types/cluster._common.d.ts @@ -15,8 +15,8 @@ */ import * as Common from './_common' -import * as Indices_Common from './indices._common' import * as Common_Mapping from './_common.mapping' +import * as Indices_Common from './indices._common' export interface ComponentTemplate { component_template: ComponentTemplateNode; diff --git a/api/_types/cluster.allocation_explain.d.ts b/api/_types/cluster.allocation_explain.d.ts index 71e8b3164..3c9a77bc8 100644 --- a/api/_types/cluster.allocation_explain.d.ts +++ b/api/_types/cluster.allocation_explain.d.ts @@ -28,7 +28,7 @@ export interface AllocationStore { allocation_id: string; found: boolean; in_sync: boolean; - matching_size_in_bytes: Common.Bytes; + matching_size_in_bytes: Common.ByteCount; matching_sync_id: boolean; store_exception: string; } @@ -38,7 +38,7 @@ export interface ClusterInfo { reserved_sizes: ReservedSize[]; shard_data_set_sizes?: Record; shard_paths: Record; - shard_sizes: Record; + shard_sizes: Record; } export interface CurrentNode { @@ -52,15 +52,15 @@ export interface CurrentNode { export type Decision = 'allocation_delayed' | 'awaiting_info' | 'no' | 'no_attempt' | 'no_valid_shard_copy' | 'throttled' | 'worse_balance' | 'yes' export interface DiskUsage { - free?: Common.StorageSize; - free_bytes: Common.Bytes; - free_disk_percent: number; + free?: Common.HumanReadableByteCount; + free_bytes: Common.ByteCount; + free_disk_percent: Common.PercentageNumber; path: string; - total?: Common.StorageSize; - total_bytes: Common.Bytes; - used?: Common.StorageSize; - used_bytes: Common.Bytes; - used_disk_percent: number; + total?: Common.HumanReadableByteCount; + total_bytes: Common.ByteCount; + used?: Common.HumanReadableByteCount; + used_bytes: Common.ByteCount; + used_disk_percent: Common.PercentageNumber; } export interface NodeAllocationExplanation { diff --git a/api/_types/cluster.health.d.ts b/api/_types/cluster.health.d.ts index 0e3f1def8..a2c6418b5 100644 --- a/api/_types/cluster.health.d.ts +++ b/api/_types/cluster.health.d.ts @@ -28,7 +28,8 @@ export interface AwarenessAttributeStats { export interface HealthResponseBody { active_primary_shards: number; active_shards: number; - active_shards_percent_as_number: Common.Percentage; + active_shards_percent?: Common.PercentageString; + active_shards_percent_as_number: Common.PercentageNumber; awareness_attributes?: Record; cluster_name: Common.Name; delayed_unassigned_shards: number; diff --git a/api/_types/cluster.reroute.d.ts b/api/_types/cluster.reroute.d.ts index a6bfc2939..d498c9a82 100644 --- a/api/_types/cluster.reroute.d.ts +++ b/api/_types/cluster.reroute.d.ts @@ -51,6 +51,8 @@ export interface CommandMoveAction { to_node: string; } +export type Metric = '_all' | 'blocks' | 'cluster_manager_node' | 'master_node' | 'metadata' | 'nodes' | 'routing_nodes' | 'routing_table' | 'version' + export interface RerouteDecision { decider: string; decision: string; diff --git a/api/_types/cluster.stats.d.ts b/api/_types/cluster.stats.d.ts index c1390513d..581324b84 100644 --- a/api/_types/cluster.stats.d.ts +++ b/api/_types/cluster.stats.d.ts @@ -29,14 +29,14 @@ export interface CharFilterTypes { } export interface ClusterFileSystem { - available?: Common.StorageSize; - available_in_bytes: Common.Bytes; - cache_reserved?: Common.StorageSize; - cache_reserved_in_bytes?: Common.Bytes; - free?: Common.StorageSize; - free_in_bytes: Common.Bytes; - total?: Common.StorageSize; - total_in_bytes: Common.Bytes; + available?: Common.HumanReadableByteCount; + available_in_bytes: Common.ByteCount; + cache_reserved?: Common.HumanReadableByteCount; + cache_reserved_in_bytes?: Common.ByteCount; + free?: Common.HumanReadableByteCount; + free_in_bytes: Common.ByteCount; + total?: Common.HumanReadableByteCount; + total_in_bytes: Common.ByteCount; } export interface ClusterIndices { @@ -80,10 +80,10 @@ export interface ClusterJvm { } export interface ClusterJvmMemory { - heap_max?: Common.StorageSize; - heap_max_in_bytes: Common.Bytes; - heap_used?: Common.StorageSize; - heap_used_in_bytes: Common.Bytes; + heap_max?: Common.HumanReadableByteCount; + heap_max_in_bytes: Common.ByteCount; + heap_used?: Common.HumanReadableByteCount; + heap_used_in_bytes: Common.ByteCount; } export interface ClusterJvmVersion { @@ -165,7 +165,7 @@ export interface ClusterProcess { } export interface ClusterProcessCpu { - percent: number; + percent: Common.PercentageNumber; } export interface ClusterProcessOpenFileDescriptors { @@ -202,8 +202,8 @@ export interface FieldTypesMappings { field_types: FieldTypes[]; runtime_field_types?: RuntimeFieldTypes[]; total_deduplicated_field_count?: number; - total_deduplicated_mapping_size?: Common.StorageSize; - total_deduplicated_mapping_size_in_bytes?: Common.Bytes; + total_deduplicated_mapping_size?: Common.HumanReadableByteCount; + total_deduplicated_mapping_size_in_bytes?: Common.ByteCount; total_field_count?: number; } @@ -213,25 +213,25 @@ export interface IndexingPressure { export interface IndexingPressureMemory { current: IndexingPressureMemorySummary; - limit_in_bytes: Common.Bytes; + limit_in_bytes: Common.ByteCount; total: IndexingPressureMemorySummary; } export interface IndexingPressureMemorySummary { - all_in_bytes: Common.Bytes; - combined_coordinating_and_primary_in_bytes: Common.Bytes; - coordinating_in_bytes: Common.Bytes; + all_in_bytes: Common.ByteCount; + combined_coordinating_and_primary_in_bytes: Common.ByteCount; + coordinating_in_bytes: Common.ByteCount; coordinating_rejections?: number; - primary_in_bytes: Common.Bytes; + primary_in_bytes: Common.ByteCount; primary_rejections?: number; - replica_in_bytes: Common.Bytes; + replica_in_bytes: Common.ByteCount; replica_rejections?: number; } export interface IndicesVersions { index_count: number; primary_shard_count: number; - total_primary_bytes: Common.Bytes; + total_primary_bytes: Common.ByteCount; version: Common.VersionString; } @@ -242,15 +242,15 @@ export interface NodePackagingType { } export interface OperatingSystemMemoryInfo { - adjusted_total_in_bytes?: Common.Bytes; - free?: Common.StorageSize; - free_in_bytes: Common.Bytes; - free_percent: number; - total?: Common.StorageSize; - total_in_bytes: Common.Bytes; - used?: Common.StorageSize; - used_in_bytes: Common.Bytes; - used_percent: number; + adjusted_total_in_bytes?: Common.ByteCount; + free?: Common.HumanReadableByteCount; + free_in_bytes: Common.ByteCount; + free_percent: Common.PercentageNumber; + total?: Common.HumanReadableByteCount; + total_in_bytes: Common.ByteCount; + used?: Common.HumanReadableByteCount; + used_in_bytes: Common.ByteCount; + used_percent: Common.PercentageNumber; } export interface RuntimeFieldTypes { diff --git a/api/_types/flow_framework.common.d.ts b/api/_types/flow_framework.common.d.ts index 688043d56..b579469aa 100644 --- a/api/_types/flow_framework.common.d.ts +++ b/api/_types/flow_framework.common.d.ts @@ -15,6 +15,10 @@ */ +export type All = boolean + +export type AllowDelete = string + export interface FlowFrameworkCreate { description?: string; name: string; @@ -48,6 +52,43 @@ export interface FlowFrameworkUpdate { name?: string; use_case?: string; version?: version; + workflows?: Record; +} + +export interface hits { + hits?: itemsObject[]; + max_score?: number; + total?: total; +} + +export interface itemsObject { + _id?: string; + _index?: string; + _primary_term?: number; + _score?: number; + _seq_no?: number; + _source?: FlowFrameworkGetResponse; + _version?: number; +} + +export type Provision = boolean + +export interface query { + match?: Record; + match_all?: Record; +} + +export type Reprovision = boolean + +export interface SearchStateResponse { + provisioning_progress?: string; + state?: string; + user?: user; + workflow_id?: string; +} + +export interface SearchWorkflowRequest { + query?: query; } export interface shards { @@ -56,6 +97,31 @@ export interface shards { total?: number; } +export interface StateHits { + hits?: StateItems[]; + max_score?: number; + total?: total; +} + +export interface StateItems { + _id?: string; + _index?: string; + _primary_term?: number; + _score?: number; + _seq_no?: number; + _source?: SearchStateResponse; + _version?: number; +} + +export interface total { + relation?: string; + value?: number; +} + +export type UpdateFields = boolean + +export type UseCase = string + export interface user { backend_roles?: string[]; custom_attribute_names?: string[]; @@ -64,8 +130,55 @@ export interface user { user_requested_tenant?: string; } +export type UserProvidedSubstitutionExpressions = Record + +export type Validation = string + export interface version { compatibility?: string[]; template?: string; } +export type WorkflowID = string + +export interface WorkflowSearchResponse { + _shards?: shards; + hits?: hits; + timed_out?: boolean; + took?: number; +} + +export interface WorkflowSearchStateResponse { + _shards?: shards; + hits?: StateHits; + timed_out?: boolean; + took?: number; +} + +export interface WorkFlowStatusDefaultResponse { + error?: string; + resources_created?: string[]; + state?: string; + workflow_id?: string; +} + +export interface WorkFlowStatusFullResponse { + error?: string; + provision_end_time?: string; + provision_start_time?: string; + provisioning_progress?: string; + resources_created?: string[]; + state?: 'COMPLETED' | 'FAILED' | 'NOT_STARTED' | 'PROVISIONING'; + user?: user; + user_outputs?: string[]; + workflow_id?: string; +} + +export interface WorkflowStep { + inputs?: string[]; + outputs?: string[]; + required_plugins?: string[]; +} + +export type WorkflowStepName = string + diff --git a/api/_types/flow_framework.errors.d.ts b/api/_types/flow_framework.errors.d.ts index 540e29dda..b8096f5f8 100644 --- a/api/_types/flow_framework.errors.d.ts +++ b/api/_types/flow_framework.errors.d.ts @@ -15,21 +15,66 @@ */ -export type BadRequestError = Record +export interface BadRequestError { + error?: string; + status?: number; +} export type ConflictError = Record +export interface DeprovisioningError { + error: string; +} + +export interface DeprovisioningForbiddenError { + error: string; +} + +export interface DuplicateKeyError { + error?: string; + status?: number; +} + export type FlowFrameworkAPIDisabledError = Record +export type InvalidParameterError = Record + +export interface InvalidRequestBodyFieldError { + error?: string; + status?: number; +} + +export type InvalidTemplateVersionError = Record + export type MaxWorkflowsLimitError = Record export type MissingParameterError = Record export type ParameterConflictError = Record +export interface RequestBodyParsingFailedError { + error?: string; + status?: number; +} + +export interface RequestTimeoutError { + error?: string; + status?: number; +} + +export interface TemplateNameRequiredError { + error?: string; +} + export type TemplateNotFoundError = Record +export type UnsupportedFieldUpdateError = Record + export type WorkFlowIdNullError = Record +export type WorkflowParsingError = Record + export type WorkflowSaveError = Record +export type WorkflowStepsRetrieveError = Record + diff --git a/api/_types/indices._common.d.ts b/api/_types/indices._common.d.ts index d9ed806da..23f5b3229 100644 --- a/api/_types/indices._common.d.ts +++ b/api/_types/indices._common.d.ts @@ -14,10 +14,10 @@ * modify the API generator. */ -import * as Common_QueryDsl from './_common.query_dsl' import * as Common from './_common' import * as Common_Analysis from './_common.analysis' import * as Common_Mapping from './_common.mapping' +import * as Common_QueryDsl from './_common.query_dsl' export interface Alias { filter?: Common_QueryDsl.QueryContainer; @@ -80,13 +80,13 @@ export interface DataStreamLifecycleRolloverConditions { max_age?: string; max_docs?: number; max_primary_shard_docs?: number; - max_primary_shard_size?: Common.StorageSize; - max_size?: Common.StorageSize; + max_primary_shard_size?: Common.HumanReadableByteCount; + max_size?: Common.HumanReadableByteCount; min_age?: Common.Duration; min_docs?: number; min_primary_shard_docs?: number; - min_primary_shard_size?: Common.StorageSize; - min_size?: Common.StorageSize; + min_primary_shard_size?: Common.HumanReadableByteCount; + min_size?: Common.HumanReadableByteCount; } export interface DataStreamLifecycleWithRollover { @@ -486,7 +486,7 @@ export interface TemplateMapping { export interface Translog { durability?: TranslogDurability; - flush_threshold_size?: Common.StorageSize; + flush_threshold_size?: Common.HumanReadableByteCount; retention?: TranslogRetention; sync_interval?: Common.Duration; } @@ -495,6 +495,6 @@ export type TranslogDurability = 'async' | 'request' export interface TranslogRetention { age?: Common.Duration; - size?: Common.StorageSize; + size?: Common.HumanReadableByteCount; } diff --git a/api/_types/indices.data_streams_stats.d.ts b/api/_types/indices.data_streams_stats.d.ts index 6131cc6d9..611def92d 100644 --- a/api/_types/indices.data_streams_stats.d.ts +++ b/api/_types/indices.data_streams_stats.d.ts @@ -20,7 +20,7 @@ export interface DataStreamsStatsItem { backing_indices: number; data_stream: Common.Name; maximum_timestamp: Common.EpochTimeUnitMillis; - store_size?: Common.StorageSize; - store_size_bytes: Common.Bytes; + store_size?: Common.HumanReadableByteCount; + store_size_bytes: Common.ByteCount; } diff --git a/api/_types/indices.get_index_template.d.ts b/api/_types/indices.get_index_template.d.ts index fd5e64240..350724666 100644 --- a/api/_types/indices.get_index_template.d.ts +++ b/api/_types/indices.get_index_template.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Indices_Common from './indices._common' import * as Common from './_common' +import * as Indices_Common from './indices._common' export interface IndexTemplateItem { index_template: Indices_Common.IndexTemplate; diff --git a/api/_types/indices.put_index_template.d.ts b/api/_types/indices.put_index_template.d.ts index 735d47554..0c3b02871 100644 --- a/api/_types/indices.put_index_template.d.ts +++ b/api/_types/indices.put_index_template.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Indices_Common from './indices._common' import * as Common_Mapping from './_common.mapping' +import * as Indices_Common from './indices._common' export interface IndexTemplateMapping { aliases?: Record; diff --git a/api/_types/indices.recovery.d.ts b/api/_types/indices.recovery.d.ts index 3b7286c9c..a38ba5c06 100644 --- a/api/_types/indices.recovery.d.ts +++ b/api/_types/indices.recovery.d.ts @@ -23,20 +23,20 @@ export interface FileDetails { } export interface RecoveryBytes { - percent: Common.Percentage; - recovered?: Common.StorageSize; - recovered_from_snapshot?: Common.StorageSize; - recovered_from_snapshot_in_bytes?: Common.Bytes; - recovered_in_bytes: Common.Bytes; - reused?: Common.StorageSize; - reused_in_bytes: Common.Bytes; - total?: Common.StorageSize; - total_in_bytes: Common.Bytes; + percent: Common.PercentageString; + recovered?: Common.HumanReadableByteCount; + recovered_from_snapshot?: Common.HumanReadableByteCount; + recovered_from_snapshot_in_bytes?: Common.ByteCount; + recovered_in_bytes: Common.ByteCount; + reused?: Common.HumanReadableByteCount; + reused_in_bytes: Common.ByteCount; + total?: Common.HumanReadableByteCount; + total_in_bytes: Common.ByteCount; } export interface RecoveryFiles { details?: FileDetails[]; - percent: Common.Percentage; + percent: Common.PercentageString; recovered: number; reused: number; total: number; @@ -100,7 +100,7 @@ export interface ShardRecovery { } export interface TranslogStatus { - percent: Common.Percentage; + percent: Common.PercentageString; recovered: number; total: number; total_on_start: number; diff --git a/api/_types/indices.rollover.d.ts b/api/_types/indices.rollover.d.ts index d7ebbe475..e0d941a73 100644 --- a/api/_types/indices.rollover.d.ts +++ b/api/_types/indices.rollover.d.ts @@ -21,16 +21,16 @@ export interface RolloverConditions { max_age_millis?: Common.DurationValueUnitMillis; max_docs?: number; max_primary_shard_docs?: number; - max_primary_shard_size?: Common.StorageSize; - max_primary_shard_size_bytes?: Common.Bytes; - max_size?: Common.StorageSize; - max_size_bytes?: Common.Bytes; + max_primary_shard_size?: Common.HumanReadableByteCount; + max_primary_shard_size_bytes?: Common.ByteCount; + max_size?: Common.HumanReadableByteCount; + max_size_bytes?: Common.ByteCount; min_age?: Common.Duration; min_docs?: number; min_primary_shard_docs?: number; - min_primary_shard_size?: Common.StorageSize; - min_primary_shard_size_bytes?: Common.Bytes; - min_size?: Common.StorageSize; - min_size_bytes?: Common.Bytes; + min_primary_shard_size?: Common.HumanReadableByteCount; + min_primary_shard_size_bytes?: Common.ByteCount; + min_size?: Common.HumanReadableByteCount; + min_size_bytes?: Common.ByteCount; } diff --git a/api/_types/indices.segments.d.ts b/api/_types/indices.segments.d.ts index 0a37e1865..d48c4f9da 100644 --- a/api/_types/indices.segments.d.ts +++ b/api/_types/indices.segments.d.ts @@ -26,12 +26,12 @@ export interface Segment { compound: boolean; deleted_docs: number; generation: number; - memory?: Common.StorageSize; - memory_in_bytes?: Common.Bytes; + memory?: Common.HumanReadableByteCount; + memory_in_bytes?: Common.ByteCount; num_docs: number; search: boolean; - size?: Common.StorageSize; - size_in_bytes: Common.Bytes; + size?: Common.HumanReadableByteCount; + size_in_bytes: Common.ByteCount; version: Common.VersionString; } diff --git a/api/_types/indices.shard_stores.d.ts b/api/_types/indices.shard_stores.d.ts index 89dcb6527..c60f157b6 100644 --- a/api/_types/indices.shard_stores.d.ts +++ b/api/_types/indices.shard_stores.d.ts @@ -33,9 +33,9 @@ export interface ShardStoreException { type: string; } -export type ShardStoreStatus = 'all' | 'green' | 'red' | 'yellow' - export interface ShardStoreWrapper { stores: ShardStore[]; } +export type Status = 'all' | 'green' | 'red' | 'yellow' + diff --git a/api/_types/indices.simulate_template.d.ts b/api/_types/indices.simulate_template.d.ts index 544d9e747..1b4c2e7ab 100644 --- a/api/_types/indices.simulate_template.d.ts +++ b/api/_types/indices.simulate_template.d.ts @@ -15,8 +15,8 @@ */ import * as Common from './_common' -import * as Indices_Common from './indices._common' import * as Common_Mapping from './_common.mapping' +import * as Indices_Common from './indices._common' export interface Overlapping { index_patterns: string[]; diff --git a/api/_types/indices.stats.d.ts b/api/_types/indices.stats.d.ts index 7f4ad4f2c..25083808c 100644 --- a/api/_types/indices.stats.d.ts +++ b/api/_types/indices.stats.d.ts @@ -57,6 +57,8 @@ export interface IndicesStats { uuid: Common.Uuid; } +export type Metric = '_all' | 'completion' | 'docs' | 'fielddata' | 'flush' | 'get' | 'indexing' | 'merge' | 'query_cache' | 'recovery' | 'refresh' | 'request_cache' | 'search' | 'segments' | 'store' | 'suggest' | 'translog' | 'warmer' + export interface ShardCommit { generation: number; id: Common.Id; @@ -65,13 +67,13 @@ export interface ShardCommit { } export interface ShardFileSizeInfo { - average_size_in_bytes?: Common.Bytes; + average_size_in_bytes?: Common.ByteCount; count?: number; description: string; - max_size_in_bytes?: Common.Bytes; - min_size_in_bytes?: Common.Bytes; - size?: Common.StorageSize; - size_in_bytes: Common.Bytes; + max_size_in_bytes?: Common.ByteCount; + min_size_in_bytes?: Common.ByteCount; + size?: Common.HumanReadableByteCount; + size_in_bytes: Common.ByteCount; } export interface ShardLease { diff --git a/api/_types/ism._common.d.ts b/api/_types/ism._common.d.ts new file mode 100644 index 000000000..2f6914d40 --- /dev/null +++ b/api/_types/ism._common.d.ts @@ -0,0 +1,259 @@ +/* + * 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 interface Action { + alias?: ActionAlias; + allocation?: ActionAllocation; + close?: ActionClose; + custom?: ActionCustom; + delete?: ActionDelete; + force_merge?: ActionForceMerge; + index_priority?: ActionIndexPriority; + notification?: ActionNotification; + open?: ActionOpen; + read_only?: ActionReadOnly; + read_write?: ActionReadWrite; + replica_count?: ActionReplicaCount; + retry?: ActionRetry; + rollover?: ActionRollover; + rollup?: ActionRollup; + shrink?: ActionShrink; + snapshot?: ActionSnapshot; + timeout?: ActionTimeout; + transform?: ActionTransform; +} + +export interface ActionAlias { + actions?: Record; +} + +export interface ActionAllocation { + exclude?: Record; + include?: Record; + require?: Record; + wait_for?: boolean; +} + +export type ActionClose = Record + +export type ActionCustom = Record + +export type ActionDelete = Record + +export interface ActionForceMerge { + max_num_segments?: number; +} + +export interface ActionIndexPriority { + priority?: number; +} + +export type ActionNotification = Record + +export type ActionOpen = Record + +export type ActionReadOnly = Record + +export type ActionReadWrite = Record + +export interface ActionReplicaCount { + number_of_replicas?: number; +} + +export interface ActionRetry { + backoff?: string; + count?: number; + delay?: string; +} + +export interface ActionRollover { + copy_alias?: boolean; + min_doc_count?: number; + min_index_age?: number; + min_primary_shard_size?: number; + min_size?: number; +} + +export type ActionRollup = Record + +export type ActionShrink = Record + +export interface ActionSnapshot { + include_global_state?: boolean; + repository?: string; + snapshot?: string; +} + +export interface ActionTimeout { + timeout?: Record; +} + +export type ActionTransform = Record + +export interface AddPolicyRequest { + policy_id: string; +} + +export type AddPolicyResponse = ChangePolicyResponse + +export interface ChangePolicyRequest { + include?: IncludeState[]; + policy_id: string; + state?: string; +} + +export type ChangePolicyResponse = ChangeResponse + +export interface ChangeResponse { + failed_indices?: FailedIndex[]; + failures?: boolean; + updated_indices?: number; +} + +export interface Channel { + id?: string; +} + +export type DeletePolicyResponse = Common.WriteResponseBase + +export interface ErrorNotification { + channel?: Channel; + destination?: ErrorNotificationDestination; + message_template?: Record; +} + +export interface ErrorNotificationChime { + url?: string; +} + +export interface ErrorNotificationDestination { + last_update_time?: number; + name?: string; + [key: string]: any | ErrorNotificationChime | ErrorNotificationSlack; +} + +export interface ErrorNotificationSlack { + custom_webhook?: SlackCustomWebhook; + url?: string; +} + +export interface ExplainIndexResponse { + total_managed_indices?: number; + [key: string]: any | ExplainPolicy; +} + +export interface ExplainPolicy { + enabled?: boolean | undefined; + 'index.opendistro.index_state_management.policy_id'?: undefined | string; + 'index.plugins.index_state_management.policy_id'?: undefined | string; +} + +export interface FailedIndex { + index_name?: string; + index_uuid?: string; + reason?: string; +} + +export interface GetPoliciesResponse { + policies?: PolicyWithMetadata[]; + total_policies?: number; +} + +export type GetPolicyResponse = PolicyWithMetadata + +export interface IncludeState { + state?: string; +} + +export interface IsmTemplate { + index_patterns?: string[]; + last_updated_time?: number; + priority?: number; +} + +export interface Metadata { + _id?: Common.Id; + _primary_term?: number; + _seq_no?: Common.SequenceNumber; + _version?: Common.VersionNumber; +} + +export interface Policy { + default_state?: string; + description?: string; + error_notification?: ErrorNotification | undefined; + ism_template?: IsmTemplate | undefined | IsmTemplate[]; + last_updated_time?: number; + policy_id?: string; + schema_version?: number; + states?: States[]; +} + +export interface PolicyEnvelope { + policy?: Policy; +} + +export type PolicyWithMetadata = Metadata & PolicyEnvelope + +export type PutPolicyRequest = PolicyEnvelope + +export interface PutPolicyResponse extends Metadata { + policy?: PolicyEnvelope; +} + +export interface RefreshSearchAnalyzersResponse { + _shards?: Common.ShardStatistics; + successful_refresh_details?: RefreshSearchAnalyzersResponseDetails[]; +} + +export interface RefreshSearchAnalyzersResponseDetails { + index?: string; + refreshed_analyzers?: string[]; +} + +export type RemovePolicyResponse = ChangePolicyResponse + +export interface RetryIndexRequest { + state: string; +} + +export type RetryIndexResponse = ChangeResponse + +export interface SlackCustomWebhook { + header_params?: Record; + host?: string; + password?: string; + path?: string; + port?: number; + query_params?: Record; + scheme?: string; + url?: string; + username?: string; +} + +export interface States { + actions?: Action[]; + name?: string; + transitions?: Transition[]; +} + +export interface Transition { + conditions?: Record; + state_name?: string; +} + diff --git a/api/_types/ml._common.d.ts b/api/_types/ml._common.d.ts index 63c40a2dc..28ff1e336 100644 --- a/api/_types/ml._common.d.ts +++ b/api/_types/ml._common.d.ts @@ -16,11 +16,63 @@ import * as Common from './_common' +export interface Action { + action_type?: string; + headers?: Headers; + method?: string; + post_process_function?: string; + pre_process_function?: string; + request_body?: string; + url?: string; +} + +export interface ClientConfig { + connection_timeout?: number; + max_connection?: number; + max_retry_times?: number; + read_timeout?: number; + retry_backoff_millis?: number; + retry_backoff_policy?: string; + retry_timeout_seconds?: number; +} + +export interface CreateConnectorRequest { + actions: Action[]; + client_config?: ClientConfig; + credential: Credential; + description: string; + name: string; + parameters: Parameters; + protocol: string; + version: number; +} + +export interface Credential { + access_key?: string; + secret_key?: string; + session_token?: string; + [key: string]: any; +} + +export interface Headers { + content_type?: string; + [key: string]: any; +} + export interface HitsTotal { relation: string; value: number; } +export interface LLM { + model_id?: string; + parameters?: Parameters; +} + +export interface Memory { + type?: string; +} + export interface ModelGroup { access: string; created_time?: number; @@ -35,6 +87,19 @@ export interface ModelGroupRegistration { status: string; } +export type Parameters = Record + +export interface RegisterAgentsRequest { + app_type?: string; + description?: string; + llm?: LLM; + memory?: Memory; + name: string; + parameters?: Parameters; + tools?: ToolItems[]; + type: string; +} + export interface SearchModelsHits { hits: SearchModelsHitsHit[]; total: HitsTotal; @@ -68,6 +133,13 @@ export interface Task { worker_node?: Common.NodeIds[]; } +export interface ToolItems { + name?: string; + parameters?: Parameters; + type?: string; + [key: string]: any; +} + export interface UndeployModelNode { stats?: UndeployModelNodeStats; } diff --git a/api/_types/nodes._common.d.ts b/api/_types/nodes._common.d.ts index d9be31eb2..6c9fd7dac 100644 --- a/api/_types/nodes._common.d.ts +++ b/api/_types/nodes._common.d.ts @@ -28,10 +28,10 @@ export interface AdaptiveSelection { } export interface Breaker { - estimated_size?: Common.StorageSize; - estimated_size_in_bytes?: Common.Bytes; - limit_size?: Common.StorageSize; - limit_size_in_bytes?: Common.Bytes; + estimated_size?: Common.HumanReadableByteCount; + estimated_size_in_bytes?: Common.ByteCount; + limit_size?: Common.HumanReadableByteCount; + limit_size_in_bytes?: Common.ByteCount; overhead?: number; tripped?: number; } @@ -71,7 +71,7 @@ export interface Client { opened_time_millis?: number; remote_address?: string; request_count?: number; - request_size_bytes?: Common.Bytes; + request_size_bytes?: Common.ByteCount; x_opaque_id?: string; } @@ -122,7 +122,7 @@ export interface Context { export interface Cpu { load_average?: Record; - percent?: number; + percent?: Common.PercentageNumber; sys?: Common.Duration; sys_in_millis?: Common.DurationValueUnitMillis; total?: Common.Duration; @@ -137,23 +137,23 @@ export interface CpuAcct { } export interface DataPathStats { - available?: Common.StorageSize; - available_in_bytes?: Common.Bytes; - cache_reserved?: Common.StorageSize; - cache_reserved_in_bytes?: Common.Bytes; + available?: Common.HumanReadableByteCount; + available_in_bytes?: Common.ByteCount; + cache_reserved?: Common.HumanReadableByteCount; + cache_reserved_in_bytes?: Common.ByteCount; disk_queue?: string; - disk_read_size?: Common.StorageSize; - disk_read_size_in_bytes?: Common.Bytes; + disk_read_size?: Common.HumanReadableByteCount; + disk_read_size_in_bytes?: Common.ByteCount; disk_reads?: number; - disk_write_size?: Common.StorageSize; - disk_write_size_in_bytes?: Common.Bytes; + disk_write_size?: Common.HumanReadableByteCount; + disk_write_size_in_bytes?: Common.ByteCount; disk_writes?: number; - free?: Common.StorageSize; - free_in_bytes?: Common.Bytes; + free?: Common.HumanReadableByteCount; + free_in_bytes?: Common.ByteCount; mount?: string; path?: string; - total?: Common.StorageSize; - total_in_bytes?: Common.Bytes; + total?: Common.HumanReadableByteCount; + total_in_bytes?: Common.ByteCount; type?: string; } @@ -167,8 +167,8 @@ export interface Discovery { } export interface ExtendedMemoryStats extends MemoryStats { - free_percent?: number; - used_percent?: number; + free_percent?: Common.PercentageNumber; + used_percent?: Common.PercentageNumber; } export interface FileSystem { @@ -179,14 +179,14 @@ export interface FileSystem { } export interface FileSystemTotal { - available?: Common.StorageSize; - available_in_bytes?: Common.Bytes; - cache_reserved?: Common.StorageSize; - cache_reserved_in_bytes?: Common.Bytes; - free?: Common.StorageSize; - free_in_bytes?: Common.Bytes; - total?: Common.StorageSize; - total_in_bytes?: Common.Bytes; + available?: Common.HumanReadableByteCount; + available_in_bytes?: Common.ByteCount; + cache_reserved?: Common.HumanReadableByteCount; + cache_reserved_in_bytes?: Common.ByteCount; + free?: Common.HumanReadableByteCount; + free_in_bytes?: Common.ByteCount; + total?: Common.HumanReadableByteCount; + total_in_bytes?: Common.ByteCount; } export interface GarbageCollector { @@ -211,8 +211,8 @@ export interface IndexingPressure { export interface IndexingPressureMemory { current?: PressureMemory; - limit?: Common.StorageSize; - limit_in_bytes?: Common.Bytes; + limit?: Common.HumanReadableByteCount; + limit_in_bytes?: Common.ByteCount; total?: PressureMemory; } @@ -266,17 +266,17 @@ export interface JvmClasses { } export interface JvmMemoryStats { - heap_committed?: Common.StorageSize; - heap_committed_in_bytes?: Common.Bytes; - heap_max?: Common.StorageSize; - heap_max_in_bytes?: Common.Bytes; - heap_used?: Common.StorageSize; - heap_used_in_bytes?: Common.Bytes; - heap_used_percent?: number; - non_heap_committed?: Common.StorageSize; - non_heap_committed_in_bytes?: Common.Bytes; - non_heap_used?: Common.StorageSize; - non_heap_used_in_bytes?: Common.Bytes; + heap_committed?: Common.HumanReadableByteCount; + heap_committed_in_bytes?: Common.ByteCount; + heap_max?: Common.HumanReadableByteCount; + heap_max_in_bytes?: Common.ByteCount; + heap_used?: Common.HumanReadableByteCount; + heap_used_in_bytes?: Common.ByteCount; + heap_used_percent?: Common.PercentageNumber; + non_heap_committed?: Common.HumanReadableByteCount; + non_heap_committed_in_bytes?: Common.ByteCount; + non_heap_used?: Common.HumanReadableByteCount; + non_heap_used_in_bytes?: Common.ByteCount; pools?: Record; } @@ -291,35 +291,35 @@ export interface KeyedProcessor { } export interface LastGcStats { - max?: Common.StorageSize; - max_in_bytes?: Common.Bytes; - usage_percent?: number; - used?: Common.StorageSize; - used_in_bytes?: Common.Bytes; + max?: Common.HumanReadableByteCount; + max_in_bytes?: Common.ByteCount; + usage_percent?: Common.PercentageNumber; + used?: Common.HumanReadableByteCount; + used_in_bytes?: Common.ByteCount; } export interface MemoryStats { - adjusted_total_in_bytes?: Common.Bytes; - free?: Common.StorageSize; - free_in_bytes?: Common.Bytes; - resident?: Common.StorageSize; - resident_in_bytes?: Common.Bytes; - share?: Common.StorageSize; - share_in_bytes?: Common.Bytes; - total?: Common.StorageSize; - total_in_bytes?: Common.Bytes; - total_virtual?: Common.StorageSize; - total_virtual_in_bytes?: Common.Bytes; - used?: Common.StorageSize; - used_in_bytes?: Common.Bytes; + adjusted_total_in_bytes?: Common.ByteCount; + free?: Common.HumanReadableByteCount; + free_in_bytes?: Common.ByteCount; + resident?: Common.HumanReadableByteCount; + resident_in_bytes?: Common.ByteCount; + share?: Common.HumanReadableByteCount; + share_in_bytes?: Common.ByteCount; + total?: Common.HumanReadableByteCount; + total_in_bytes?: Common.ByteCount; + total_virtual?: Common.HumanReadableByteCount; + total_virtual_in_bytes?: Common.ByteCount; + used?: Common.HumanReadableByteCount; + used_in_bytes?: Common.ByteCount; } export interface NodeBufferPool { count?: number; - total_capacity?: Common.StorageSize; - total_capacity_in_bytes?: Common.Bytes; - used?: Common.StorageSize; - used_in_bytes?: Common.Bytes; + total_capacity?: Common.HumanReadableByteCount; + total_capacity_in_bytes?: Common.ByteCount; + used?: Common.HumanReadableByteCount; + used_in_bytes?: Common.ByteCount; } export interface NodeReloadError { @@ -343,29 +343,29 @@ export interface OperatingSystem { export interface Pool { last_gc_stats?: LastGcStats; - max?: Common.StorageSize; - max_in_bytes?: Common.Bytes; - peak_max?: Common.StorageSize; - peak_max_in_bytes?: Common.Bytes; - peak_used?: Common.StorageSize; - peak_used_in_bytes?: Common.Bytes; - used?: Common.StorageSize; - used_in_bytes?: Common.Bytes; + max?: Common.HumanReadableByteCount; + max_in_bytes?: Common.ByteCount; + peak_max?: Common.HumanReadableByteCount; + peak_max_in_bytes?: Common.ByteCount; + peak_used?: Common.HumanReadableByteCount; + peak_used_in_bytes?: Common.ByteCount; + used?: Common.HumanReadableByteCount; + used_in_bytes?: Common.ByteCount; } export interface PressureMemory { - all?: Common.StorageSize; - all_in_bytes?: Common.Bytes; - combined_coordinating_and_primary?: Common.StorageSize; - combined_coordinating_and_primary_in_bytes?: Common.Bytes; - coordinating?: Common.StorageSize; - coordinating_in_bytes?: Common.Bytes; + all?: Common.HumanReadableByteCount; + all_in_bytes?: Common.ByteCount; + combined_coordinating_and_primary?: Common.HumanReadableByteCount; + combined_coordinating_and_primary_in_bytes?: Common.ByteCount; + coordinating?: Common.HumanReadableByteCount; + coordinating_in_bytes?: Common.ByteCount; coordinating_rejections?: number; - primary?: Common.StorageSize; - primary_in_bytes?: Common.Bytes; + primary?: Common.HumanReadableByteCount; + primary_in_bytes?: Common.ByteCount; primary_rejections?: number; - replica?: Common.StorageSize; - replica_in_bytes?: Common.Bytes; + replica?: Common.HumanReadableByteCount; + replica_in_bytes?: Common.ByteCount; replica_rejections?: number; } @@ -381,6 +381,7 @@ export interface Processor { count?: number; current?: number; failed?: number; + time?: Common.Duration; time_in_millis?: Common.DurationValueUnitMillis; } @@ -420,11 +421,11 @@ export interface SerializedClusterState { } export interface SerializedClusterStateDetail { - compressed_size?: Common.StorageSize; - compressed_size_in_bytes?: Common.Bytes; + compressed_size?: Common.HumanReadableByteCount; + compressed_size_in_bytes?: Common.ByteCount; count?: number; - uncompressed_size?: Common.StorageSize; - uncompressed_size_in_bytes?: Common.Bytes; + uncompressed_size?: Common.HumanReadableByteCount; + uncompressed_size_in_bytes?: Common.ByteCount; } export interface ShardAdmissionControlStats { @@ -439,8 +440,8 @@ export interface ShardCacheStats { hit_count?: number; item_count?: number; miss_count?: number; - size?: Common.StorageSize; - size_in_bytes?: Common.Bytes; + size?: Common.HumanReadableByteCount; + size_in_bytes?: Common.ByteCount; store_name?: string; } @@ -466,14 +467,14 @@ export type ShardRepositoriesStats = any[] export type ShardResourceUsageStats = Record export interface ShardResourceUsageStatsDetail { - cpu_utilization_percent?: Common.Percentage; + cpu_utilization_percent?: Common.PercentageString; io_usage_stats?: ShardResourceUsageStatsIoUsageStats; - memory_utilization_percent?: Common.Percentage; + memory_utilization_percent?: Common.PercentageString; timestamp?: number; } export interface ShardResourceUsageStatsIoUsageStats { - max_io_utilization_percent?: Common.Percentage; + max_io_utilization_percent?: Common.PercentageString; } export type ShardSearchBackpressureMode = 'disabled' | 'enforced' | 'monitor_only' @@ -487,7 +488,7 @@ export interface ShardSearchBackpressureStats { export interface ShardSearchBackpressureTaskCancellationStats { cancellation_count?: number; cancellation_limit_reached_count?: number; - cancelled_task_percentage?: number; + cancelled_task_percentage?: Common.PercentageNumber; current_cancellation_eligible_tasks_count?: number; } @@ -509,12 +510,12 @@ export interface ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerSta export interface ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats { cancellation_count?: number; - current_avg?: Common.StorageSize; - current_avg_bytes?: Common.Bytes; - current_max?: Common.StorageSize; - current_max_bytes?: Common.Bytes; - rolling_avg?: Common.StorageSize; - rolling_avg_bytes?: Common.Bytes; + current_avg?: Common.HumanReadableByteCount; + current_avg_bytes?: Common.ByteCount; + current_max?: Common.HumanReadableByteCount; + current_max_bytes?: Common.ByteCount; + rolling_avg?: Common.HumanReadableByteCount; + rolling_avg_bytes?: Common.ByteCount; } export interface ShardSearchBackpressureTaskResourceTrackerStats { @@ -621,13 +622,13 @@ export interface Transport { inbound_handling_time_histogram?: TransportHistogram[]; outbound_handling_time_histogram?: TransportHistogram[]; rx_count?: number; - rx_size?: Common.StorageSize; - rx_size_in_bytes?: Common.Bytes; + rx_size?: Common.HumanReadableByteCount; + rx_size_in_bytes?: Common.ByteCount; server_open?: number; total_outbound_connections?: number; tx_count?: number; - tx_size?: Common.StorageSize; - tx_size_in_bytes?: Common.Bytes; + tx_size?: Common.HumanReadableByteCount; + tx_size_in_bytes?: Common.ByteCount; } export interface TransportHistogram { diff --git a/api/_types/nodes.info.d.ts b/api/_types/nodes.info.d.ts index 2670776b0..a911dab20 100644 --- a/api/_types/nodes.info.d.ts +++ b/api/_types/nodes.info.d.ts @@ -46,7 +46,7 @@ export interface NodeInfo { settings?: NodeInfoSettings; thread_pool?: Record; total_indexing_buffer?: number; - total_indexing_buffer_in_bytes?: Common.Bytes; + total_indexing_buffer_in_bytes?: Common.ByteCount; transport?: NodeInfoTransport; transport_address?: Common.TransportAddress; version: Common.VersionString; @@ -75,8 +75,8 @@ export interface NodeInfoDiscovery { export interface NodeInfoHttp { bound_address: string[]; - max_content_length?: Common.StorageSize; - max_content_length_in_bytes: Common.Bytes; + max_content_length?: Common.HumanReadableByteCount; + max_content_length_in_bytes: Common.ByteCount; publish_address: string; } @@ -97,21 +97,21 @@ export interface NodeInfoIngestProcessor { } export interface NodeInfoJvmMemory { - direct_max?: Common.StorageSize; - direct_max_in_bytes: Common.Bytes; - heap_init?: Common.StorageSize; - heap_init_in_bytes: Common.Bytes; - heap_max?: Common.StorageSize; - heap_max_in_bytes: Common.Bytes; - non_heap_init?: Common.StorageSize; - non_heap_init_in_bytes: Common.Bytes; - non_heap_max?: Common.StorageSize; - non_heap_max_in_bytes: Common.Bytes; + direct_max?: Common.HumanReadableByteCount; + direct_max_in_bytes: Common.ByteCount; + heap_init?: Common.HumanReadableByteCount; + heap_init_in_bytes: Common.ByteCount; + heap_max?: Common.HumanReadableByteCount; + heap_max_in_bytes: Common.ByteCount; + non_heap_init?: Common.HumanReadableByteCount; + non_heap_init_in_bytes: Common.ByteCount; + non_heap_max?: Common.HumanReadableByteCount; + non_heap_max_in_bytes: Common.ByteCount; } export interface NodeInfoMemory { - total: Common.StorageSize; - total_in_bytes: Common.Bytes; + total: Common.HumanReadableByteCount; + total_in_bytes: Common.ByteCount; } export interface NodeInfoNetwork { @@ -126,8 +126,8 @@ export interface NodeInfoNetworkInterface { } export interface NodeInfoOSCPU { - cache_size: Common.StorageSize; - cache_size_in_bytes: Common.Bytes; + cache_size: Common.HumanReadableByteCount; + cache_size_in_bytes: Common.ByteCount; cores_per_socket: number; mhz: number; model: string; diff --git a/api/_types/nodes.reload_secure_settings.d.ts b/api/_types/nodes.reload_secure_settings.d.ts index e61bd180e..94ae273a1 100644 --- a/api/_types/nodes.reload_secure_settings.d.ts +++ b/api/_types/nodes.reload_secure_settings.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Nodes_Common from './nodes._common' import * as Common from './_common' +import * as Nodes_Common from './nodes._common' export interface ResponseBase extends Nodes_Common.NodesResponseBase { cluster_name: Common.Name; diff --git a/api/_types/nodes.stats.d.ts b/api/_types/nodes.stats.d.ts index 0ea76c74a..a8bb6093b 100644 --- a/api/_types/nodes.stats.d.ts +++ b/api/_types/nodes.stats.d.ts @@ -14,8 +14,8 @@ * modify the API generator. */ -import * as Nodes_Common from './nodes._common' import * as Common from './_common' +import * as Nodes_Common from './nodes._common' export type IndexMetric = '_all' | 'completion' | 'docs' | 'fielddata' | 'flush' | 'get' | 'indexing' | 'merge' | 'query_cache' | 'recovery' | 'refresh' | 'request_cache' | 'search' | 'segments' | 'store' | 'suggest' | 'translog' | 'warmer' diff --git a/api/_types/snapshot._common.d.ts b/api/_types/snapshot._common.d.ts index 8a17bf2f9..514d44f06 100644 --- a/api/_types/snapshot._common.d.ts +++ b/api/_types/snapshot._common.d.ts @@ -18,14 +18,14 @@ import * as Common from './_common' export interface FileCountSnapshotStats { file_count: number; - size_in_bytes: Common.Bytes; + size_in_bytes: Common.ByteCount; } export interface IndexDetails { max_segments_per_shard: number; shard_count: number; - size?: Common.StorageSize; - size_in_bytes: Common.Bytes; + size?: Common.HumanReadableByteCount; + size_in_bytes: Common.ByteCount; } export interface InfoFeatureState { @@ -68,7 +68,7 @@ export interface ShardsStatsSummary { export interface ShardsStatsSummaryItem { file_count: number; - size_in_bytes: Common.Bytes; + size_in_bytes: Common.ByteCount; } export interface SnapshotIndexStats { diff --git a/api/_types/tasks._common.d.ts b/api/_types/tasks._common.d.ts index b7c73a7a4..0e4ca508c 100644 --- a/api/_types/tasks._common.d.ts +++ b/api/_types/tasks._common.d.ts @@ -18,18 +18,24 @@ import * as Common from './_common' export type GroupBy = 'nodes' | 'none' | 'parents' -export interface NodeTasks { - attributes?: Record; - host?: Common.Host; - ip?: Common.Ip; - name?: Common.NodeId; - roles?: string[]; +export interface PersistentTaskStatus { + state: string; +} + +export type RawTaskStatus = Record> + +export interface ReplicationTaskStatus { + phase: string; +} + +export type Status = ReplicationTaskStatus | Common.BulkByScrollTaskStatus | PersistentTaskStatus | RawTaskStatus + +export interface TaskExecutingNode extends Common.BaseNode { tasks: Record; - transport_address?: Common.TransportAddress; } -export interface ParentTaskInfo extends TaskInfo { - children?: TaskInfo[]; +export interface TaskGroup extends TaskInfo { + children?: TaskGroup[]; } export interface TaskInfo { @@ -44,16 +50,18 @@ export interface TaskInfo { running_time?: Common.Duration; running_time_in_nanos: Common.DurationValueUnitNanos; start_time_in_millis: Common.EpochTimeUnitMillis; - status?: Record; + status?: Status; type: string; } -export type TaskInfos = TaskInfo[] | Record +export type TaskInfos = TaskInfo[] | Record export interface TaskListResponseBase { node_failures?: Common.ErrorCause[]; - nodes?: Record; + nodes?: Record; task_failures?: Common.TaskFailure[]; tasks?: TaskInfos; } +export type TaskResponse = Common.BulkByScrollResponseBase + diff --git a/api/asynchronousSearch/get.d.ts b/api/asynchronousSearch/get.d.ts index 1bbbee3cf..4c57a9804 100644 --- a/api/asynchronousSearch/get.d.ts +++ b/api/asynchronousSearch/get.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as AsynchronousSearch_Common from '../_types/asynchronous_search._common' +import * as Global from '../_types/_global' export interface AsynchronousSearch_Get_Request extends Global.Params { id: string; diff --git a/api/asynchronousSearch/search.d.ts b/api/asynchronousSearch/search.d.ts index 5139f0b38..f8ed81a1d 100644 --- a/api/asynchronousSearch/search.d.ts +++ b/api/asynchronousSearch/search.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as AsynchronousSearch_Common from '../_types/asynchronous_search._common' +import * as Global from '../_types/_global' export interface AsynchronousSearch_Search_Request extends Global.Params { body?: AsynchronousSearch_Common.Search; diff --git a/api/asynchronousSearch/stats.d.ts b/api/asynchronousSearch/stats.d.ts index 7d961f264..cb9b49164 100644 --- a/api/asynchronousSearch/stats.d.ts +++ b/api/asynchronousSearch/stats.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as AsynchronousSearch_Common from '../_types/asynchronous_search._common' +import * as Global from '../_types/_global' export type AsynchronousSearch_Stats_Request = Global.Params & Record diff --git a/api/cat/aliases.d.ts b/api/cat/aliases.d.ts index 0918c29bf..81afc022f 100644 --- a/api/cat/aliases.d.ts +++ b/api/cat/aliases.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Aliases from '../_types/cat.aliases' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Aliases_Request extends Global.Params { expand_wildcards?: Common.ExpandWildcards; diff --git a/api/cat/allPitSegments.d.ts b/api/cat/allPitSegments.d.ts index cc82d52df..17443b772 100644 --- a/api/cat/allPitSegments.d.ts +++ b/api/cat/allPitSegments.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Common from '../_types/cat._common' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_AllPitSegments_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; format?: string; h?: string[]; help?: boolean; diff --git a/api/cat/allocation.d.ts b/api/cat/allocation.d.ts index ad8c4113d..432089c62 100644 --- a/api/cat/allocation.d.ts +++ b/api/cat/allocation.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Allocation from '../_types/cat.allocation' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Allocation_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; cluster_manager_timeout?: Common.Duration; format?: string; h?: string[]; diff --git a/api/cat/clusterManager.d.ts b/api/cat/clusterManager.d.ts index 9366f3258..06e5482ab 100644 --- a/api/cat/clusterManager.d.ts +++ b/api/cat/clusterManager.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_ClusterManager from '../_types/cat.cluster_manager' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_ClusterManager_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/count.d.ts b/api/cat/count.d.ts index de359a3b8..15e9964d2 100644 --- a/api/cat/count.d.ts +++ b/api/cat/count.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Count from '../_types/cat.count' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Count_Request extends Global.Params { format?: string; diff --git a/api/cat/fielddata.d.ts b/api/cat/fielddata.d.ts index e4685f999..29b757181 100644 --- a/api/cat/fielddata.d.ts +++ b/api/cat/fielddata.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Fielddata from '../_types/cat.fielddata' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Fielddata_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; fields?: Common.Fields; format?: string; h?: string[]; diff --git a/api/cat/health.d.ts b/api/cat/health.d.ts index b2132dd86..7afcfe188 100644 --- a/api/cat/health.d.ts +++ b/api/cat/health.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Health from '../_types/cat.health' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Health_Request extends Global.Params { format?: string; diff --git a/api/cat/indices.d.ts b/api/cat/indices.d.ts index fa8300d6a..9ac85a6bf 100644 --- a/api/cat/indices.d.ts +++ b/api/cat/indices.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Indices from '../_types/cat.indices' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Indices_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; cluster_manager_timeout?: Common.Duration; expand_wildcards?: Common.ExpandWildcards; format?: string; diff --git a/api/cat/master.d.ts b/api/cat/master.d.ts index 72782ce8f..f7bb1bfbd 100644 --- a/api/cat/master.d.ts +++ b/api/cat/master.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Master from '../_types/cat.master' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Master_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/nodeattrs.d.ts b/api/cat/nodeattrs.d.ts index 90fc371a9..bcea05f77 100644 --- a/api/cat/nodeattrs.d.ts +++ b/api/cat/nodeattrs.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Nodeattrs from '../_types/cat.nodeattrs' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Nodeattrs_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/nodes.d.ts b/api/cat/nodes.d.ts index f00520104..426ebdd38 100644 --- a/api/cat/nodes.d.ts +++ b/api/cat/nodes.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Nodes from '../_types/cat.nodes' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Nodes_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; cluster_manager_timeout?: Common.Duration; format?: string; full_id?: boolean | string; diff --git a/api/cat/pendingTasks.d.ts b/api/cat/pendingTasks.d.ts index c07cc7ad7..0fa7d6530 100644 --- a/api/cat/pendingTasks.d.ts +++ b/api/cat/pendingTasks.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_PendingTasks from '../_types/cat.pending_tasks' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_PendingTasks_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/pitSegments.d.ts b/api/cat/pitSegments.d.ts index 2dfffbd51..ff684c00a 100644 --- a/api/cat/pitSegments.d.ts +++ b/api/cat/pitSegments.d.ts @@ -15,13 +15,13 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Common from '../_types/cat._common' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_PitSegments_Request extends Global.Params { body?: Cat_PitSegments_RequestBody; - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; format?: string; h?: string[]; help?: boolean; diff --git a/api/cat/plugins.d.ts b/api/cat/plugins.d.ts index 70250f47a..f32c9d368 100644 --- a/api/cat/plugins.d.ts +++ b/api/cat/plugins.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Plugins from '../_types/cat.plugins' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Plugins_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/recovery.d.ts b/api/cat/recovery.d.ts index 179506999..3a307ac7a 100644 --- a/api/cat/recovery.d.ts +++ b/api/cat/recovery.d.ts @@ -15,13 +15,13 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Recovery from '../_types/cat.recovery' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Recovery_Request extends Global.Params { active_only?: boolean; - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; detailed?: boolean; format?: string; h?: string[]; diff --git a/api/cat/repositories.d.ts b/api/cat/repositories.d.ts index 8de62a7b7..939670b66 100644 --- a/api/cat/repositories.d.ts +++ b/api/cat/repositories.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Repositories from '../_types/cat.repositories' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Repositories_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/segmentReplication.d.ts b/api/cat/segmentReplication.d.ts index 4cc0adfef..742da1a21 100644 --- a/api/cat/segmentReplication.d.ts +++ b/api/cat/segmentReplication.d.ts @@ -15,14 +15,14 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Common from '../_types/cat._common' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_SegmentReplication_Request extends Global.Params { active_only?: boolean; allow_no_indices?: boolean; - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; completed_only?: boolean; detailed?: boolean; expand_wildcards?: Common.ExpandWildcards; diff --git a/api/cat/segments.d.ts b/api/cat/segments.d.ts index 023cd8afc..41c3dc48d 100644 --- a/api/cat/segments.d.ts +++ b/api/cat/segments.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Segments from '../_types/cat.segments' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Segments_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; cluster_manager_timeout?: Common.Duration; format?: string; h?: string[]; diff --git a/api/cat/shards.d.ts b/api/cat/shards.d.ts index dcf6d9700..9be7ca924 100644 --- a/api/cat/shards.d.ts +++ b/api/cat/shards.d.ts @@ -15,12 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Shards from '../_types/cat.shards' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Shards_Request extends Global.Params { - bytes?: Common.StorageType; + bytes?: Common.ByteUnit; cluster_manager_timeout?: Common.Duration; format?: string; h?: string[]; diff --git a/api/cat/snapshots.d.ts b/api/cat/snapshots.d.ts index 0c4f06451..f560b1645 100644 --- a/api/cat/snapshots.d.ts +++ b/api/cat/snapshots.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Snapshots from '../_types/cat.snapshots' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Snapshots_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/tasks.d.ts b/api/cat/tasks.d.ts index c1985c4f3..f0dcc16c6 100644 --- a/api/cat/tasks.d.ts +++ b/api/cat/tasks.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Tasks from '../_types/cat.tasks' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Tasks_Request extends Global.Params { actions?: string[]; diff --git a/api/cat/templates.d.ts b/api/cat/templates.d.ts index b95d79d71..5bcbea6c6 100644 --- a/api/cat/templates.d.ts +++ b/api/cat/templates.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_Templates from '../_types/cat.templates' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_Templates_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cat/threadPool.d.ts b/api/cat/threadPool.d.ts index e948de362..410090207 100644 --- a/api/cat/threadPool.d.ts +++ b/api/cat/threadPool.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cat_ThreadPool from '../_types/cat.thread_pool' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cat_ThreadPool_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cluster/allocationExplain.d.ts b/api/cluster/allocationExplain.d.ts index 017db1c38..d12fc8837 100644 --- a/api/cluster/allocationExplain.d.ts +++ b/api/cluster/allocationExplain.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_AllocationExplain from '../_types/cluster.allocation_explain' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_AllocationExplain_Request extends Global.Params { body?: Cluster_AllocationExplain_RequestBody; diff --git a/api/cluster/deleteComponentTemplate.d.ts b/api/cluster/deleteComponentTemplate.d.ts index e144ce471..ebb184123 100644 --- a/api/cluster/deleteComponentTemplate.d.ts +++ b/api/cluster/deleteComponentTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_DeleteComponentTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cluster/deleteDecommissionAwareness.d.ts b/api/cluster/deleteDecommissionAwareness.d.ts index ea137c2a2..5b6da4846 100644 --- a/api/cluster/deleteDecommissionAwareness.d.ts +++ b/api/cluster/deleteDecommissionAwareness.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export type Cluster_DeleteDecommissionAwareness_Request = Global.Params & Record diff --git a/api/cluster/deleteWeightedRouting.d.ts b/api/cluster/deleteWeightedRouting.d.ts index 7bbb831ee..f31f138e9 100644 --- a/api/cluster/deleteWeightedRouting.d.ts +++ b/api/cluster/deleteWeightedRouting.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Cluster_WeightedRouting from '../_types/cluster.weighted_routing' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_DeleteWeightedRouting_Request extends Global.Params { body?: Cluster_WeightedRouting.WeightsBase; diff --git a/api/cluster/existsComponentTemplate.d.ts b/api/cluster/existsComponentTemplate.d.ts index 7ca241523..0041d63be 100644 --- a/api/cluster/existsComponentTemplate.d.ts +++ b/api/cluster/existsComponentTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_ExistsComponentTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cluster/getComponentTemplate.d.ts b/api/cluster/getComponentTemplate.d.ts index 98c00d850..f5e1a3187 100644 --- a/api/cluster/getComponentTemplate.d.ts +++ b/api/cluster/getComponentTemplate.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_Common from '../_types/cluster._common' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_GetComponentTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cluster/getDecommissionAwareness.d.ts b/api/cluster/getDecommissionAwareness.d.ts index a1a3dff40..6dd808aaf 100644 --- a/api/cluster/getDecommissionAwareness.d.ts +++ b/api/cluster/getDecommissionAwareness.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Cluster_DecommissionAwareness from '../_types/cluster.decommission_awareness' +import * as Global from '../_types/_global' export interface Cluster_GetDecommissionAwareness_Request extends Global.Params { awareness_attribute_name: string; diff --git a/api/cluster/getSettings.d.ts b/api/cluster/getSettings.d.ts index 6e289b03c..f7052742b 100644 --- a/api/cluster/getSettings.d.ts +++ b/api/cluster/getSettings.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_GetSettings_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cluster/getWeightedRouting.d.ts b/api/cluster/getWeightedRouting.d.ts index 3e489d8d0..5b3f64668 100644 --- a/api/cluster/getWeightedRouting.d.ts +++ b/api/cluster/getWeightedRouting.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Cluster_WeightedRouting from '../_types/cluster.weighted_routing' +import * as Global from '../_types/_global' export interface Cluster_GetWeightedRouting_Request extends Global.Params { attribute: string; diff --git a/api/cluster/health.d.ts b/api/cluster/health.d.ts index 3c3147652..22729f6c0 100644 --- a/api/cluster/health.d.ts +++ b/api/cluster/health.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_Health from '../_types/cluster.health' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_Health_Request extends Global.Params { awareness_attribute?: string; diff --git a/api/cluster/pendingTasks.d.ts b/api/cluster/pendingTasks.d.ts index 5fb8a5733..21bdfb6b6 100644 --- a/api/cluster/pendingTasks.d.ts +++ b/api/cluster/pendingTasks.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_PendingTasks from '../_types/cluster.pending_tasks' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_PendingTasks_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/cluster/postVotingConfigExclusions.d.ts b/api/cluster/postVotingConfigExclusions.d.ts index 2c9637d11..8b01d1637 100644 --- a/api/cluster/postVotingConfigExclusions.d.ts +++ b/api/cluster/postVotingConfigExclusions.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_PostVotingConfigExclusions_Request extends Global.Params { node_ids?: Common.Ids; diff --git a/api/cluster/putComponentTemplate.d.ts b/api/cluster/putComponentTemplate.d.ts index 21522e685..5f2835178 100644 --- a/api/cluster/putComponentTemplate.d.ts +++ b/api/cluster/putComponentTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Cluster_PutComponentTemplate_Request extends Global.Params { diff --git a/api/cluster/putDecommissionAwareness.d.ts b/api/cluster/putDecommissionAwareness.d.ts index b09b4fba0..f026b6623 100644 --- a/api/cluster/putDecommissionAwareness.d.ts +++ b/api/cluster/putDecommissionAwareness.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_PutDecommissionAwareness_Request extends Global.Params { awareness_attribute_name: string; diff --git a/api/cluster/putSettings.d.ts b/api/cluster/putSettings.d.ts index 3c3d8ae7a..9522123a6 100644 --- a/api/cluster/putSettings.d.ts +++ b/api/cluster/putSettings.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_PutSettings_Request extends Global.Params { body: Cluster_PutSettings_RequestBody; diff --git a/api/cluster/putWeightedRouting.d.ts b/api/cluster/putWeightedRouting.d.ts index 036583c1a..8e18825d6 100644 --- a/api/cluster/putWeightedRouting.d.ts +++ b/api/cluster/putWeightedRouting.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Cluster_WeightedRouting from '../_types/cluster.weighted_routing' +import * as Global from '../_types/_global' export interface Cluster_PutWeightedRouting_Request extends Global.Params { attribute: string; diff --git a/api/cluster/remoteInfo.d.ts b/api/cluster/remoteInfo.d.ts index 786b03165..bcd4a6e58 100644 --- a/api/cluster/remoteInfo.d.ts +++ b/api/cluster/remoteInfo.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Cluster_RemoteInfo from '../_types/cluster.remote_info' +import * as Global from '../_types/_global' export type Cluster_RemoteInfo_Request = Global.Params & Record diff --git a/api/cluster/reroute.d.ts b/api/cluster/reroute.d.ts index 26ac81953..3cfd33875 100644 --- a/api/cluster/reroute.d.ts +++ b/api/cluster/reroute.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_Reroute from '../_types/cluster.reroute' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_Reroute_Request extends Global.Params { body?: Cluster_Reroute_RequestBody; @@ -25,7 +25,7 @@ export interface Cluster_Reroute_Request extends Global.Params { dry_run?: boolean; explain?: boolean; master_timeout?: Common.Duration; - metric?: Common.Metrics; + metric?: Cluster_Reroute.Metric | Cluster_Reroute.Metric[]; retry_failed?: boolean; timeout?: Common.Duration; } diff --git a/api/cluster/state.d.ts b/api/cluster/state.d.ts index e9f7e3834..585743cd5 100644 --- a/api/cluster/state.d.ts +++ b/api/cluster/state.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_State from '../_types/cluster.state' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_State_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/cluster/stats.d.ts b/api/cluster/stats.d.ts index 632079ba1..27a53d805 100644 --- a/api/cluster/stats.d.ts +++ b/api/cluster/stats.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common from '../_types/_common' import * as Cluster_Stats from '../_types/cluster.stats' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Cluster_Stats_Request extends Global.Params { flat_settings?: boolean; diff --git a/api/danglingIndices/deleteDanglingIndex.d.ts b/api/danglingIndices/deleteDanglingIndex.d.ts index 8ff420afe..a5936fe94 100644 --- a/api/danglingIndices/deleteDanglingIndex.d.ts +++ b/api/danglingIndices/deleteDanglingIndex.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface DanglingIndices_DeleteDanglingIndex_Request extends Global.Params { accept_data_loss: boolean; diff --git a/api/danglingIndices/importDanglingIndex.d.ts b/api/danglingIndices/importDanglingIndex.d.ts index cc509e19f..13386360a 100644 --- a/api/danglingIndices/importDanglingIndex.d.ts +++ b/api/danglingIndices/importDanglingIndex.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface DanglingIndices_ImportDanglingIndex_Request extends Global.Params { accept_data_loss: boolean; diff --git a/api/danglingIndices/listDanglingIndices.d.ts b/api/danglingIndices/listDanglingIndices.d.ts index b4e7917a9..bf838e366 100644 --- a/api/danglingIndices/listDanglingIndices.d.ts +++ b/api/danglingIndices/listDanglingIndices.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as DanglingIndices_ListDanglingIndices from '../_types/dangling_indices.list_dangling_indices' +import * as Global from '../_types/_global' export type DanglingIndices_ListDanglingIndices_Request = Global.Params & Record diff --git a/api/flowFramework/_api.js b/api/flowFramework/_api.js index 887e3811f..2900e46b2 100644 --- a/api/flowFramework/_api.js +++ b/api/flowFramework/_api.js @@ -21,9 +21,21 @@ function FlowFrameworkApi(bindObj) { this.create = require('./create').bind(bindObj); this.delete = require('./delete').bind(bindObj); + this.deprovision = require('./deprovision').bind(bindObj); this.get = require('./get').bind(bindObj); + this.getStatus = require('./getStatus').bind(bindObj); + this.getSteps = require('./getSteps').bind(bindObj); + this.provision = require('./provision').bind(bindObj); + this.search = require('./search').bind(bindObj); + this.searchState = require('./searchState').bind(bindObj); this.update = require('./update').bind(bindObj); + // Deprecated: Use getStatus instead. + this.get_status = require('./getStatus').bind(bindObj); + // Deprecated: Use getSteps instead. + this.get_steps = require('./getSteps').bind(bindObj); + // Deprecated: Use searchState instead. + this.search_state = require('./searchState').bind(bindObj); } module.exports = FlowFrameworkApi; diff --git a/api/flowFramework/create.d.ts b/api/flowFramework/create.d.ts index bb04e63b1..39284858c 100644 --- a/api/flowFramework/create.d.ts +++ b/api/flowFramework/create.d.ts @@ -15,15 +15,16 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' export interface FlowFramework_Create_Request extends Global.Params { body?: FlowFramework_Common.FlowFrameworkCreate; - provision?: boolean; - reprovision?: boolean; - use_case?: string; - validation?: string; + provision?: FlowFramework_Common.Provision; + reprovision?: FlowFramework_Common.Reprovision; + update_fields?: FlowFramework_Common.UpdateFields; + use_case?: FlowFramework_Common.UseCase; + validation?: FlowFramework_Common.Validation; } export interface FlowFramework_Create_Response extends ApiResponse { diff --git a/api/flowFramework/create.js b/api/flowFramework/create.js index 618bed821..a01550abb 100644 --- a/api/flowFramework/create.js +++ b/api/flowFramework/create.js @@ -25,8 +25,9 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Flow-Framework * * @param {object} [params] - * @param {boolean} [params.provision=false] - Provision the workflow as part of the request + * @param {boolean} [params.provision=false] - Provision the workflow as part of the request. * @param {boolean} [params.reprovision=false] + * @param {boolean} [params.update_fields=false] - Update only the fields included in the request body. * @param {string} [params.use_case] - To use a workflow template, specify it in the use_case query parameter when creating a workflow. * @param {string} [params.validation=all] - Validate the workflow. Valid values are all (validate the template) and none (do not validate the template). Default is all. * @param {object} [params.body] diff --git a/api/flowFramework/delete.d.ts b/api/flowFramework/delete.d.ts index 19cc3db5b..a5bccd560 100644 --- a/api/flowFramework/delete.d.ts +++ b/api/flowFramework/delete.d.ts @@ -15,11 +15,12 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as FlowFramework_Common from '../_types/flow_framework.common' import * as Global from '../_types/_global' export interface FlowFramework_Delete_Request extends Global.Params { clear_status?: boolean; - workflow_id: string; + workflow_id: FlowFramework_Common.WorkflowID; } export interface FlowFramework_Delete_Response extends ApiResponse { diff --git a/api/flowFramework/deprovision.d.ts b/api/flowFramework/deprovision.d.ts new file mode 100644 index 000000000..5b693d586 --- /dev/null +++ b/api/flowFramework/deprovision.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 FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' + +export interface FlowFramework_Deprovision_Request extends Global.Params { + allow_delete?: FlowFramework_Common.AllowDelete; + workflow_id: FlowFramework_Common.WorkflowID; +} + +export interface FlowFramework_Deprovision_Response extends ApiResponse { + body: FlowFramework_Deprovision_ResponseBody; +} + +export type FlowFramework_Deprovision_ResponseBody = Record + diff --git a/api/flowFramework/deprovision.js b/api/flowFramework/deprovision.js new file mode 100644 index 000000000..8ffbd5a94 --- /dev/null +++ b/api/flowFramework/deprovision.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'); + +/** + * Deprovision workflow's resources when you no longer need it. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/deprovision-workflow/ - flow_framework.deprovision} + * + * @memberOf API-Flow-Framework + * + * @param {object} params + * @param {string} [params.allow_delete] - Required when deleting resources involves a high potential for data loss. + * @param {string} params.workflow_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 deprovisionFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.workflow_id == null) return handleMissingParam('workflow_id', this, callback); + + let { body, workflow_id, ...querystring } = params; + workflow_id = parsePathParam(workflow_id); + + const path = '/_plugins/_flow_framework/workflow/' + workflow_id + '/_deprovision'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deprovisionFunc; diff --git a/api/flowFramework/get.d.ts b/api/flowFramework/get.d.ts index 56c13c379..df94018ac 100644 --- a/api/flowFramework/get.d.ts +++ b/api/flowFramework/get.d.ts @@ -15,10 +15,11 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as FlowFramework_Common from '../_types/flow_framework.common' import * as Global from '../_types/_global' export interface FlowFramework_Get_Request extends Global.Params { - workflow_id: string; + workflow_id: FlowFramework_Common.WorkflowID; } export interface FlowFramework_Get_Response extends ApiResponse { diff --git a/api/flowFramework/getStatus.d.ts b/api/flowFramework/getStatus.d.ts new file mode 100644 index 000000000..ae03a9aac --- /dev/null +++ b/api/flowFramework/getStatus.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 FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' + +export interface FlowFramework_GetStatus_Request extends Global.Params { + all?: FlowFramework_Common.All; + workflow_id: FlowFramework_Common.WorkflowID; +} + +export interface FlowFramework_GetStatus_Response extends ApiResponse { + body: FlowFramework_GetStatus_ResponseBody; +} + +export type FlowFramework_GetStatus_ResponseBody = Record + diff --git a/api/flowFramework/getStatus.js b/api/flowFramework/getStatus.js new file mode 100644 index 000000000..4cc8c7d48 --- /dev/null +++ b/api/flowFramework/getStatus.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'); + +/** + * Get the provisioning deployment status until it is complete. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/get-workflow-status/ - flow_framework.get_status} + * + * @memberOf API-Flow-Framework + * + * @param {object} params + * @param {boolean} [params.all=false] - The all parameter specifies whether the response should return all fields. + * @param {string} params.workflow_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 getStatusFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.workflow_id == null) return handleMissingParam('workflow_id', this, callback); + + let { body, workflow_id, ...querystring } = params; + workflow_id = parsePathParam(workflow_id); + + const path = '/_plugins/_flow_framework/workflow/' + workflow_id + '/_status'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getStatusFunc; diff --git a/api/flowFramework/getSteps.d.ts b/api/flowFramework/getSteps.d.ts new file mode 100644 index 000000000..490cca499 --- /dev/null +++ b/api/flowFramework/getSteps.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 FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' + +export interface FlowFramework_GetSteps_Request extends Global.Params { + workflow_step?: FlowFramework_Common.WorkflowStepName; +} + +export interface FlowFramework_GetSteps_Response extends ApiResponse { + body: FlowFramework_GetSteps_ResponseBody; +} + +export type FlowFramework_GetSteps_ResponseBody = Record + diff --git a/api/flowFramework/getSteps.js b/api/flowFramework/getSteps.js new file mode 100644 index 000000000..d4eb39711 --- /dev/null +++ b/api/flowFramework/getSteps.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'); + +/** + * Get a list of workflow steps. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/get-workflow-steps/ - flow_framework.get_steps} + * + * @memberOf API-Flow-Framework + * + * @param {object} [params] + * @param {string} [params.workflow_step] + * + * @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 getStepsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_flow_framework/workflow/_steps'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getStepsFunc; diff --git a/api/flowFramework/provision.d.ts b/api/flowFramework/provision.d.ts new file mode 100644 index 000000000..127fcdf6b --- /dev/null +++ b/api/flowFramework/provision.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 FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' + +export interface FlowFramework_Provision_Request extends Global.Params { + body?: FlowFramework_Common.UserProvidedSubstitutionExpressions; + workflow_id: FlowFramework_Common.WorkflowID; +} + +export interface FlowFramework_Provision_Response extends ApiResponse { + body: FlowFramework_Provision_ResponseBody; +} + +export type FlowFramework_Provision_ResponseBody = Record + diff --git a/api/flowFramework/provision.js b/api/flowFramework/provision.js new file mode 100644 index 000000000..9e939533a --- /dev/null +++ b/api/flowFramework/provision.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'); + +/** + * Provisioning a workflow. This API is also executed when the Create or Update Workflow API is called with the provision parameter set to true. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/provision-workflow/ - flow_framework.provision} + * + * @memberOf API-Flow-Framework + * + * @param {object} params + * @param {string} params.workflow_id + * @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 provisionFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.workflow_id == null) return handleMissingParam('workflow_id', this, callback); + + let { body, workflow_id, ...querystring } = params; + workflow_id = parsePathParam(workflow_id); + + const path = '/_plugins/_flow_framework/workflow/' + workflow_id + '/_provision'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = provisionFunc; diff --git a/api/flowFramework/search.d.ts b/api/flowFramework/search.d.ts new file mode 100644 index 000000000..bce3c9d32 --- /dev/null +++ b/api/flowFramework/search.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 FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' + +export interface FlowFramework_Search_Request extends Global.Params { + body: FlowFramework_Common.SearchWorkflowRequest; +} + +export interface FlowFramework_Search_Response extends ApiResponse { + body: FlowFramework_Search_ResponseBody; +} + +export type FlowFramework_Search_ResponseBody = Record + diff --git a/api/flowFramework/search.js b/api/flowFramework/search.js new file mode 100644 index 000000000..5e038f9b0 --- /dev/null +++ b/api/flowFramework/search.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, handleMissingParam } = require('../utils'); + +/** + * Search for workflows by using a query matching a field. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/provision-workflow/ - flow_framework.search} + * + * @memberOf API-Flow-Framework + * + * @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 searchFunc(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/_flow_framework/workflow/_search'; + const method = body ? 'POST' : 'GET'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = searchFunc; diff --git a/api/flowFramework/searchState.d.ts b/api/flowFramework/searchState.d.ts new file mode 100644 index 000000000..80e471138 --- /dev/null +++ b/api/flowFramework/searchState.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 FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' + +export interface FlowFramework_SearchState_Request extends Global.Params { + body: FlowFramework_Common.SearchWorkflowRequest; +} + +export interface FlowFramework_SearchState_Response extends ApiResponse { + body: FlowFramework_SearchState_ResponseBody; +} + +export type FlowFramework_SearchState_ResponseBody = Record + diff --git a/api/flowFramework/searchState.js b/api/flowFramework/searchState.js new file mode 100644 index 000000000..1dce20851 --- /dev/null +++ b/api/flowFramework/searchState.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, handleMissingParam } = require('../utils'); + +/** + * Search for workflows by using a query matching a field. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/search-workflow-state/ - flow_framework.search_state} + * + * @memberOf API-Flow-Framework + * + * @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 searchStateFunc(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/_flow_framework/workflow/state/_search'; + const method = body ? 'POST' : 'GET'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = searchStateFunc; diff --git a/api/flowFramework/update.d.ts b/api/flowFramework/update.d.ts index 2babf31d6..643648aed 100644 --- a/api/flowFramework/update.d.ts +++ b/api/flowFramework/update.d.ts @@ -15,13 +15,17 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as FlowFramework_Common from '../_types/flow_framework.common' +import * as Global from '../_types/_global' export interface FlowFramework_Update_Request extends Global.Params { body?: FlowFramework_Common.FlowFrameworkUpdate; - update_fields?: boolean; - workflow_id: string; + provision?: FlowFramework_Common.Provision; + reprovision?: FlowFramework_Common.Reprovision; + update_fields?: FlowFramework_Common.UpdateFields; + use_case?: FlowFramework_Common.UseCase; + validation?: FlowFramework_Common.Validation; + workflow_id: FlowFramework_Common.WorkflowID; } export interface FlowFramework_Update_Response extends ApiResponse { diff --git a/api/flowFramework/update.js b/api/flowFramework/update.js index 0408b1af6..b330826b9 100644 --- a/api/flowFramework/update.js +++ b/api/flowFramework/update.js @@ -25,7 +25,11 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Flow-Framework * * @param {object} params + * @param {boolean} [params.provision=false] - Provision the workflow as part of the request. + * @param {boolean} [params.reprovision=false] * @param {boolean} [params.update_fields=false] - Update only the fields included in the request body. + * @param {string} [params.use_case] - To use a workflow template, specify it in the use_case query parameter when creating a workflow. + * @param {string} [params.validation=all] - Validate the workflow. Valid values are all (validate the template) and none (do not validate the template). Default is all. * @param {string} params.workflow_id * @param {object} [params.body] * diff --git a/api/index.d.ts b/api/index.d.ts index c1473992d..b28c15357 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -229,6 +229,7 @@ import { Security_GetUsersLegacy_Request, Security_GetUsersLegacy_Response, Secu import { Security_DeleteUserLegacy_Request, Security_DeleteUserLegacy_Response, Security_DeleteUserLegacy_ResponseBody } from './security/deleteUserLegacy'; import { Security_GetUserLegacy_Request, Security_GetUserLegacy_Response, Security_GetUserLegacy_ResponseBody } from './security/getUserLegacy'; import { Security_CreateUserLegacy_Request, Security_CreateUserLegacy_Response, Security_CreateUserLegacy_ResponseBody } from './security/createUserLegacy'; +import { Security_GenerateUserTokenLegacy_Request, Security_GenerateUserTokenLegacy_Response, Security_GenerateUserTokenLegacy_ResponseBody } from './security/generateUserTokenLegacy'; import { Security_Validate_Request, Security_Validate_Response, Security_Validate_ResponseBody } from './security/validate'; import { Security_Authinfo_Request, Security_Authinfo_Response, Security_Authinfo_ResponseBody } from './security/authinfo'; import { Security_GetDashboardsInfo_Request, Security_GetDashboardsInfo_Response, Security_GetDashboardsInfo_ResponseBody } from './security/getDashboardsInfo'; @@ -242,15 +243,37 @@ import { AsynchronousSearch_Delete_Request, AsynchronousSearch_Delete_Response, import { AsynchronousSearch_Get_Request, AsynchronousSearch_Get_Response, AsynchronousSearch_Get_ResponseBody } from './asynchronousSearch/get'; import { AsynchronousSearch_Stats_Request, AsynchronousSearch_Stats_Response, AsynchronousSearch_Stats_ResponseBody } from './asynchronousSearch/stats'; import { FlowFramework_Create_Request, FlowFramework_Create_Response, FlowFramework_Create_ResponseBody } from './flowFramework/create'; +import { FlowFramework_Search_Request, FlowFramework_Search_Response, FlowFramework_Search_ResponseBody } from './flowFramework/search'; +import { FlowFramework_GetSteps_Request, FlowFramework_GetSteps_Response, FlowFramework_GetSteps_ResponseBody } from './flowFramework/getSteps'; import { FlowFramework_Delete_Request, FlowFramework_Delete_Response, FlowFramework_Delete_ResponseBody } from './flowFramework/delete'; import { FlowFramework_Get_Request, FlowFramework_Get_Response, FlowFramework_Get_ResponseBody } from './flowFramework/get'; import { FlowFramework_Update_Request, FlowFramework_Update_Response, FlowFramework_Update_ResponseBody } from './flowFramework/update'; +import { FlowFramework_Deprovision_Request, FlowFramework_Deprovision_Response, FlowFramework_Deprovision_ResponseBody } from './flowFramework/deprovision'; +import { FlowFramework_Provision_Request, FlowFramework_Provision_Response, FlowFramework_Provision_ResponseBody } from './flowFramework/provision'; +import { FlowFramework_GetStatus_Request, FlowFramework_GetStatus_Response, FlowFramework_GetStatus_ResponseBody } from './flowFramework/getStatus'; +import { FlowFramework_SearchState_Request, FlowFramework_SearchState_Response, FlowFramework_SearchState_ResponseBody } from './flowFramework/searchState'; +import { Ism_AddPolicy_Request, Ism_AddPolicy_Response, Ism_AddPolicy_ResponseBody } from './ism/addPolicy'; +import { Ism_ChangePolicy_Request, Ism_ChangePolicy_Response, Ism_ChangePolicy_ResponseBody } from './ism/changePolicy'; +import { Ism_ExplainPolicy_Request, Ism_ExplainPolicy_RequestBody, Ism_ExplainPolicy_Response, Ism_ExplainPolicy_ResponseBody } from './ism/explainPolicy'; +import { Ism_GetPolicies_Request, Ism_GetPolicies_Response, Ism_GetPolicies_ResponseBody } from './ism/getPolicies'; +import { Ism_PutPolicies_Request, Ism_PutPolicies_Response, Ism_PutPolicies_ResponseBody } from './ism/putPolicies'; +import { Ism_DeletePolicy_Request, Ism_DeletePolicy_Response, Ism_DeletePolicy_ResponseBody } from './ism/deletePolicy'; +import { Ism_GetPolicy_Request, Ism_GetPolicy_Response, Ism_GetPolicy_ResponseBody } from './ism/getPolicy'; +import { Ism_ExistsPolicy_Request, Ism_ExistsPolicy_Response, Ism_ExistsPolicy_ResponseBody } from './ism/existsPolicy'; +import { Ism_PutPolicy_Request, Ism_PutPolicy_Response, Ism_PutPolicy_ResponseBody } from './ism/putPolicy'; +import { Ism_RemovePolicy_Request, Ism_RemovePolicy_Response, Ism_RemovePolicy_ResponseBody } from './ism/removePolicy'; +import { Ism_RetryIndex_Request, Ism_RetryIndex_Response, Ism_RetryIndex_ResponseBody } from './ism/retryIndex'; +import { Ism_RefreshSearchAnalyzers_Request, Ism_RefreshSearchAnalyzers_Response, Ism_RefreshSearchAnalyzers_ResponseBody } from './ism/refreshSearchAnalyzers'; import { Knn_Stats_Request, Knn_Stats_Response, Knn_Stats_ResponseBody } from './knn/stats'; import { Knn_SearchModels_Request, Knn_SearchModels_RequestBody, Knn_SearchModels_Response, Knn_SearchModels_ResponseBody } from './knn/searchModels'; import { Knn_TrainModel_Request, Knn_TrainModel_RequestBody, Knn_TrainModel_Response, Knn_TrainModel_ResponseBody } from './knn/trainModel'; import { Knn_DeleteModel_Request, Knn_DeleteModel_Response, Knn_DeleteModel_ResponseBody } from './knn/deleteModel'; import { Knn_GetModel_Request, Knn_GetModel_Response, Knn_GetModel_ResponseBody } from './knn/getModel'; import { Knn_Warmup_Request, Knn_Warmup_Response, Knn_Warmup_ResponseBody } from './knn/warmup'; +import { Ml_RegisterAgents_Request, Ml_RegisterAgents_Response, Ml_RegisterAgents_ResponseBody } from './ml/registerAgents'; +import { Ml_DeleteAgent_Request, Ml_DeleteAgent_Response, Ml_DeleteAgent_ResponseBody } from './ml/deleteAgent'; +import { Ml_CreateConnector_Request, Ml_CreateConnector_Response, Ml_CreateConnector_ResponseBody } from './ml/createConnector'; +import { Ml_DeleteConnector_Request, Ml_DeleteConnector_Response, Ml_DeleteConnector_ResponseBody } from './ml/deleteConnector'; import { Ml_RegisterModelGroup_Request, Ml_RegisterModelGroup_RequestBody, Ml_RegisterModelGroup_Response, Ml_RegisterModelGroup_ResponseBody } from './ml/registerModelGroup'; import { Ml_DeleteModelGroup_Request, Ml_DeleteModelGroup_Response, Ml_DeleteModelGroup_ResponseBody } from './ml/deleteModelGroup'; import { Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_ResponseBody } from './ml/getModelGroup'; @@ -299,7 +322,7 @@ import { Rollups_Explain_Request, Rollups_Explain_Response, Rollups_Explain_Resp import { Rollups_Start_Request, Rollups_Start_Response, Rollups_Start_ResponseBody } from './rollups/start'; import { Rollups_Stop_Request, Rollups_Stop_Response, Rollups_Stop_ResponseBody } from './rollups/stop'; import { Transforms_Search_Request, Transforms_Search_Response, Transforms_Search_ResponseBody } from './transforms/search'; -import { Transforms_Preview_Request, Transforms_Preview_Response, Transforms_Preview_ResponseBody } from './transforms/preview'; +import { Transforms_Preview_Request, Transforms_Preview_RequestBody, Transforms_Preview_Response, Transforms_Preview_ResponseBody } from './transforms/preview'; import { Transforms_Delete_Request, Transforms_Delete_Response, Transforms_Delete_ResponseBody } from './transforms/delete'; import { Transforms_Get_Request, Transforms_Get_Response, Transforms_Get_ResponseBody } from './transforms/get'; import { Transforms_Put_Request, Transforms_Put_Response, Transforms_Put_ResponseBody } from './transforms/put'; @@ -541,6 +564,7 @@ export { Security_DeleteUserLegacy_Request, Security_DeleteUserLegacy_Response, Security_DeleteUserLegacy_ResponseBody, Security_GetUserLegacy_Request, Security_GetUserLegacy_Response, Security_GetUserLegacy_ResponseBody, Security_CreateUserLegacy_Request, Security_CreateUserLegacy_Response, Security_CreateUserLegacy_ResponseBody, + Security_GenerateUserTokenLegacy_Request, Security_GenerateUserTokenLegacy_Response, Security_GenerateUserTokenLegacy_ResponseBody, Security_Validate_Request, Security_Validate_Response, Security_Validate_ResponseBody, Security_Authinfo_Request, Security_Authinfo_Response, Security_Authinfo_ResponseBody, Security_GetDashboardsInfo_Request, Security_GetDashboardsInfo_Response, Security_GetDashboardsInfo_ResponseBody, @@ -554,15 +578,37 @@ export { AsynchronousSearch_Get_Request, AsynchronousSearch_Get_Response, AsynchronousSearch_Get_ResponseBody, AsynchronousSearch_Stats_Request, AsynchronousSearch_Stats_Response, AsynchronousSearch_Stats_ResponseBody, FlowFramework_Create_Request, FlowFramework_Create_Response, FlowFramework_Create_ResponseBody, + FlowFramework_Search_Request, FlowFramework_Search_Response, FlowFramework_Search_ResponseBody, + FlowFramework_GetSteps_Request, FlowFramework_GetSteps_Response, FlowFramework_GetSteps_ResponseBody, FlowFramework_Delete_Request, FlowFramework_Delete_Response, FlowFramework_Delete_ResponseBody, FlowFramework_Get_Request, FlowFramework_Get_Response, FlowFramework_Get_ResponseBody, FlowFramework_Update_Request, FlowFramework_Update_Response, FlowFramework_Update_ResponseBody, + FlowFramework_Deprovision_Request, FlowFramework_Deprovision_Response, FlowFramework_Deprovision_ResponseBody, + FlowFramework_Provision_Request, FlowFramework_Provision_Response, FlowFramework_Provision_ResponseBody, + FlowFramework_GetStatus_Request, FlowFramework_GetStatus_Response, FlowFramework_GetStatus_ResponseBody, + FlowFramework_SearchState_Request, FlowFramework_SearchState_Response, FlowFramework_SearchState_ResponseBody, + Ism_AddPolicy_Request, Ism_AddPolicy_Response, Ism_AddPolicy_ResponseBody, + Ism_ChangePolicy_Request, Ism_ChangePolicy_Response, Ism_ChangePolicy_ResponseBody, + Ism_ExplainPolicy_Request, Ism_ExplainPolicy_RequestBody, Ism_ExplainPolicy_Response, Ism_ExplainPolicy_ResponseBody, + Ism_GetPolicies_Request, Ism_GetPolicies_Response, Ism_GetPolicies_ResponseBody, + Ism_PutPolicies_Request, Ism_PutPolicies_Response, Ism_PutPolicies_ResponseBody, + Ism_DeletePolicy_Request, Ism_DeletePolicy_Response, Ism_DeletePolicy_ResponseBody, + Ism_GetPolicy_Request, Ism_GetPolicy_Response, Ism_GetPolicy_ResponseBody, + Ism_ExistsPolicy_Request, Ism_ExistsPolicy_Response, Ism_ExistsPolicy_ResponseBody, + Ism_PutPolicy_Request, Ism_PutPolicy_Response, Ism_PutPolicy_ResponseBody, + Ism_RemovePolicy_Request, Ism_RemovePolicy_Response, Ism_RemovePolicy_ResponseBody, + Ism_RetryIndex_Request, Ism_RetryIndex_Response, Ism_RetryIndex_ResponseBody, + Ism_RefreshSearchAnalyzers_Request, Ism_RefreshSearchAnalyzers_Response, Ism_RefreshSearchAnalyzers_ResponseBody, Knn_Stats_Request, Knn_Stats_Response, Knn_Stats_ResponseBody, Knn_SearchModels_Request, Knn_SearchModels_RequestBody, Knn_SearchModels_Response, Knn_SearchModels_ResponseBody, Knn_TrainModel_Request, Knn_TrainModel_RequestBody, Knn_TrainModel_Response, Knn_TrainModel_ResponseBody, Knn_DeleteModel_Request, Knn_DeleteModel_Response, Knn_DeleteModel_ResponseBody, Knn_GetModel_Request, Knn_GetModel_Response, Knn_GetModel_ResponseBody, Knn_Warmup_Request, Knn_Warmup_Response, Knn_Warmup_ResponseBody, + Ml_RegisterAgents_Request, Ml_RegisterAgents_Response, Ml_RegisterAgents_ResponseBody, + Ml_DeleteAgent_Request, Ml_DeleteAgent_Response, Ml_DeleteAgent_ResponseBody, + Ml_CreateConnector_Request, Ml_CreateConnector_Response, Ml_CreateConnector_ResponseBody, + Ml_DeleteConnector_Request, Ml_DeleteConnector_Response, Ml_DeleteConnector_ResponseBody, Ml_RegisterModelGroup_Request, Ml_RegisterModelGroup_RequestBody, Ml_RegisterModelGroup_Response, Ml_RegisterModelGroup_ResponseBody, Ml_DeleteModelGroup_Request, Ml_DeleteModelGroup_Response, Ml_DeleteModelGroup_ResponseBody, Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_ResponseBody, @@ -611,7 +657,7 @@ export { Rollups_Start_Request, Rollups_Start_Response, Rollups_Start_ResponseBody, Rollups_Stop_Request, Rollups_Stop_Response, Rollups_Stop_ResponseBody, Transforms_Search_Request, Transforms_Search_Response, Transforms_Search_ResponseBody, - Transforms_Preview_Request, Transforms_Preview_Response, Transforms_Preview_ResponseBody, + Transforms_Preview_Request, Transforms_Preview_RequestBody, Transforms_Preview_Response, Transforms_Preview_ResponseBody, Transforms_Delete_Request, Transforms_Delete_Response, Transforms_Delete_ResponseBody, Transforms_Get_Request, Transforms_Get_Response, Transforms_Get_ResponseBody, Transforms_Put_Request, Transforms_Put_Response, Transforms_Put_ResponseBody, diff --git a/api/indices/addBlock.d.ts b/api/indices/addBlock.d.ts index 091b4c7e4..3352e2b48 100644 --- a/api/indices/addBlock.d.ts +++ b/api/indices/addBlock.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Indices_AddBlock from '../_types/indices.add_block' -import * as Common from '../_types/_common' export interface Indices_AddBlock_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/analyze.d.ts b/api/indices/analyze.d.ts index a0373023e..5ac529e0d 100644 --- a/api/indices/analyze.d.ts +++ b/api/indices/analyze.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Common_Analysis from '../_types/_common.analysis' +import * as Global from '../_types/_global' import * as Indices_Analyze from '../_types/indices.analyze' export interface Indices_Analyze_Request extends Global.Params { diff --git a/api/indices/clearCache.d.ts b/api/indices/clearCache.d.ts index 8f0fad62c..b0372f93e 100644 --- a/api/indices/clearCache.d.ts +++ b/api/indices/clearCache.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_ClearCache_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/clone.d.ts b/api/indices/clone.d.ts index a35182434..e3c243a1b 100644 --- a/api/indices/clone.d.ts +++ b/api/indices/clone.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_Clone_Request extends Global.Params { diff --git a/api/indices/close.d.ts b/api/indices/close.d.ts index ad24b5dc2..5f26b40c6 100644 --- a/api/indices/close.d.ts +++ b/api/indices/close.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Close from '../_types/indices.close' export interface Indices_Close_Request extends Global.Params { diff --git a/api/indices/create.d.ts b/api/indices/create.d.ts index be2134ea1..fb1d2d537 100644 --- a/api/indices/create.d.ts +++ b/api/indices/create.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' -import * as Indices_Common from '../_types/indices._common' import * as Common_Mapping from '../_types/_common.mapping' +import * as Global from '../_types/_global' +import * as Indices_Common from '../_types/indices._common' export interface Indices_Create_Request extends Global.Params { body?: Indices_Create_RequestBody; diff --git a/api/indices/createDataStream.d.ts b/api/indices/createDataStream.d.ts index 5fcd1704d..15b6894e3 100644 --- a/api/indices/createDataStream.d.ts +++ b/api/indices/createDataStream.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_CreateDataStream_Request extends Global.Params { body?: Indices_CreateDataStream_RequestBody; diff --git a/api/indices/dataStreamsStats.d.ts b/api/indices/dataStreamsStats.d.ts index cfcea78dc..3f4e47be9 100644 --- a/api/indices/dataStreamsStats.d.ts +++ b/api/indices/dataStreamsStats.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_DataStreamsStats from '../_types/indices.data_streams_stats' export interface Indices_DataStreamsStats_Request extends Global.Params { @@ -32,7 +32,7 @@ export interface Indices_DataStreamsStats_ResponseBody { backing_indices: number; data_stream_count: number; data_streams: Indices_DataStreamsStats.DataStreamsStatsItem[]; - total_store_size_bytes: Common.Bytes; - total_store_sizes?: Common.StorageSize; + total_store_size_bytes: Common.ByteCount; + total_store_sizes?: Common.HumanReadableByteCount; } diff --git a/api/indices/delete.d.ts b/api/indices/delete.d.ts index ed71002a7..61d7c9e64 100644 --- a/api/indices/delete.d.ts +++ b/api/indices/delete.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Delete_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/deleteAlias.d.ts b/api/indices/deleteAlias.d.ts index 973cf23a6..bb6f57493 100644 --- a/api/indices/deleteAlias.d.ts +++ b/api/indices/deleteAlias.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_DeleteAlias_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/indices/deleteDataStream.d.ts b/api/indices/deleteDataStream.d.ts index 6d4fa1ab1..1197ee7dd 100644 --- a/api/indices/deleteDataStream.d.ts +++ b/api/indices/deleteDataStream.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_DeleteDataStream_Request extends Global.Params { name: Common.DataStreamNames; diff --git a/api/indices/deleteIndexTemplate.d.ts b/api/indices/deleteIndexTemplate.d.ts index f08bc9915..fcf4ad7a8 100644 --- a/api/indices/deleteIndexTemplate.d.ts +++ b/api/indices/deleteIndexTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_DeleteIndexTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/indices/deleteTemplate.d.ts b/api/indices/deleteTemplate.d.ts index ba68c2172..c707268ad 100644 --- a/api/indices/deleteTemplate.d.ts +++ b/api/indices/deleteTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_DeleteTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/indices/exists.d.ts b/api/indices/exists.d.ts index 7224129f2..787489e4c 100644 --- a/api/indices/exists.d.ts +++ b/api/indices/exists.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Exists_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/existsAlias.d.ts b/api/indices/existsAlias.d.ts index d1a96734e..d283bb68e 100644 --- a/api/indices/existsAlias.d.ts +++ b/api/indices/existsAlias.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_ExistsAlias_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/existsIndexTemplate.d.ts b/api/indices/existsIndexTemplate.d.ts index bbf112cc1..721ce2128 100644 --- a/api/indices/existsIndexTemplate.d.ts +++ b/api/indices/existsIndexTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_ExistsIndexTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/indices/existsTemplate.d.ts b/api/indices/existsTemplate.d.ts index b1d0b8825..71a8c92b3 100644 --- a/api/indices/existsTemplate.d.ts +++ b/api/indices/existsTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_ExistsTemplate_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/indices/flush.d.ts b/api/indices/flush.d.ts index 4938b910a..a8efcfb4c 100644 --- a/api/indices/flush.d.ts +++ b/api/indices/flush.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Flush_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/forcemerge.d.ts b/api/indices/forcemerge.d.ts index bedd047fc..f553cd566 100644 --- a/api/indices/forcemerge.d.ts +++ b/api/indices/forcemerge.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Forcemerge_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/get.d.ts b/api/indices/get.d.ts index 4204542b7..7efc94d2b 100644 --- a/api/indices/get.d.ts +++ b/api/indices/get.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_Get_Request extends Global.Params { diff --git a/api/indices/getAlias.d.ts b/api/indices/getAlias.d.ts index 47439a3a7..9adc08474 100644 --- a/api/indices/getAlias.d.ts +++ b/api/indices/getAlias.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_GetAlias from '../_types/indices.get_alias' export interface Indices_GetAlias_Request extends Global.Params { diff --git a/api/indices/getDataStream.d.ts b/api/indices/getDataStream.d.ts index eb3864331..b3190fc9c 100644 --- a/api/indices/getDataStream.d.ts +++ b/api/indices/getDataStream.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_GetDataStream_Request extends Global.Params { diff --git a/api/indices/getFieldMapping.d.ts b/api/indices/getFieldMapping.d.ts index 153b84ee1..55cc186ea 100644 --- a/api/indices/getFieldMapping.d.ts +++ b/api/indices/getFieldMapping.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_GetFieldMapping from '../_types/indices.get_field_mapping' export interface Indices_GetFieldMapping_Request extends Global.Params { diff --git a/api/indices/getIndexTemplate.d.ts b/api/indices/getIndexTemplate.d.ts index d7147ceb4..3bd152f62 100644 --- a/api/indices/getIndexTemplate.d.ts +++ b/api/indices/getIndexTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_GetIndexTemplate from '../_types/indices.get_index_template' export interface Indices_GetIndexTemplate_Request extends Global.Params { diff --git a/api/indices/getMapping.d.ts b/api/indices/getMapping.d.ts index 242f34714..aafbec4a7 100644 --- a/api/indices/getMapping.d.ts +++ b/api/indices/getMapping.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_GetMapping from '../_types/indices.get_mapping' export interface Indices_GetMapping_Request extends Global.Params { diff --git a/api/indices/getSettings.d.ts b/api/indices/getSettings.d.ts index 6505a78c6..13c1af4ff 100644 --- a/api/indices/getSettings.d.ts +++ b/api/indices/getSettings.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_GetSettings_Request extends Global.Params { diff --git a/api/indices/getTemplate.d.ts b/api/indices/getTemplate.d.ts index 93746e935..4ff8d1fc1 100644 --- a/api/indices/getTemplate.d.ts +++ b/api/indices/getTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_GetTemplate_Request extends Global.Params { diff --git a/api/indices/getUpgrade.d.ts b/api/indices/getUpgrade.d.ts index 59e63a085..df6eea862 100644 --- a/api/indices/getUpgrade.d.ts +++ b/api/indices/getUpgrade.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_GetUpgrade_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/open.d.ts b/api/indices/open.d.ts index b3871b865..d3cd824d3 100644 --- a/api/indices/open.d.ts +++ b/api/indices/open.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Open_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/putAlias.d.ts b/api/indices/putAlias.d.ts index fc5a6ce49..13eac36cf 100644 --- a/api/indices/putAlias.d.ts +++ b/api/indices/putAlias.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Common_QueryDsl from '../_types/_common.query_dsl' +import * as Global from '../_types/_global' export interface Indices_PutAlias_Request extends Global.Params { body?: Indices_PutAlias_RequestBody; diff --git a/api/indices/putIndexTemplate.d.ts b/api/indices/putIndexTemplate.d.ts index f48ae13c3..b93ce93c6 100644 --- a/api/indices/putIndexTemplate.d.ts +++ b/api/indices/putIndexTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' import * as Indices_PutIndexTemplate from '../_types/indices.put_index_template' diff --git a/api/indices/putMapping.d.ts b/api/indices/putMapping.d.ts index 02759cc63..484b1a5d7 100644 --- a/api/indices/putMapping.d.ts +++ b/api/indices/putMapping.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' import * as Common_Mapping from '../_types/_common.mapping' +import * as Global from '../_types/_global' export interface Indices_PutMapping_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/putSettings.d.ts b/api/indices/putSettings.d.ts index 9bd56cc70..8a3986bfd 100644 --- a/api/indices/putSettings.d.ts +++ b/api/indices/putSettings.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' -import * as Common from '../_types/_common' export interface Indices_PutSettings_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/putTemplate.d.ts b/api/indices/putTemplate.d.ts index c5c993851..20e53ced8 100644 --- a/api/indices/putTemplate.d.ts +++ b/api/indices/putTemplate.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' -import * as Indices_Common from '../_types/indices._common' import * as Common_Mapping from '../_types/_common.mapping' +import * as Global from '../_types/_global' +import * as Indices_Common from '../_types/indices._common' export interface Indices_PutTemplate_Request extends Global.Params { body: Indices_PutTemplate_RequestBody; diff --git a/api/indices/recovery.d.ts b/api/indices/recovery.d.ts index 7236c3bab..4def83bf6 100644 --- a/api/indices/recovery.d.ts +++ b/api/indices/recovery.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Recovery from '../_types/indices.recovery' export interface Indices_Recovery_Request extends Global.Params { diff --git a/api/indices/refresh.d.ts b/api/indices/refresh.d.ts index 4d891ea19..7f714f455 100644 --- a/api/indices/refresh.d.ts +++ b/api/indices/refresh.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Refresh_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/resolveIndex.d.ts b/api/indices/resolveIndex.d.ts index a5117e865..035691868 100644 --- a/api/indices/resolveIndex.d.ts +++ b/api/indices/resolveIndex.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_ResolveIndex from '../_types/indices.resolve_index' export interface Indices_ResolveIndex_Request extends Global.Params { diff --git a/api/indices/rollover.d.ts b/api/indices/rollover.d.ts index ba9a415de..95d2115af 100644 --- a/api/indices/rollover.d.ts +++ b/api/indices/rollover.d.ts @@ -15,11 +15,11 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Common_Mapping from '../_types/_common.mapping' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' import * as Indices_Rollover from '../_types/indices.rollover' -import * as Common_Mapping from '../_types/_common.mapping' export interface Indices_Rollover_Request extends Global.Params { alias: Common.IndexAlias; diff --git a/api/indices/segments.d.ts b/api/indices/segments.d.ts index 949fbed4e..db65af355 100644 --- a/api/indices/segments.d.ts +++ b/api/indices/segments.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Segments from '../_types/indices.segments' export interface Indices_Segments_Request extends Global.Params { diff --git a/api/indices/shardStores.d.ts b/api/indices/shardStores.d.ts index 597cc3a57..f2a22753f 100644 --- a/api/indices/shardStores.d.ts +++ b/api/indices/shardStores.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_ShardStores from '../_types/indices.shard_stores' export interface Indices_ShardStores_Request extends Global.Params { @@ -24,7 +24,7 @@ export interface Indices_ShardStores_Request extends Global.Params { expand_wildcards?: Common.ExpandWildcards; ignore_unavailable?: boolean; index?: Common.Indices; - status?: Indices_ShardStores.ShardStoreStatus | Indices_ShardStores.ShardStoreStatus[]; + status?: Indices_ShardStores.Status | Indices_ShardStores.Status[]; } export interface Indices_ShardStores_Response extends ApiResponse { diff --git a/api/indices/shrink.d.ts b/api/indices/shrink.d.ts index 70434e236..93b7a263b 100644 --- a/api/indices/shrink.d.ts +++ b/api/indices/shrink.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_Shrink_Request extends Global.Params { diff --git a/api/indices/simulateIndexTemplate.d.ts b/api/indices/simulateIndexTemplate.d.ts index b2077f6af..1d8d29146 100644 --- a/api/indices/simulateIndexTemplate.d.ts +++ b/api/indices/simulateIndexTemplate.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' import * as Indices_PutIndexTemplate from '../_types/indices.put_index_template' diff --git a/api/indices/simulateTemplate.d.ts b/api/indices/simulateTemplate.d.ts index bc2602135..12daa01e5 100644 --- a/api/indices/simulateTemplate.d.ts +++ b/api/indices/simulateTemplate.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' -import * as Common from '../_types/_common' import * as Indices_SimulateTemplate from '../_types/indices.simulate_template' export interface Indices_SimulateTemplate_Request extends Global.Params { diff --git a/api/indices/split.d.ts b/api/indices/split.d.ts index 5ee31b351..5cc1a0d77 100644 --- a/api/indices/split.d.ts +++ b/api/indices/split.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' export interface Indices_Split_Request extends Global.Params { diff --git a/api/indices/stats.d.ts b/api/indices/stats.d.ts index 27ce8cf22..4968b487a 100644 --- a/api/indices/stats.d.ts +++ b/api/indices/stats.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Stats from '../_types/indices.stats' export interface Indices_Stats_Request extends Global.Params { @@ -30,7 +30,7 @@ export interface Indices_Stats_Request extends Global.Params { include_unloaded_segments?: boolean; index?: Common.Indices; level?: Common.Level; - metric?: Common.Metrics; + metric?: Indices_Stats.Metric | Indices_Stats.Metric[]; } export interface Indices_Stats_Response extends ApiResponse { diff --git a/api/indices/updateAliases.d.ts b/api/indices/updateAliases.d.ts index 31aaee4c9..0bc357f60 100644 --- a/api/indices/updateAliases.d.ts +++ b/api/indices/updateAliases.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_UpdateAliases from '../_types/indices.update_aliases' export interface Indices_UpdateAliases_Request extends Global.Params { diff --git a/api/indices/upgrade.d.ts b/api/indices/upgrade.d.ts index 6cfa38b6a..3f480c46a 100644 --- a/api/indices/upgrade.d.ts +++ b/api/indices/upgrade.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Indices_Upgrade_Request extends Global.Params { allow_no_indices?: boolean; diff --git a/api/indices/validateQuery.d.ts b/api/indices/validateQuery.d.ts index 3a6e56940..f9c3990e1 100644 --- a/api/indices/validateQuery.d.ts +++ b/api/indices/validateQuery.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' -import * as Common_QueryDsl from '../_types/_common.query_dsl' import * as Common from '../_types/_common' +import * as Common_QueryDsl from '../_types/_common.query_dsl' +import * as Global from '../_types/_global' import * as Indices_ValidateQuery from '../_types/indices.validate_query' export interface Indices_ValidateQuery_Request extends Global.Params { diff --git a/api/ingest/deletePipeline.d.ts b/api/ingest/deletePipeline.d.ts index ac8a8ca69..2459dc956 100644 --- a/api/ingest/deletePipeline.d.ts +++ b/api/ingest/deletePipeline.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Ingest_DeletePipeline_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/ingest/getPipeline.d.ts b/api/ingest/getPipeline.d.ts index b52e757e8..4f181544f 100644 --- a/api/ingest/getPipeline.d.ts +++ b/api/ingest/getPipeline.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Ingest_Common from '../_types/ingest._common' export interface Ingest_GetPipeline_Request extends Global.Params { diff --git a/api/ingest/putPipeline.d.ts b/api/ingest/putPipeline.d.ts index c1f37b551..a2918cc0b 100644 --- a/api/ingest/putPipeline.d.ts +++ b/api/ingest/putPipeline.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Ingest_Common from '../_types/ingest._common' export interface Ingest_PutPipeline_Request extends Global.Params { diff --git a/api/ingest/simulate.d.ts b/api/ingest/simulate.d.ts index 0725b85b7..a122a4a81 100644 --- a/api/ingest/simulate.d.ts +++ b/api/ingest/simulate.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' -import * as Ingest_Simulate from '../_types/ingest.simulate' +import * as Global from '../_types/_global' import * as Ingest_Common from '../_types/ingest._common' +import * as Ingest_Simulate from '../_types/ingest.simulate' export interface Ingest_Simulate_Request extends Global.Params { body: Ingest_Simulate_RequestBody; diff --git a/api/ism/_api.js b/api/ism/_api.js new file mode 100644 index 000000000..e1b3017ac --- /dev/null +++ b/api/ism/_api.js @@ -0,0 +1,61 @@ +/* + * 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-Ism */ + +function IsmApi(bindObj) { + this.addPolicy = require('./addPolicy').bind(bindObj); + this.changePolicy = require('./changePolicy').bind(bindObj); + this.deletePolicy = require('./deletePolicy').bind(bindObj); + this.existsPolicy = require('./existsPolicy').bind(bindObj); + this.explainPolicy = require('./explainPolicy').bind(bindObj); + this.getPolicies = require('./getPolicies').bind(bindObj); + this.getPolicy = require('./getPolicy').bind(bindObj); + this.putPolicies = require('./putPolicies').bind(bindObj); + this.putPolicy = require('./putPolicy').bind(bindObj); + this.refreshSearchAnalyzers = require('./refreshSearchAnalyzers').bind(bindObj); + this.removePolicy = require('./removePolicy').bind(bindObj); + this.retryIndex = require('./retryIndex').bind(bindObj); + + // Deprecated: Use addPolicy instead. + this.add_policy = require('./addPolicy').bind(bindObj); + // Deprecated: Use changePolicy instead. + this.change_policy = require('./changePolicy').bind(bindObj); + // Deprecated: Use deletePolicy instead. + this.delete_policy = require('./deletePolicy').bind(bindObj); + // Deprecated: Use existsPolicy instead. + this.exists_policy = require('./existsPolicy').bind(bindObj); + // Deprecated: Use explainPolicy instead. + this.explain_policy = require('./explainPolicy').bind(bindObj); + // Deprecated: Use getPolicies instead. + this.get_policies = require('./getPolicies').bind(bindObj); + // Deprecated: Use getPolicy instead. + this.get_policy = require('./getPolicy').bind(bindObj); + // Deprecated: Use putPolicies instead. + this.put_policies = require('./putPolicies').bind(bindObj); + // Deprecated: Use putPolicy instead. + this.put_policy = require('./putPolicy').bind(bindObj); + // Deprecated: Use refreshSearchAnalyzers instead. + this.refresh_search_analyzers = require('./refreshSearchAnalyzers').bind(bindObj); + // Deprecated: Use removePolicy instead. + this.remove_policy = require('./removePolicy').bind(bindObj); + // Deprecated: Use retryIndex instead. + this.retry_index = require('./retryIndex').bind(bindObj); +} + +module.exports = IsmApi; diff --git a/api/ism/addPolicy.d.ts b/api/ism/addPolicy.d.ts new file mode 100644 index 000000000..54de112c4 --- /dev/null +++ b/api/ism/addPolicy.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 Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_AddPolicy_Request extends Global.Params { + body?: Ism_Common.AddPolicyRequest; + index?: Common.IndexName; +} + +export interface Ism_AddPolicy_Response extends ApiResponse { + body: Ism_AddPolicy_ResponseBody; +} + +export type Ism_AddPolicy_ResponseBody = Ism_Common.AddPolicyResponse + diff --git a/api/ism/addPolicy.js b/api/ism/addPolicy.js new file mode 100644 index 000000000..c9b4505b9 --- /dev/null +++ b/api/ism/addPolicy.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 } = require('../utils'); + +/** + * Adds a policy to an index. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy - ism.add_policy} + * + * @memberOf API-Ism + * + * @param {object} [params] + * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * @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 addPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = ['/_plugins/_ism/add/', index].filter(c => c).join('').replace('//', '/'); + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = addPolicyFunc; diff --git a/api/ism/changePolicy.d.ts b/api/ism/changePolicy.d.ts new file mode 100644 index 000000000..ecaf87ea0 --- /dev/null +++ b/api/ism/changePolicy.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 Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_ChangePolicy_Request extends Global.Params { + body?: Ism_Common.ChangePolicyRequest; + index?: Common.IndexName; +} + +export interface Ism_ChangePolicy_Response extends ApiResponse { + body: Ism_ChangePolicy_ResponseBody; +} + +export type Ism_ChangePolicy_ResponseBody = Ism_Common.ChangePolicyResponse + diff --git a/api/ism/changePolicy.js b/api/ism/changePolicy.js new file mode 100644 index 000000000..aa5026d7d --- /dev/null +++ b/api/ism/changePolicy.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 } = require('../utils'); + +/** + * Updates the managed index policy to a new policy. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy - ism.change_policy} + * + * @memberOf API-Ism + * + * @param {object} [params] + * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * @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 changePolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = ['/_plugins/_ism/change_policy/', index].filter(c => c).join('').replace('//', '/'); + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = changePolicyFunc; diff --git a/api/ism/deletePolicy.d.ts b/api/ism/deletePolicy.d.ts new file mode 100644 index 000000000..85658ceca --- /dev/null +++ b/api/ism/deletePolicy.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_DeletePolicy_Request extends Global.Params { + policy_id: string; +} + +export interface Ism_DeletePolicy_Response extends ApiResponse { + body: Ism_DeletePolicy_ResponseBody; +} + +export type Ism_DeletePolicy_ResponseBody = Ism_Common.DeletePolicyResponse + diff --git a/api/ism/deletePolicy.js b/api/ism/deletePolicy.js new file mode 100644 index 000000000..b711d6f26 --- /dev/null +++ b/api/ism/deletePolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Deletes a policy. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#delete-policy - ism.delete_policy} + * + * @memberOf API-Ism + * + * @param {object} params + * @param {string} params.policy_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 deletePolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_id == null) return handleMissingParam('policy_id', this, callback); + + let { body, policy_id, ...querystring } = params; + policy_id = parsePathParam(policy_id); + + const path = '/_plugins/_ism/policies/' + policy_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deletePolicyFunc; diff --git a/api/ism/existsPolicy.d.ts b/api/ism/existsPolicy.d.ts new file mode 100644 index 000000000..cf91ff54f --- /dev/null +++ b/api/ism/existsPolicy.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 Ism_ExistsPolicy_Request extends Global.Params { + policy_id: string; +} + +export interface Ism_ExistsPolicy_Response extends ApiResponse { + body: Ism_ExistsPolicy_ResponseBody; +} + +export type Ism_ExistsPolicy_ResponseBody = any + diff --git a/api/ism/existsPolicy.js b/api/ism/existsPolicy.js new file mode 100644 index 000000000..b272081f3 --- /dev/null +++ b/api/ism/existsPolicy.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 whether the policy exists. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy - ism.exists_policy} + * + * @memberOf API-Ism + * + * @param {object} params + * @param {string} params.policy_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 existsPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_id == null) return handleMissingParam('policy_id', this, callback); + + let { body, policy_id, ...querystring } = params; + policy_id = parsePathParam(policy_id); + + const path = '/_plugins/_ism/policies/' + policy_id; + const method = 'HEAD'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = existsPolicyFunc; diff --git a/api/ism/explainPolicy.d.ts b/api/ism/explainPolicy.d.ts new file mode 100644 index 000000000..759965e03 --- /dev/null +++ b/api/ism/explainPolicy.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_ExplainPolicy_Request extends Global.Params { + body?: Ism_ExplainPolicy_RequestBody; + index?: Common.IndexName; +} + +export type Ism_ExplainPolicy_RequestBody = any + +export interface Ism_ExplainPolicy_Response extends ApiResponse { + body: Ism_ExplainPolicy_ResponseBody; +} + +export type Ism_ExplainPolicy_ResponseBody = Ism_Common.ExplainIndexResponse + diff --git a/api/ism/explainPolicy.js b/api/ism/explainPolicy.js new file mode 100644 index 000000000..1218c0da8 --- /dev/null +++ b/api/ism/explainPolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam } = require('../utils'); + +/** + * Gets the currently applied policy on indices. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index - ism.explain_policy} + * + * @memberOf API-Ism + * + * @param {object} [params] + * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * @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 explainPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = ['/_plugins/_ism/explain/', index].filter(c => c).join('').replace('//', '/'); + const method = body ? 'POST' : 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = explainPolicyFunc; diff --git a/api/ism/getPolicies.d.ts b/api/ism/getPolicies.d.ts new file mode 100644 index 000000000..82629f120 --- /dev/null +++ b/api/ism/getPolicies.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 Ism_Common from '../_types/ism._common' + +export type Ism_GetPolicies_Request = Global.Params & Record + +export interface Ism_GetPolicies_Response extends ApiResponse { + body: Ism_GetPolicies_ResponseBody; +} + +export type Ism_GetPolicies_ResponseBody = Ism_Common.GetPoliciesResponse + diff --git a/api/ism/getPolicies.js b/api/ism/getPolicies.js new file mode 100644 index 000000000..377a0804e --- /dev/null +++ b/api/ism/getPolicies.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'); + +/** + * Gets the policies. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy - ism.get_policies} + * + * @memberOf API-Ism + * + * @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 getPoliciesFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_ism/policies'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getPoliciesFunc; diff --git a/api/ism/getPolicy.d.ts b/api/ism/getPolicy.d.ts new file mode 100644 index 000000000..d5efb4141 --- /dev/null +++ b/api/ism/getPolicy.d.ts @@ -0,0 +1,30 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_GetPolicy_Request extends Global.Params { + policy_id: string; +} + +export interface Ism_GetPolicy_Response extends ApiResponse { + body: Ism_GetPolicy_ResponseBody; +} + +export type Ism_GetPolicy_ResponseBody = Ism_Common.GetPolicyResponse + diff --git a/api/ism/getPolicy.js b/api/ism/getPolicy.js new file mode 100644 index 000000000..b0ad17fdb --- /dev/null +++ b/api/ism/getPolicy.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Gets a policy. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy - ism.get_policy} + * + * @memberOf API-Ism + * + * @param {object} params + * @param {string} params.policy_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 getPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_id == null) return handleMissingParam('policy_id', this, callback); + + let { body, policy_id, ...querystring } = params; + policy_id = parsePathParam(policy_id); + + const path = '/_plugins/_ism/policies/' + policy_id; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getPolicyFunc; diff --git a/api/ism/putPolicies.d.ts b/api/ism/putPolicies.d.ts new file mode 100644 index 000000000..94768ee8f --- /dev/null +++ b/api/ism/putPolicies.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_PutPolicies_Request extends Global.Params { + body?: Ism_Common.PutPolicyRequest; + if_primary_term?: number; + if_seq_no?: Common.SequenceNumber; + policyID: string; +} + +export interface Ism_PutPolicies_Response extends ApiResponse { + body: Ism_PutPolicies_ResponseBody; +} + +export type Ism_PutPolicies_ResponseBody = Ism_Common.PutPolicyResponse + diff --git a/api/ism/putPolicies.js b/api/ism/putPolicies.js new file mode 100644 index 000000000..2de2ef3db --- /dev/null +++ b/api/ism/putPolicies.js @@ -0,0 +1,51 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, handleMissingParam } = require('../utils'); + +/** + * Gets the policies. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy - ism.put_policies} + * + * @memberOf API-Ism + * + * @param {object} params + * @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.policyID + * @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 putPoliciesFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policyID == null) return handleMissingParam('policyID', this, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_ism/policies'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putPoliciesFunc; diff --git a/api/ism/putPolicy.d.ts b/api/ism/putPolicy.d.ts new file mode 100644 index 000000000..4c0c52f0e --- /dev/null +++ b/api/ism/putPolicy.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_PutPolicy_Request extends Global.Params { + body?: Ism_Common.PutPolicyRequest; + if_primary_term?: number; + if_seq_no?: Common.SequenceNumber; + policy_id: string; +} + +export interface Ism_PutPolicy_Response extends ApiResponse { + body: Ism_PutPolicy_ResponseBody; +} + +export type Ism_PutPolicy_ResponseBody = Ism_Common.PutPolicyResponse + diff --git a/api/ism/putPolicy.js b/api/ism/putPolicy.js new file mode 100644 index 000000000..01587d444 --- /dev/null +++ b/api/ism/putPolicy.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, handleMissingParam } = require('../utils'); + +/** + * Creates or updates a policy. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy - ism.put_policy} + * + * @memberOf API-Ism + * + * @param {object} params + * @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.policy_id + * @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 putPolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.policy_id == null) return handleMissingParam('policy_id', this, callback); + + let { body, policy_id, ...querystring } = params; + policy_id = parsePathParam(policy_id); + + const path = '/_plugins/_ism/policies/' + policy_id; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = putPolicyFunc; diff --git a/api/ism/refreshSearchAnalyzers.d.ts b/api/ism/refreshSearchAnalyzers.d.ts new file mode 100644 index 000000000..eb1810fc5 --- /dev/null +++ b/api/ism/refreshSearchAnalyzers.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 Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_RefreshSearchAnalyzers_Request extends Global.Params { + index: Common.IndexName; +} + +export interface Ism_RefreshSearchAnalyzers_Response extends ApiResponse { + body: Ism_RefreshSearchAnalyzers_ResponseBody; +} + +export type Ism_RefreshSearchAnalyzers_ResponseBody = Ism_Common.RefreshSearchAnalyzersResponse + diff --git a/api/ism/refreshSearchAnalyzers.js b/api/ism/refreshSearchAnalyzers.js new file mode 100644 index 000000000..7874fe134 --- /dev/null +++ b/api/ism/refreshSearchAnalyzers.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'); + +/** + * Refresh search analyzers in real time. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ - ism.refresh_search_analyzers} + * + * @memberOf API-Ism + * + * @param {object} params + * @param {string} params.index - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * + * @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 refreshSearchAnalyzersFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_refresh_search_analyzers/' + index; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = refreshSearchAnalyzersFunc; diff --git a/api/ism/removePolicy.d.ts b/api/ism/removePolicy.d.ts new file mode 100644 index 000000000..dae225849 --- /dev/null +++ b/api/ism/removePolicy.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 Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_RemovePolicy_Request extends Global.Params { + index?: Common.IndexName; +} + +export interface Ism_RemovePolicy_Response extends ApiResponse { + body: Ism_RemovePolicy_ResponseBody; +} + +export type Ism_RemovePolicy_ResponseBody = Ism_Common.RemovePolicyResponse + diff --git a/api/ism/removePolicy.js b/api/ism/removePolicy.js new file mode 100644 index 000000000..d29f5dbc0 --- /dev/null +++ b/api/ism/removePolicy.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'); + +/** + * Removes a policy from an index. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy - ism.remove_policy} + * + * @memberOf API-Ism + * + * @param {object} [params] + * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * + * @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 removePolicyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = ['/_plugins/_ism/remove/', index].filter(c => c).join('').replace('//', '/'); + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = removePolicyFunc; diff --git a/api/ism/retryIndex.d.ts b/api/ism/retryIndex.d.ts new file mode 100644 index 000000000..e95d558b6 --- /dev/null +++ b/api/ism/retryIndex.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 Global from '../_types/_global' +import * as Ism_Common from '../_types/ism._common' + +export interface Ism_RetryIndex_Request extends Global.Params { + body?: Ism_Common.RetryIndexRequest; + index?: Common.IndexName; +} + +export interface Ism_RetryIndex_Response extends ApiResponse { + body: Ism_RetryIndex_ResponseBody; +} + +export type Ism_RetryIndex_ResponseBody = Ism_Common.RetryIndexResponse + diff --git a/api/ism/retryIndex.js b/api/ism/retryIndex.js new file mode 100644 index 000000000..4ead79c7d --- /dev/null +++ b/api/ism/retryIndex.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 } = require('../utils'); + +/** + * Retry the failed action for an index. + *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index - ism.retry_index} + * + * @memberOf API-Ism + * + * @param {object} [params] + * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * @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 retryIndexFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = ['/_plugins/_ism/retry/', index].filter(c => c).join('').replace('//', '/'); + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = retryIndexFunc; diff --git a/api/knn/searchModels.d.ts b/api/knn/searchModels.d.ts index 84151af89..520163587 100644 --- a/api/knn/searchModels.d.ts +++ b/api/knn/searchModels.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Knn_Common from '../_types/knn._common' -import * as Common from '../_types/_common' export interface Knn_SearchModels_Request extends Global.Params { _source?: string[]; @@ -45,7 +45,7 @@ export interface Knn_SearchModels_Request extends Global.Params { q?: string; request_cache?: boolean; rest_total_hits_as_int?: boolean; - routing?: string[]; + routing?: Common.Routing; scroll?: Common.Duration; search_type?: Knn_Common.SearchType; seq_no_primary_term?: boolean; diff --git a/api/knn/searchModels.js b/api/knn/searchModels.js index 023b903fe..411103a5a 100644 --- a/api/knn/searchModels.js +++ b/api/knn/searchModels.js @@ -49,7 +49,7 @@ const { normalizeArguments } = require('../utils'); * @param {string} [params.q] - Query in the Lucene query string syntax. * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting. * @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 {array} [params.routing] - Comma-separated list of specific routing values. + * @param {string} [params.routing] - Comma-separated list of specific routing values. * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search. * @param {string} [params.search_type] - Search operation type. * @param {boolean} [params.seq_no_primary_term] - Specify whether to return sequence number and primary term of the last modification of each hit. diff --git a/api/knn/stats.d.ts b/api/knn/stats.d.ts index f6e315b62..c39c4d511 100644 --- a/api/knn/stats.d.ts +++ b/api/knn/stats.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Knn_Stats_Request extends Global.Params { node_id?: string[]; diff --git a/api/ml/_api.js b/api/ml/_api.js index 7ac3f3e4f..8b705a4f6 100644 --- a/api/ml/_api.js +++ b/api/ml/_api.js @@ -19,17 +19,27 @@ /** @namespace API-Ml */ function MlApi(bindObj) { + this.createConnector = require('./createConnector').bind(bindObj); + this.deleteAgent = require('./deleteAgent').bind(bindObj); + this.deleteConnector = require('./deleteConnector').bind(bindObj); this.deleteModel = require('./deleteModel').bind(bindObj); this.deleteModelGroup = require('./deleteModelGroup').bind(bindObj); this.deleteTask = require('./deleteTask').bind(bindObj); this.deployModel = require('./deployModel').bind(bindObj); this.getModelGroup = require('./getModelGroup').bind(bindObj); this.getTask = require('./getTask').bind(bindObj); + this.registerAgents = require('./registerAgents').bind(bindObj); this.registerModel = require('./registerModel').bind(bindObj); this.registerModelGroup = require('./registerModelGroup').bind(bindObj); this.searchModels = require('./searchModels').bind(bindObj); this.undeployModel = require('./undeployModel').bind(bindObj); + // Deprecated: Use createConnector instead. + this.create_connector = require('./createConnector').bind(bindObj); + // Deprecated: Use deleteAgent instead. + this.delete_agent = require('./deleteAgent').bind(bindObj); + // Deprecated: Use deleteConnector instead. + this.delete_connector = require('./deleteConnector').bind(bindObj); // Deprecated: Use deleteModel instead. this.delete_model = require('./deleteModel').bind(bindObj); // Deprecated: Use deleteModelGroup instead. @@ -42,6 +52,8 @@ function MlApi(bindObj) { this.get_model_group = require('./getModelGroup').bind(bindObj); // Deprecated: Use getTask instead. this.get_task = require('./getTask').bind(bindObj); + // Deprecated: Use registerAgents instead. + this.register_agents = require('./registerAgents').bind(bindObj); // Deprecated: Use registerModel instead. this.register_model = require('./registerModel').bind(bindObj); // Deprecated: Use registerModelGroup instead. diff --git a/api/ml/createConnector.d.ts b/api/ml/createConnector.d.ts new file mode 100644 index 000000000..f980036f9 --- /dev/null +++ b/api/ml/createConnector.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 Global from '../_types/_global' +import * as Ml_Common from '../_types/ml._common' + +export interface Ml_CreateConnector_Request extends Global.Params { + body?: Ml_Common.CreateConnectorRequest; +} + +export interface Ml_CreateConnector_Response extends ApiResponse { + body: Ml_CreateConnector_ResponseBody; +} + +export interface Ml_CreateConnector_ResponseBody { + connector_id?: string; +} + diff --git a/api/ml/createConnector.js b/api/ml/createConnector.js new file mode 100644 index 000000000..ae8c9186c --- /dev/null +++ b/api/ml/createConnector.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 standalone connector. + *
See Also: {@link undefined - ml.create_connector} + * + * @memberOf API-Ml + * + * @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 createConnectorFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_ml/connectors/_create'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createConnectorFunc; diff --git a/api/ml/deleteAgent.d.ts b/api/ml/deleteAgent.d.ts new file mode 100644 index 000000000..d7a978084 --- /dev/null +++ b/api/ml/deleteAgent.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 Ml_DeleteAgent_Request extends Global.Params { + agent_id: string; +} + +export interface Ml_DeleteAgent_Response extends ApiResponse { + body: Ml_DeleteAgent_ResponseBody; +} + +export type Ml_DeleteAgent_ResponseBody = Common.WriteResponseBase + diff --git a/api/ml/deleteAgent.js b/api/ml/deleteAgent.js new file mode 100644 index 000000000..2159eb095 --- /dev/null +++ b/api/ml/deleteAgent.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 an agent. + *
See Also: {@link undefined - ml.delete_agent} + * + * @memberOf API-Ml + * + * @param {object} params + * @param {string} params.agent_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 deleteAgentFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.agent_id == null) return handleMissingParam('agent_id', this, callback); + + let { body, agent_id, ...querystring } = params; + agent_id = parsePathParam(agent_id); + + const path = '/_plugins/_ml/agents/' + agent_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteAgentFunc; diff --git a/api/ml/deleteConnector.d.ts b/api/ml/deleteConnector.d.ts new file mode 100644 index 000000000..be960d485 --- /dev/null +++ b/api/ml/deleteConnector.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 Ml_DeleteConnector_Request extends Global.Params { + connector_id: string; +} + +export interface Ml_DeleteConnector_Response extends ApiResponse { + body: Ml_DeleteConnector_ResponseBody; +} + +export type Ml_DeleteConnector_ResponseBody = Common.WriteResponseBase + diff --git a/api/ml/deleteConnector.js b/api/ml/deleteConnector.js new file mode 100644 index 000000000..92c97f3f5 --- /dev/null +++ b/api/ml/deleteConnector.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 standalone connector. + *
See Also: {@link undefined - ml.delete_connector} + * + * @memberOf API-Ml + * + * @param {object} params + * @param {string} params.connector_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 deleteConnectorFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.connector_id == null) return handleMissingParam('connector_id', this, callback); + + let { body, connector_id, ...querystring } = params; + connector_id = parsePathParam(connector_id); + + const path = '/_plugins/_ml/connectors/' + connector_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteConnectorFunc; diff --git a/api/ml/deleteModel.d.ts b/api/ml/deleteModel.d.ts index b35a9405e..e9ed88f23 100644 --- a/api/ml/deleteModel.d.ts +++ b/api/ml/deleteModel.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Ml_DeleteModel_Request extends Global.Params { model_id: string; diff --git a/api/ml/deleteModelGroup.d.ts b/api/ml/deleteModelGroup.d.ts index 2cf347dbc..68bcb10e3 100644 --- a/api/ml/deleteModelGroup.d.ts +++ b/api/ml/deleteModelGroup.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Ml_DeleteModelGroup_Request extends Global.Params { model_group_id: string; diff --git a/api/ml/deleteTask.d.ts b/api/ml/deleteTask.d.ts index b3b68dc96..6d34f348d 100644 --- a/api/ml/deleteTask.d.ts +++ b/api/ml/deleteTask.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Ml_DeleteTask_Request extends Global.Params { task_id: string; diff --git a/api/ml/registerAgents.d.ts b/api/ml/registerAgents.d.ts new file mode 100644 index 000000000..0577cdd5f --- /dev/null +++ b/api/ml/registerAgents.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 Global from '../_types/_global' +import * as Ml_Common from '../_types/ml._common' + +export interface Ml_RegisterAgents_Request extends Global.Params { + body?: Ml_Common.RegisterAgentsRequest; +} + +export interface Ml_RegisterAgents_Response extends ApiResponse { + body: Ml_RegisterAgents_ResponseBody; +} + +export interface Ml_RegisterAgents_ResponseBody { + agent_id?: string; +} + diff --git a/api/ml/registerAgents.js b/api/ml/registerAgents.js new file mode 100644 index 000000000..3e32cb1b5 --- /dev/null +++ b/api/ml/registerAgents.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'); + +/** + * Register an agent. + *
See Also: {@link undefined - ml.register_agents} + * + * @memberOf API-Ml + * + * @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 registerAgentsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_ml/agents/_register'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = registerAgentsFunc; diff --git a/api/nodes/hotThreads.d.ts b/api/nodes/hotThreads.d.ts index 0a3d019a3..c78d81b17 100644 --- a/api/nodes/hotThreads.d.ts +++ b/api/nodes/hotThreads.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Nodes_Common from '../_types/nodes._common' export interface Nodes_HotThreads_Request extends Global.Params { diff --git a/api/nodes/info.d.ts b/api/nodes/info.d.ts index 26472a343..f867956ee 100644 --- a/api/nodes/info.d.ts +++ b/api/nodes/info.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Nodes_Info from '../_types/nodes.info' -import * as Common from '../_types/_common' export interface Nodes_Info_Request extends Global.Params { flat_settings?: boolean; diff --git a/api/nodes/reloadSecureSettings.d.ts b/api/nodes/reloadSecureSettings.d.ts index 2718df961..c1ac2bd5e 100644 --- a/api/nodes/reloadSecureSettings.d.ts +++ b/api/nodes/reloadSecureSettings.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Nodes_ReloadSecureSettings from '../_types/nodes.reload_secure_settings' export interface Nodes_ReloadSecureSettings_Request extends Global.Params { diff --git a/api/nodes/stats.d.ts b/api/nodes/stats.d.ts index 9e19042da..c650a6db8 100644 --- a/api/nodes/stats.d.ts +++ b/api/nodes/stats.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Nodes_Stats from '../_types/nodes.stats' export interface Nodes_Stats_Request extends Global.Params { diff --git a/api/nodes/usage.d.ts b/api/nodes/usage.d.ts index c4c59018b..1f27ab6da 100644 --- a/api/nodes/usage.d.ts +++ b/api/nodes/usage.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Nodes_Usage from '../_types/nodes.usage' -import * as Common from '../_types/_common' export interface Nodes_Usage_Request extends Global.Params { metric?: Nodes_Usage.Metric[]; diff --git a/api/remoteStore/restore.d.ts b/api/remoteStore/restore.d.ts index c21d31f11..9c5694857 100644 --- a/api/remoteStore/restore.d.ts +++ b/api/remoteStore/restore.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as RemoteStore_Common from '../_types/remote_store._common' export interface RemoteStore_Restore_Request extends Global.Params { diff --git a/api/rollups/delete.d.ts b/api/rollups/delete.d.ts index 0c269889b..9d371d5da 100644 --- a/api/rollups/delete.d.ts +++ b/api/rollups/delete.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Rollups_Delete_Request extends Global.Params { id: Common.Id; diff --git a/api/rollups/explain.d.ts b/api/rollups/explain.d.ts index 9bf3b0bd4..fceacb6e0 100644 --- a/api/rollups/explain.d.ts +++ b/api/rollups/explain.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Rollups_Common from '../_types/rollups._common' export interface Rollups_Explain_Request extends Global.Params { diff --git a/api/rollups/get.d.ts b/api/rollups/get.d.ts index 5f2d04c28..1d23b878d 100644 --- a/api/rollups/get.d.ts +++ b/api/rollups/get.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Rollups_Common from '../_types/rollups._common' export interface Rollups_Get_Request extends Global.Params { diff --git a/api/rollups/put.d.ts b/api/rollups/put.d.ts index ce36bfe35..5ab2c1a3b 100644 --- a/api/rollups/put.d.ts +++ b/api/rollups/put.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Rollups_Common from '../_types/rollups._common' -import * as Common from '../_types/_common' export interface Rollups_Put_Request extends Global.Params { body?: Rollups_Common.RollupEntity; diff --git a/api/rollups/start.d.ts b/api/rollups/start.d.ts index 417839699..083e68922 100644 --- a/api/rollups/start.d.ts +++ b/api/rollups/start.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Rollups_Start_Request extends Global.Params { id: Common.Id; diff --git a/api/rollups/stop.d.ts b/api/rollups/stop.d.ts index 65bc3f935..f16bf35b6 100644 --- a/api/rollups/stop.d.ts +++ b/api/rollups/stop.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Rollups_Stop_Request extends Global.Params { id: Common.Id; diff --git a/api/searchPipeline/delete.d.ts b/api/searchPipeline/delete.d.ts index cd1391575..7eef278e4 100644 --- a/api/searchPipeline/delete.d.ts +++ b/api/searchPipeline/delete.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface SearchPipeline_Delete_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/searchPipeline/get.d.ts b/api/searchPipeline/get.d.ts index a280093c2..08290e14a 100644 --- a/api/searchPipeline/get.d.ts +++ b/api/searchPipeline/get.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as SearchPipeline_Common from '../_types/search_pipeline._common' export interface SearchPipeline_Get_Request extends Global.Params { diff --git a/api/searchPipeline/put.d.ts b/api/searchPipeline/put.d.ts index 384524f98..224c4d875 100644 --- a/api/searchPipeline/put.d.ts +++ b/api/searchPipeline/put.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as SearchPipeline_Common from '../_types/search_pipeline._common' -import * as Common from '../_types/_common' export interface SearchPipeline_Put_Request extends Global.Params { body: SearchPipeline_Common.SearchPipelineStructure; diff --git a/api/security/_api.js b/api/security/_api.js index dde793fae..3c1721a3f 100644 --- a/api/security/_api.js +++ b/api/security/_api.js @@ -42,6 +42,7 @@ function SecurityApi(bindObj) { this.flushCache = require('./flushCache').bind(bindObj); this.generateOboToken = require('./generateOboToken').bind(bindObj); this.generateUserToken = require('./generateUserToken').bind(bindObj); + this.generateUserTokenLegacy = require('./generateUserTokenLegacy').bind(bindObj); this.getAccountDetails = require('./getAccountDetails').bind(bindObj); this.getActionGroup = require('./getActionGroup').bind(bindObj); this.getActionGroups = require('./getActionGroups').bind(bindObj); @@ -137,6 +138,8 @@ function SecurityApi(bindObj) { this.generate_obo_token = require('./generateOboToken').bind(bindObj); // Deprecated: Use generateUserToken instead. this.generate_user_token = require('./generateUserToken').bind(bindObj); + // Deprecated: Use generateUserTokenLegacy instead. + this.generate_user_token_legacy = require('./generateUserTokenLegacy').bind(bindObj); // Deprecated: Use getAccountDetails instead. this.get_account_details = require('./getAccountDetails').bind(bindObj); // Deprecated: Use getActionGroup instead. diff --git a/api/security/generateUserTokenLegacy.d.ts b/api/security/generateUserTokenLegacy.d.ts new file mode 100644 index 000000000..53187dad7 --- /dev/null +++ b/api/security/generateUserTokenLegacy.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 Security_GenerateUserTokenLegacy_Request extends Global.Params { + username: string; +} + +export interface Security_GenerateUserTokenLegacy_Response extends ApiResponse { + body: Security_GenerateUserTokenLegacy_ResponseBody; +} + +export type Security_GenerateUserTokenLegacy_ResponseBody = Record + diff --git a/api/security/generateUserTokenLegacy.js b/api/security/generateUserTokenLegacy.js new file mode 100644 index 000000000..6e002922a --- /dev/null +++ b/api/security/generateUserTokenLegacy.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'); + +/** + * Generates authorization token for the given user. Legacy API. Not Implemented. + *
See Also: {@link undefined - security.generate_user_token_legacy} + * + * @memberOf API-Security + * + * @param {object} params + * @param {string} params.username - The name of the user for whom an auth token is to be vended. + * + * @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 generateUserTokenLegacyFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.username == null) return handleMissingParam('username', this, callback); + + let { body, username, ...querystring } = params; + username = parsePathParam(username); + + const path = '/_plugins/_security/api/user/' + username + '/authtoken'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = generateUserTokenLegacyFunc; diff --git a/api/security/getAllCertificates.d.ts b/api/security/getAllCertificates.d.ts index de5d82780..aacf9c611 100644 --- a/api/security/getAllCertificates.d.ts +++ b/api/security/getAllCertificates.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_GetAllCertificates_Request extends Global.Params { diff --git a/api/security/getNodeCertificates.d.ts b/api/security/getNodeCertificates.d.ts index cff9c688f..e4bd4b0d6 100644 --- a/api/security/getNodeCertificates.d.ts +++ b/api/security/getNodeCertificates.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_GetNodeCertificates_Request extends Global.Params { diff --git a/api/snapshot/cleanupRepository.d.ts b/api/snapshot/cleanupRepository.d.ts index f8cb2c504..622f6d5db 100644 --- a/api/snapshot/cleanupRepository.d.ts +++ b/api/snapshot/cleanupRepository.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Snapshot_CleanupRepository from '../_types/snapshot.cleanup_repository' export interface Snapshot_CleanupRepository_Request extends Global.Params { diff --git a/api/snapshot/clone.d.ts b/api/snapshot/clone.d.ts index acc0213a5..d0d071a6e 100644 --- a/api/snapshot/clone.d.ts +++ b/api/snapshot/clone.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Snapshot_Clone_Request extends Global.Params { body: Snapshot_Clone_RequestBody; diff --git a/api/snapshot/create.d.ts b/api/snapshot/create.d.ts index 6a386b0d3..bebe5df2f 100644 --- a/api/snapshot/create.d.ts +++ b/api/snapshot/create.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Snapshot_Common from '../_types/snapshot._common' export interface Snapshot_Create_Request extends Global.Params { diff --git a/api/snapshot/createRepository.d.ts b/api/snapshot/createRepository.d.ts index 4e07b14f1..5323c2ea3 100644 --- a/api/snapshot/createRepository.d.ts +++ b/api/snapshot/createRepository.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Snapshot_Common from '../_types/snapshot._common' export interface Snapshot_CreateRepository_Request extends Global.Params { diff --git a/api/snapshot/delete.d.ts b/api/snapshot/delete.d.ts index f52cef298..a5c2d475c 100644 --- a/api/snapshot/delete.d.ts +++ b/api/snapshot/delete.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Snapshot_Delete_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/snapshot/deleteRepository.d.ts b/api/snapshot/deleteRepository.d.ts index 34766e16c..cf2e00660 100644 --- a/api/snapshot/deleteRepository.d.ts +++ b/api/snapshot/deleteRepository.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Snapshot_DeleteRepository_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/snapshot/get.d.ts b/api/snapshot/get.d.ts index 2dd385c72..b9f54a22c 100644 --- a/api/snapshot/get.d.ts +++ b/api/snapshot/get.d.ts @@ -15,10 +15,10 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' -import * as Snapshot_Get from '../_types/snapshot.get' +import * as Global from '../_types/_global' import * as Snapshot_Common from '../_types/snapshot._common' +import * as Snapshot_Get from '../_types/snapshot.get' export interface Snapshot_Get_Request extends Global.Params { cluster_manager_timeout?: Common.Duration; diff --git a/api/snapshot/getRepository.d.ts b/api/snapshot/getRepository.d.ts index f84f0a1a8..a6c42820b 100644 --- a/api/snapshot/getRepository.d.ts +++ b/api/snapshot/getRepository.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Snapshot_Common from '../_types/snapshot._common' export interface Snapshot_GetRepository_Request extends Global.Params { diff --git a/api/snapshot/restore.d.ts b/api/snapshot/restore.d.ts index 4152159df..f3a2fb810 100644 --- a/api/snapshot/restore.d.ts +++ b/api/snapshot/restore.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Indices_Common from '../_types/indices._common' import * as Snapshot_Restore from '../_types/snapshot.restore' diff --git a/api/snapshot/status.d.ts b/api/snapshot/status.d.ts index 5e2cfa7f6..decdecc68 100644 --- a/api/snapshot/status.d.ts +++ b/api/snapshot/status.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Snapshot_Common from '../_types/snapshot._common' export interface Snapshot_Status_Request extends Global.Params { diff --git a/api/snapshot/verifyRepository.d.ts b/api/snapshot/verifyRepository.d.ts index 33863a1f4..b254ba705 100644 --- a/api/snapshot/verifyRepository.d.ts +++ b/api/snapshot/verifyRepository.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Snapshot_VerifyRepository from '../_types/snapshot.verify_repository' export interface Snapshot_VerifyRepository_Request extends Global.Params { diff --git a/api/tasks/cancel.d.ts b/api/tasks/cancel.d.ts index dbfdca4b0..147a2140b 100644 --- a/api/tasks/cancel.d.ts +++ b/api/tasks/cancel.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Tasks_Common from '../_types/tasks._common' export interface Tasks_Cancel_Request extends Global.Params { diff --git a/api/tasks/get.d.ts b/api/tasks/get.d.ts index 9dea35643..8090d4120 100644 --- a/api/tasks/get.d.ts +++ b/api/tasks/get.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Tasks_Common from '../_types/tasks._common' export interface Tasks_Get_Request extends Global.Params { @@ -32,7 +32,7 @@ export interface Tasks_Get_Response extends ApiResponse { export interface Tasks_Get_ResponseBody { completed: boolean; error?: Common.ErrorCause; - response?: Record; + response?: Tasks_Common.TaskResponse; task: Tasks_Common.TaskInfo; } diff --git a/api/tasks/list.d.ts b/api/tasks/list.d.ts index 7adf1ea9c..f9728c177 100644 --- a/api/tasks/list.d.ts +++ b/api/tasks/list.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Tasks_Common from '../_types/tasks._common' -import * as Common from '../_types/_common' export interface Tasks_List_Request extends Global.Params { actions?: string | string[]; diff --git a/api/transforms/delete.d.ts b/api/transforms/delete.d.ts index 822c64b4b..bb691130c 100644 --- a/api/transforms/delete.d.ts +++ b/api/transforms/delete.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Transforms_Delete_Request extends Global.Params { id: Common.Id; diff --git a/api/transforms/explain.d.ts b/api/transforms/explain.d.ts index 9a5770bbe..c63df56d4 100644 --- a/api/transforms/explain.d.ts +++ b/api/transforms/explain.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Transforms_Common from '../_types/transforms._common' export interface Transforms_Explain_Request extends Global.Params { diff --git a/api/transforms/get.d.ts b/api/transforms/get.d.ts index 3febb4ada..4015c2ebd 100644 --- a/api/transforms/get.d.ts +++ b/api/transforms/get.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' import * as Transforms_Common from '../_types/transforms._common' export interface Transforms_Get_Request extends Global.Params { diff --git a/api/transforms/preview.d.ts b/api/transforms/preview.d.ts index 68ee16c4e..f56bd38e4 100644 --- a/api/transforms/preview.d.ts +++ b/api/transforms/preview.d.ts @@ -18,7 +18,13 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' import * as Transforms_Common from '../_types/transforms._common' -export type Transforms_Preview_Request = Global.Params & Record +export interface Transforms_Preview_Request extends Global.Params { + body?: Transforms_Preview_RequestBody; +} + +export interface Transforms_Preview_RequestBody { + transform: Transforms_Common.Transform; +} export interface Transforms_Preview_Response extends ApiResponse { body: Transforms_Preview_ResponseBody; diff --git a/api/transforms/preview.js b/api/transforms/preview.js index 97b3a8d06..8a54e514f 100644 --- a/api/transforms/preview.js +++ b/api/transforms/preview.js @@ -24,7 +24,9 @@ const { normalizeArguments } = require('../utils'); * * @memberOf API-Transforms * - * @param {object} [params] - (Unused) + * @param {object} [params] + * @param {object} [params.body] + * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response * @@ -36,7 +38,7 @@ function previewFunc(params, options, callback) { let { body, ...querystring } = params; const path = '/_plugins/_transform/_preview'; - const method = 'GET'; + const method = 'POST'; body = body || ''; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/transforms/put.d.ts b/api/transforms/put.d.ts index bcd8db800..46202c154 100644 --- a/api/transforms/put.d.ts +++ b/api/transforms/put.d.ts @@ -15,9 +15,9 @@ */ import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' import * as Global from '../_types/_global' import * as Transforms_Common from '../_types/transforms._common' -import * as Common from '../_types/_common' export interface Transforms_Put_Request extends Global.Params { body?: Transforms_Common.Transform; diff --git a/api/transforms/start.d.ts b/api/transforms/start.d.ts index 8c32ba6e8..093f90273 100644 --- a/api/transforms/start.d.ts +++ b/api/transforms/start.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Transforms_Start_Request extends Global.Params { id: Common.Id; diff --git a/api/transforms/stop.d.ts b/api/transforms/stop.d.ts index 7862bfb2f..8377b7106 100644 --- a/api/transforms/stop.d.ts +++ b/api/transforms/stop.d.ts @@ -15,8 +15,8 @@ */ import { ApiResponse } from '../../lib/Transport' -import * as Global from '../_types/_global' import * as Common from '../_types/_common' +import * as Global from '../_types/_global' export interface Transforms_Stop_Request extends Global.Params { id: Common.Id; diff --git a/api_generator/src/renderers/render_types/TypesFileRenderder.ts b/api_generator/src/renderers/render_types/TypesFileRenderder.ts index caf2714e9..ed256b992 100644 --- a/api_generator/src/renderers/render_types/TypesFileRenderder.ts +++ b/api_generator/src/renderers/render_types/TypesFileRenderder.ts @@ -38,9 +38,11 @@ export default class TypesFileRenderder extends BaseRenderer { const declarative = this.#is_interface(definition) ? `interface ${name}` : `type ${name} =` return { declarative, definition } }), - imports: Array.from(con.referenced_containers).map(container => { - return { path: con.import_path(container), name: container.import_name } - }) + imports: Array.from(con.referenced_containers) + .sort((a, b) => a.import_name.localeCompare(b.import_name)) + .map(container => { + return { path: con.import_path(container), name: container.import_name } + }) } } @@ -66,34 +68,35 @@ export default class TypesFileRenderder extends BaseRenderer { if (schema.type === 'null') return 'undefined' if (Array.isArray(schema.type)) return schema.type.map(type => this.#render_schema({ type } satisfies Schema)).join(' | ') if (schema.type != null && schema.type !== 'object') throw new Error(`Unhandled schema type: ${(schema as any).type}`) - if (schema.oneOf != null || schema.anyOf != null) return this.#render_union_obj(schema) - if (schema.allOf != null) return this.render_compound_obj(schema.allOf as Schema[]) + if (schema.oneOf != null || schema.anyOf != null) return this.#render_anyOf(schema) + if (schema.allOf != null) return this.#render_allOf(schema.allOf as Schema[]) return this.#render_simple_obj(schema) } - #render_union_obj (schema: Schema): string { + #render_anyOf (schema: Schema): string { const schemas = schema.oneOf ?? schema.anyOf ?? [] return schemas.map((sch) => this.#render_schema(sch as Schema)).join(' | ') } - render_compound_obj (schemas: Schema[]): string { - const extensions = schemas.filter(schema => { - return schema.$ref != null - }).map(schema => this.#render_schema(schema)) + #render_allOf (schemas: Schema[]): string { + const named_schemas = schemas.filter(schema => schema.$ref != null) + const inline_schemas = schemas.filter(schema => schema.$ref == null) + + if (inline_schemas.length === 0) return named_schemas.map(schema => this.#render_schema(schema)).join(' & ') - const compound_schema: Schema = schemas.filter(schema => { - return schema.$ref == null - }).reduce((acc, schema) => { + const compound_inline = inline_schemas.reduce((acc, schema) => { acc.properties = { ...acc.properties, ...(schema).properties } acc.additionalProperties = acc.additionalProperties ?? (schema).additionalProperties acc.required = [...(acc.required ?? []), ...(schema).required ?? []] return acc }, {}) - const compound_render = this.#render_schema(compound_schema) - const extensions_render = extensions.join(', ') - if (extensions.length === 0) return compound_render - if (compound_render.includes('{')) return `extends ${extensions_render} ${compound_render}` - return `${extensions_render} & ${this.#render_simple_obj(compound_schema)}` + + const inline_schemas_render = this.#render_schema(compound_inline) + const named_schemas_render = named_schemas.map(schema => this.#render_schema(schema)).join(', ') + + if (named_schemas.length === 0) return inline_schemas_render + if (inline_schemas_render.includes('{')) return `extends ${named_schemas_render} ${inline_schemas_render}` + return `${named_schemas_render} & ${this.#render_simple_obj(compound_inline)}` } #render_simple_obj (schema: Schema): string { diff --git a/index.js b/index.js index 3efcfe614..45a3b215a 100644 --- a/index.js +++ b/index.js @@ -8,8 +8,6 @@ * */ - - /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with