diff --git a/api/OpenSearchAPI.d.ts b/api/OpenSearchAPI.d.ts index a4a67f624..cfe95d16e 100644 --- a/api/OpenSearchAPI.d.ts +++ b/api/OpenSearchAPI.d.ts @@ -34,6 +34,27 @@ declare interface HttpRequest { } export default class OpenSearchAPI { + asynchronousSearch: { + search (params?: API.AsynchronousSearch_Search_Request, options?: TransportRequestOptions): TransportRequestPromise; + search (callback: callbackFn): TransportRequestCallback; + search (params: API.AsynchronousSearch_Search_Request, callback: callbackFn): TransportRequestCallback; + search (params: API.AsynchronousSearch_Search_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + delete (params: API.AsynchronousSearch_Delete_Request, options?: TransportRequestOptions): TransportRequestPromise; + delete (params: API.AsynchronousSearch_Delete_Request, callback: callbackFn): TransportRequestCallback; + delete (params: API.AsynchronousSearch_Delete_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + get (params: API.AsynchronousSearch_Get_Request, options?: TransportRequestOptions): TransportRequestPromise; + get (params: API.AsynchronousSearch_Get_Request, callback: callbackFn): TransportRequestCallback; + get (params: API.AsynchronousSearch_Get_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + stats (params?: API.AsynchronousSearch_Stats_Request, options?: TransportRequestOptions): TransportRequestPromise; + stats (callback: callbackFn): TransportRequestCallback; + stats (params: API.AsynchronousSearch_Stats_Request, callback: callbackFn): TransportRequestCallback; + stats (params: API.AsynchronousSearch_Stats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + cat: { help (params?: API.Cat_Help_Request, options?: TransportRequestOptions): TransportRequestPromise; help (callback: callbackFn): TransportRequestCallback; @@ -273,6 +294,26 @@ export default class OpenSearchAPI { }; + flowFramework: { + create (params?: API.FlowFramework_Create_Request, options?: TransportRequestOptions): TransportRequestPromise; + create (callback: callbackFn): TransportRequestCallback; + create (params: API.FlowFramework_Create_Request, callback: callbackFn): TransportRequestCallback; + create (params: API.FlowFramework_Create_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; + + get (params: API.FlowFramework_Get_Request, options?: TransportRequestOptions): TransportRequestPromise; + get (params: API.FlowFramework_Get_Request, callback: callbackFn): TransportRequestCallback; + get (params: API.FlowFramework_Get_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + update (params: API.FlowFramework_Update_Request, options?: TransportRequestOptions): TransportRequestPromise; + update (params: API.FlowFramework_Update_Request, callback: callbackFn): TransportRequestCallback; + update (params: API.FlowFramework_Update_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + indices: { getAlias (params?: API.Indices_GetAlias_Request, options?: TransportRequestOptions): TransportRequestPromise; getAlias (callback: callbackFn): TransportRequestCallback; @@ -571,6 +612,18 @@ export default class OpenSearchAPI { deleteModel (params: API.Ml_DeleteModel_Request, callback: callbackFn): TransportRequestCallback; deleteModel (params: API.Ml_DeleteModel_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + deployModel (params: API.Ml_DeployModel_Request, options?: TransportRequestOptions): TransportRequestPromise; + deployModel (params: API.Ml_DeployModel_Request, callback: callbackFn): TransportRequestCallback; + deployModel (params: API.Ml_DeployModel_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + undeployModel (params: API.Ml_UndeployModel_Request, options?: TransportRequestOptions): TransportRequestPromise; + undeployModel (params: API.Ml_UndeployModel_Request, callback: callbackFn): TransportRequestCallback; + undeployModel (params: API.Ml_UndeployModel_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteTask (params: API.Ml_DeleteTask_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteTask (params: API.Ml_DeleteTask_Request, callback: callbackFn): TransportRequestCallback; + deleteTask (params: API.Ml_DeleteTask_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + getTask (params: API.Ml_GetTask_Request, options?: TransportRequestOptions): TransportRequestPromise; getTask (params: API.Ml_GetTask_Request, callback: callbackFn): TransportRequestCallback; getTask (params: API.Ml_GetTask_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; @@ -647,6 +700,41 @@ export default class OpenSearchAPI { }; + observability: { + getLocalstats (params?: API.Observability_GetLocalstats_Request, options?: TransportRequestOptions): TransportRequestPromise; + getLocalstats (callback: callbackFn): TransportRequestCallback; + getLocalstats (params: API.Observability_GetLocalstats_Request, callback: callbackFn): TransportRequestCallback; + getLocalstats (params: API.Observability_GetLocalstats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteObjects (params?: API.Observability_DeleteObjects_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteObjects (callback: callbackFn): TransportRequestCallback; + deleteObjects (params: API.Observability_DeleteObjects_Request, callback: callbackFn): TransportRequestCallback; + deleteObjects (params: API.Observability_DeleteObjects_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + listObjects (params?: API.Observability_ListObjects_Request, options?: TransportRequestOptions): TransportRequestPromise; + listObjects (callback: callbackFn): TransportRequestCallback; + listObjects (params: API.Observability_ListObjects_Request, callback: callbackFn): TransportRequestCallback; + listObjects (params: API.Observability_ListObjects_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + createObject (params?: API.Observability_CreateObject_Request, options?: TransportRequestOptions): TransportRequestPromise; + createObject (callback: callbackFn): TransportRequestCallback; + createObject (params: API.Observability_CreateObject_Request, callback: callbackFn): TransportRequestCallback; + createObject (params: API.Observability_CreateObject_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + deleteObject (params: API.Observability_DeleteObject_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteObject (params: API.Observability_DeleteObject_Request, callback: callbackFn): TransportRequestCallback; + deleteObject (params: API.Observability_DeleteObject_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getObject (params: API.Observability_GetObject_Request, options?: TransportRequestOptions): TransportRequestPromise; + getObject (params: API.Observability_GetObject_Request, callback: callbackFn): TransportRequestCallback; + getObject (params: API.Observability_GetObject_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + updateObject (params: API.Observability_UpdateObject_Request, options?: TransportRequestOptions): TransportRequestPromise; + updateObject (params: API.Observability_UpdateObject_Request, callback: callbackFn): TransportRequestCallback; + updateObject (params: API.Observability_UpdateObject_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + ppl: { query (params: API.Ppl_Query_Request, options?: TransportRequestOptions): TransportRequestPromise; query (params: API.Ppl_Query_Request, callback: callbackFn): TransportRequestCallback; @@ -667,6 +755,32 @@ export default class OpenSearchAPI { }; + query: { + datasourcesList (params?: API.Query_DatasourcesList_Request, options?: TransportRequestOptions): TransportRequestPromise; + datasourcesList (callback: callbackFn): TransportRequestCallback; + datasourcesList (params: API.Query_DatasourcesList_Request, callback: callbackFn): TransportRequestCallback; + datasourcesList (params: API.Query_DatasourcesList_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + datasourcesCreate (params?: API.Query_DatasourcesCreate_Request, options?: TransportRequestOptions): TransportRequestPromise; + datasourcesCreate (callback: callbackFn): TransportRequestCallback; + datasourcesCreate (params: API.Query_DatasourcesCreate_Request, callback: callbackFn): TransportRequestCallback; + datasourcesCreate (params: API.Query_DatasourcesCreate_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + datasourcesUpdate (params?: API.Query_DatasourcesUpdate_Request, options?: TransportRequestOptions): TransportRequestPromise; + datasourcesUpdate (callback: callbackFn): TransportRequestCallback; + datasourcesUpdate (params: API.Query_DatasourcesUpdate_Request, callback: callbackFn): TransportRequestCallback; + datasourcesUpdate (params: API.Query_DatasourcesUpdate_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + datasourceDelete (params: API.Query_DatasourceDelete_Request, options?: TransportRequestOptions): TransportRequestPromise; + datasourceDelete (params: API.Query_DatasourceDelete_Request, callback: callbackFn): TransportRequestCallback; + datasourceDelete (params: API.Query_DatasourceDelete_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + datasourceRetrieve (params: API.Query_DatasourceRetrieve_Request, options?: TransportRequestOptions): TransportRequestPromise; + datasourceRetrieve (params: API.Query_DatasourceRetrieve_Request, callback: callbackFn): TransportRequestCallback; + datasourceRetrieve (params: API.Query_DatasourceRetrieve_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + remoteStore: { restore (params: API.RemoteStore_Restore_Request, options?: TransportRequestOptions): TransportRequestPromise; restore (params: API.RemoteStore_Restore_Request, callback: callbackFn): TransportRequestCallback; @@ -803,6 +917,15 @@ export default class OpenSearchAPI { flushCache (params: API.Security_FlushCache_Request, callback: callbackFn): TransportRequestCallback; flushCache (params: API.Security_FlushCache_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + getAllCertificates (params?: API.Security_GetAllCertificates_Request, options?: TransportRequestOptions): TransportRequestPromise; + getAllCertificates (callback: callbackFn): TransportRequestCallback; + getAllCertificates (params: API.Security_GetAllCertificates_Request, callback: callbackFn): TransportRequestCallback; + getAllCertificates (params: API.Security_GetAllCertificates_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + getNodeCertificates (params: API.Security_GetNodeCertificates_Request, options?: TransportRequestOptions): TransportRequestPromise; + getNodeCertificates (params: API.Security_GetNodeCertificates_Request, callback: callbackFn): TransportRequestCallback; + getNodeCertificates (params: API.Security_GetNodeCertificates_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + generateOboToken (params: API.Security_GenerateOboToken_Request, options?: TransportRequestOptions): TransportRequestPromise; generateOboToken (params: API.Security_GenerateOboToken_Request, callback: callbackFn): TransportRequestCallback; generateOboToken (params: API.Security_GenerateOboToken_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; @@ -1000,10 +1123,6 @@ 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 4e9a4ac6a..b990fb980 100644 --- a/api/OpenSearchAPI.js +++ b/api/OpenSearchAPI.js @@ -23,9 +23,11 @@ class OpenSearchAPI { constructor (opts) { this[kConfigErr] = opts.ConfigurationError this[kApiModules] = { + asynchronousSearch: new(require('./asynchronousSearch/_api'))(this), cat: new(require('./cat/_api'))(this), cluster: new(require('./cluster/_api'))(this), danglingIndices: new(require('./danglingIndices/_api'))(this), + flowFramework: new(require('./flowFramework/_api'))(this), http: new(require('./http/_api'))(this), indices: new(require('./indices/_api'))(this), ingest: new(require('./ingest/_api'))(this), @@ -33,7 +35,9 @@ class OpenSearchAPI { ml: new(require('./ml/_api'))(this), nodes: new(require('./nodes/_api'))(this), notifications: new(require('./notifications/_api'))(this), + observability: new(require('./observability/_api'))(this), ppl: new(require('./ppl/_api'))(this), + query: new(require('./query/_api'))(this), remoteStore: new(require('./remoteStore/_api'))(this), rollups: new(require('./rollups/_api'))(this), searchPipeline: new(require('./searchPipeline/_api'))(this), @@ -140,9 +144,11 @@ class OpenSearchAPI { // Setup API Modules Object.defineProperties(this, { + asynchronousSearch: { get() { return this[kApiModules].asynchronousSearch } }, cat: { get() { return this[kApiModules].cat } }, cluster: { get() { return this[kApiModules].cluster } }, danglingIndices: { get() { return this[kApiModules].danglingIndices } }, + flowFramework: { get() { return this[kApiModules].flowFramework } }, http: { get() { return this[kApiModules].http } }, indices: { get() { return this[kApiModules].indices } }, ingest: { get() { return this[kApiModules].ingest } }, @@ -150,7 +156,9 @@ class OpenSearchAPI { ml: { get() { return this[kApiModules].ml } }, nodes: { get() { return this[kApiModules].nodes } }, notifications: { get() { return this[kApiModules].notifications } }, + observability: { get() { return this[kApiModules].observability } }, ppl: { get() { return this[kApiModules].ppl } }, + query: { get() { return this[kApiModules].query } }, remoteStore: { get() { return this[kApiModules].remoteStore } }, rollups: { get() { return this[kApiModules].rollups } }, searchPipeline: { get() { return this[kApiModules].searchPipeline } }, @@ -160,8 +168,12 @@ class OpenSearchAPI { tasks: { get() { return this[kApiModules].tasks } }, transforms: { get() { return this[kApiModules].transforms } }, + // Deprecated: Use asynchronousSearch instead. + asynchronous_search: { get() { return this[kApiModules].asynchronousSearch } }, // Deprecated: Use danglingIndices instead. dangling_indices: { get() { return this[kApiModules].danglingIndices } }, + // Deprecated: Use flowFramework instead. + flow_framework: { get() { return this[kApiModules].flowFramework } }, // Deprecated: Use remoteStore instead. remote_store: { get() { return this[kApiModules].remoteStore } }, // Deprecated: Use searchPipeline instead. diff --git a/api/_core/count.d.ts b/api/_core/count.d.ts index 5a8f8cc16..7ba4468c7 100644 --- a/api/_core/count.d.ts +++ b/api/_core/count.d.ts @@ -49,5 +49,6 @@ export interface Count_Response extends ApiResponse { export interface Count_ResponseBody { _shards: Common.ShardStatistics; count: number; + terminated_early?: boolean; } diff --git a/api/_core/deleteByQuery.js b/api/_core/deleteByQuery.js index 5a343dd85..0498eb58a 100644 --- a/api/_core/deleteByQuery.js +++ b/api/_core/deleteByQuery.js @@ -49,7 +49,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation. * @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout. * @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. - * @param {integer} [params.size] - Deprecated, please use `max_docs` instead. + * @param {number} [params.size] - Deprecated, please use `max_docs` instead. * @param {string} [params.slices] - The number of slices this task should be divided into. * @param {array} [params.sort] - A comma-separated list of : pairs. * @param {array} [params.stats] - Specific `tag` of the request for logging and statistical purposes. diff --git a/api/_core/reindex.js b/api/_core/reindex.js index ac87022d9..0b59788f0 100644 --- a/api/_core/reindex.js +++ b/api/_core/reindex.js @@ -27,7 +27,7 @@ documents from a remote cluster. * @memberOf API-Core * * @param {object} params - * @param {integer} [params.max_docs] - Maximum number of documents to process. By default, all documents. + * @param {number} [params.max_docs] - Maximum number of documents to process. By default, all documents. * @param {boolean} [params.refresh] - If `true`, the request refreshes affected shards to make this operation visible to search. * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. Defaults to no throttle. * @param {string} [params.scroll] - Specifies how long a consistent view of the index should be maintained for scrolled search. diff --git a/api/_core/search.d.ts b/api/_core/search.d.ts index b48c5f443..c940e7a76 100644 --- a/api/_core/search.d.ts +++ b/api/_core/search.d.ts @@ -84,7 +84,7 @@ export interface Search_RequestBody { from?: number; highlight?: Core_Search.Highlight; indices_boost?: Record[]; - knn?: Common.KnnQuery | Common.KnnQuery[]; + knn?: Common_QueryDsl.KnnQuery | Common_QueryDsl.KnnQuery[]; min_score?: number; pit?: Core_Search.PointInTimeReference; post_filter?: Common_QueryDsl.QueryContainer; diff --git a/api/_core/updateByQuery.js b/api/_core/updateByQuery.js index b48061936..3b5d80480 100644 --- a/api/_core/updateByQuery.js +++ b/api/_core/updateByQuery.js @@ -51,7 +51,7 @@ for example to pick up a mapping change. * @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation. * @param {string} [params.search_timeout] - Explicit timeout for each search request. * @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. - * @param {integer} [params.size] - Deprecated, please use `max_docs` instead. + * @param {number} [params.size] - Deprecated, please use `max_docs` instead. * @param {string} [params.slices] - The number of slices this task should be divided into. * @param {array} [params.sort] - A comma-separated list of : pairs. * @param {array} [params.stats] - Specific `tag` of the request for logging and statistical purposes. diff --git a/api/_types/_common.d.ts b/api/_types/_common.d.ts index 1720d3e9d..24a1a0367 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -41,23 +41,9 @@ export interface BulkIndexByScrollFailure { type: string; } -export interface BulkStats { - avg_size?: ByteSize; - avg_size_in_bytes: number; - avg_time?: Duration; - avg_time_in_millis: DurationValueUnitMillis; - total_operations: number; - total_size?: ByteSize; - total_size_in_bytes: number; - total_time?: Duration; - total_time_in_millis: DurationValueUnitMillis; -} - export type byte = number -export type Bytes = 'b' | 'g' | 'gb' | 'k' | 'kb' | 'm' | 'mb' | 'p' | 'pb' | 't' | 'tb' - -export type ByteSize = number | string +export type Bytes = number export interface ClusterDetails { _shards?: ShardStatistics; @@ -82,8 +68,8 @@ export interface ClusterStatistics { export interface CompletionStats { fields?: Record; - size?: ByteSize; - size_in_bytes: number; + size?: StorageSize; + size_in_bytes: Bytes; } export type Conflicts = 'abort' | 'proceed' @@ -166,24 +152,26 @@ export type Field = string export interface FielddataStats { evictions?: number; fields?: Record; - memory_size?: ByteSize; - memory_size_in_bytes: number; + memory_size?: StorageSize; + memory_size_in_bytes: Bytes; } export interface FieldMemoryUsage { - memory_size?: ByteSize; - memory_size_in_bytes: number; + memory_size?: StorageSize; + memory_size_in_bytes: Bytes; } export type Fields = Field | Field[] export interface FieldSizeUsage { - size?: ByteSize; - size_in_bytes: number; + size?: StorageSize; + size_in_bytes: Bytes; } export type FieldValue = boolean | undefined | number | Record | string +export type FieldWithOrder = Record + export interface FlushStats { periodic: number; total: number; @@ -233,10 +221,10 @@ export interface GetStats { exists_time?: Duration; exists_time_in_millis: DurationValueUnitMillis; exists_total: number; + getTime?: Duration; missing_time?: Duration; missing_time_in_millis: DurationValueUnitMillis; missing_total: number; - time?: Duration; time_in_millis: DurationValueUnitMillis; total: number; } @@ -280,7 +268,6 @@ export interface IndexingStats { throttle_time?: Duration; throttle_time_in_millis: DurationValueUnitMillis; types?: Record; - write_load?: number; } export type IndexName = string @@ -317,15 +304,13 @@ export interface InlineScript extends ScriptBase { export type Ip = string -export interface KnnQuery { +export interface KnnField { boost?: number; - field: Field; filter?: Common_QueryDsl.QueryContainer | Common_QueryDsl.QueryContainer[]; - k: number; - num_candidates: number; - query_vector?: QueryVector; - query_vector_builder?: QueryVectorBuilder; - similarity?: number; + k?: number; + max_distance?: number; + min_score?: number; + vector: QueryVector; } export interface LatLonGeoLocation { @@ -338,14 +323,14 @@ export type Level = 'cluster' | 'indices' | 'shards' export interface MergesStats { current: number; current_docs: number; - current_size?: string; - current_size_in_bytes: number; + current_size?: StorageSize; + current_size_in_bytes: Bytes; total: number; - total_auto_throttle?: string; - total_auto_throttle_in_bytes: number; + total_auto_throttle?: StorageSize; + total_auto_throttle_in_bytes: Bytes; total_docs: number; - total_size?: string; - total_size_in_bytes: number; + total_size?: StorageSize; + total_size_in_bytes: Bytes; total_stopped_time?: Duration; total_stopped_time_in_millis: DurationValueUnitMillis; total_throttled_time?: Duration; @@ -361,7 +346,7 @@ export type Metrics = string | string[] export type MinimumShouldMatch = number | string -export type MultiTermQueryRewrite = string +export type MultiTermQueryRewrite = 'constant_score' | 'constant_score_boolean' | 'scoring_boolean' | 'top_terms_N' | 'top_terms_blended_freqs_N' | 'top_terms_boost_N' export type Name = string @@ -466,18 +451,14 @@ export interface QueryCacheStats { cache_size: number; evictions: number; hit_count: number; - memory_size?: ByteSize; - memory_size_in_bytes: number; + memory_size?: StorageSize; + memory_size_in_bytes: Bytes; miss_count: number; total_count: number; } export type QueryVector = number[] -export interface QueryVectorBuilder { - text_embedding?: TextEmbedding; -} - export type RankBase = Record export interface RankContainer { @@ -495,6 +476,7 @@ export type Refresh = 'false' | 'true' | 'wait_for' export interface RefreshStats { external_total: number; + external_total_time?: Duration; external_total_time_in_millis: DurationValueUnitMillis; listeners: number; total: number; @@ -510,6 +492,7 @@ export interface RelocationFailureInfo { export interface RemoteStoreDownloadStats { total_download_size: RemoteStoreUploadDownloadStats; + total_time_spent?: Duration; total_time_spent_in_millis: DurationValueUnitMillis; } @@ -528,9 +511,12 @@ export interface RemoteStoreTranslogUploadStats { } export interface RemoteStoreTranslogUploadTotalUploadSizeStats { - failed_bytes: ByteSize; - started_bytes: ByteSize; - succeeded_bytes: ByteSize; + failed?: StorageSize; + failed_bytes: Bytes; + started?: StorageSize; + started_bytes: Bytes; + succeeded?: StorageSize; + succeeded_bytes: Bytes; } export interface RemoteStoreTranslogUploadTotalUploadsStats { @@ -540,9 +526,12 @@ export interface RemoteStoreTranslogUploadTotalUploadsStats { } export interface RemoteStoreUploadDownloadStats { - failed_bytes: ByteSize; - started_bytes: ByteSize; - succeeded_bytes: ByteSize; + failed?: StorageSize; + failed_bytes: Bytes; + started?: StorageSize; + started_bytes: Bytes; + succeeded?: StorageSize; + succeeded_bytes: Bytes; } export interface RemoteStoreUploadPressureStats { @@ -550,14 +539,18 @@ export interface RemoteStoreUploadPressureStats { } export interface RemoteStoreUploadRefreshSizeLagStats { - max_bytes: ByteSize; - total_bytes: ByteSize; + max?: StorageSize; + max_bytes: Bytes; + total?: StorageSize; + total_bytes: Bytes; } export interface RemoteStoreUploadStats { + max_refresh_time_lag?: Duration; max_refresh_time_lag_in_millis: DurationValueUnitMillis; pressure: RemoteStoreUploadPressureStats; refresh_size_lag: RemoteStoreUploadRefreshSizeLagStats; + total_time_spent?: Duration; total_time_spent_in_millis: DurationValueUnitMillis; total_upload_size: RemoteStoreUploadDownloadStats; } @@ -565,13 +558,14 @@ export interface RemoteStoreUploadStats { export interface RequestCacheStats { evictions: number; hit_count: number; - memory_size?: string; - memory_size_in_bytes: number; + memory_size?: StorageSize; + memory_size_in_bytes: Bytes; miss_count: number; } export interface RequestStats { current?: number; + time?: Duration; time_in_millis?: DurationValueUnitMillis; total?: number; } @@ -658,38 +652,38 @@ export interface SearchStats { export type SearchType = 'dfs_query_then_fetch' | 'query_then_fetch' export interface SegmentReplicationStats { - max_bytes_behind: ByteSize; - max_replication_lag: ByteSize; - total_bytes_behind: ByteSize; + max_bytes_behind: Bytes; + max_replication_lag: Bytes; + total_bytes_behind: Bytes; } export interface SegmentsStats { count: number; - doc_values_memory?: ByteSize; - doc_values_memory_in_bytes: number; + doc_values_memory?: StorageSize; + doc_values_memory_in_bytes: Bytes; file_sizes: Record; - fixed_bit_set?: ByteSize; - fixed_bit_set_memory_in_bytes: number; - index_writer_max_memory_in_bytes?: number; - index_writer_memory?: ByteSize; - index_writer_memory_in_bytes: number; + 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; max_unsafe_auto_id_timestamp: number; - memory?: ByteSize; - memory_in_bytes: number; - norms_memory?: ByteSize; - norms_memory_in_bytes: number; - points_memory?: ByteSize; - points_memory_in_bytes: number; + memory?: StorageSize; + memory_in_bytes: Bytes; + norms_memory?: StorageSize; + norms_memory_in_bytes: Bytes; + points_memory?: StorageSize; + points_memory_in_bytes: Bytes; remote_store?: RemoteStoreStats; segment_replication?: SegmentReplicationStats; - stored_fields_memory_in_bytes: number; - stored_memory?: ByteSize; - term_vectors_memory_in_bytes: number; - term_vectory_memory?: ByteSize; - terms_memory?: ByteSize; - terms_memory_in_bytes: number; - version_map_memory?: ByteSize; - version_map_memory_in_bytes: number; + 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; } export type SequenceNumber = number @@ -728,7 +722,7 @@ export type SlicesCalculation = 'auto' export type Sort = SortCombinations | SortCombinations[] -export type SortCombinations = Field | SortOptions +export type SortCombinations = Field | FieldWithOrder | SortOptions export type SortMode = 'avg' | 'max' | 'median' | 'min' | 'sum' @@ -743,6 +737,10 @@ 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; @@ -754,12 +752,10 @@ export interface StoredScriptId extends ScriptBase { } export interface StoreStats { - reserved?: ByteSize; - reserved_in_bytes: number; - size?: ByteSize; - size_in_bytes: number; - total_data_set_size?: ByteSize; - total_data_set_size_in_bytes?: number; + reserved?: StorageSize; + reserved_in_bytes: Bytes; + size?: StorageSize; + size_in_bytes: Bytes; } export type Stringifiedboolean = boolean | string @@ -783,11 +779,6 @@ export interface TaskFailure { export type TaskId = string | number -export interface TextEmbedding { - model_id: string; - model_text: string; -} - export type TimeOfDay = string export type TimeUnit = 'd' | 'h' | 'm' | 'micros' | 'ms' | 'nanos' | 's' @@ -808,11 +799,11 @@ export interface TranslogStats { earliest_last_modified_age: number; operations: number; remote_store?: RemoteStoreTranslogStats; - size?: string; - size_in_bytes: number; + size?: StorageSize; + size_in_bytes: Bytes; uncommitted_operations: number; - uncommitted_size?: string; - uncommitted_size_in_bytes: number; + uncommitted_size?: StorageSize; + uncommitted_size_in_bytes: Bytes; } export type TransportAddress = string @@ -870,3 +861,10 @@ export interface WriteResponseBase { result: Result; } +export interface XyCartesianCoordinates { + x: number; + y: number; +} + +export type XyLocation = XyCartesianCoordinates | number[] | string + diff --git a/api/_types/_common.mapping.d.ts b/api/_types/_common.mapping.d.ts index fa5b0e31e..44ca9d20f 100644 --- a/api/_types/_common.mapping.d.ts +++ b/api/_types/_common.mapping.d.ts @@ -218,6 +218,7 @@ export interface GeoPointProperty extends DocValuesPropertyBase { export interface GeoShapeProperty extends DocValuesPropertyBase { coerce?: boolean; + distance_error_pct?: number; ignore_malformed?: boolean; ignore_z_value?: boolean; orientation?: GeoOrientation; @@ -286,6 +287,22 @@ export interface KeywordProperty extends DocValuesPropertyBase { type: 'keyword'; } +export interface KnnVectorMethod { + engine?: string; + name: string; + parameters?: Record>; + space_type?: string; +} + +export interface KnnVectorProperty extends KnnVectorPropertyBase { + type: 'knn_vector'; +} + +export interface KnnVectorPropertyBase { + dimension: number; + method?: KnnVectorMethod; +} + export interface LongNumberProperty extends NumberPropertyBase { null_value?: number; type: 'long'; @@ -337,14 +354,7 @@ export interface PercolatorProperty extends PropertyBase { type: 'percolator'; } -export interface PointProperty extends DocValuesPropertyBase { - ignore_malformed?: boolean; - ignore_z_value?: boolean; - null_value?: string; - type: 'point'; -} - -export type Property = BinaryProperty | BooleanProperty | DynamicProperty | JoinProperty | KeywordProperty | MatchOnlyTextProperty | PercolatorProperty | RankFeatureProperty | RankFeaturesProperty | SearchAsYouTypeProperty | TextProperty | VersionProperty | WildcardProperty | DateNanosProperty | DateProperty | AggregateMetricDoubleProperty | DenseVectorProperty | SparseVectorProperty | FlattenedProperty | NestedProperty | ObjectProperty | CompletionProperty | ConstantKeywordProperty | FieldAliasProperty | HistogramProperty | IpProperty | Murmur3HashProperty | TokenCountProperty | GeoPointProperty | GeoShapeProperty | PointProperty | ShapeProperty | ByteNumberProperty | DoubleNumberProperty | FloatNumberProperty | HalfFloatNumberProperty | IntegerNumberProperty | LongNumberProperty | ScaledFloatNumberProperty | ShortNumberProperty | UnsignedLongNumberProperty | DateRangeProperty | DoubleRangeProperty | FloatRangeProperty | IntegerRangeProperty | IpRangeProperty | LongRangeProperty +export type Property = BinaryProperty | BooleanProperty | DynamicProperty | JoinProperty | KeywordProperty | MatchOnlyTextProperty | PercolatorProperty | RankFeatureProperty | RankFeaturesProperty | SearchAsYouTypeProperty | TextProperty | VersionProperty | WildcardProperty | DateNanosProperty | DateProperty | AggregateMetricDoubleProperty | DenseVectorProperty | SparseVectorProperty | FlattenedProperty | NestedProperty | ObjectProperty | CompletionProperty | ConstantKeywordProperty | FieldAliasProperty | HistogramProperty | IpProperty | Murmur3HashProperty | TokenCountProperty | GeoPointProperty | GeoShapeProperty | XyPointProperty | XyShapeProperty | ByteNumberProperty | DoubleNumberProperty | FloatNumberProperty | HalfFloatNumberProperty | IntegerNumberProperty | LongNumberProperty | ScaledFloatNumberProperty | ShortNumberProperty | UnsignedLongNumberProperty | DateRangeProperty | DoubleRangeProperty | FloatRangeProperty | IntegerRangeProperty | IpRangeProperty | LongRangeProperty | KnnVectorProperty export interface PropertyBase { dynamic?: DynamicMapping; @@ -410,14 +420,6 @@ export interface SearchAsYouTypeProperty extends CorePropertyBase { type: 'search_as_you_type'; } -export interface ShapeProperty extends DocValuesPropertyBase { - coerce?: boolean; - ignore_malformed?: boolean; - ignore_z_value?: boolean; - orientation?: GeoOrientation; - type: 'shape'; -} - export interface ShortNumberProperty extends NumberPropertyBase { null_value?: Common.short; type: 'short'; @@ -518,3 +520,18 @@ export interface WildcardProperty extends DocValuesPropertyBase { type: 'wildcard'; } +export interface XyPointProperty extends DocValuesPropertyBase { + ignore_malformed?: boolean; + ignore_z_value?: boolean; + null_value?: Common.XyLocation; + type: 'xy_point'; +} + +export interface XyShapeProperty extends DocValuesPropertyBase { + coerce?: boolean; + ignore_malformed?: boolean; + ignore_z_value?: boolean; + orientation?: GeoOrientation; + type: 'xy_shape'; +} + diff --git a/api/_types/_common.query_dsl.d.ts b/api/_types/_common.query_dsl.d.ts index 8fcc61bdb..42f718970 100644 --- a/api/_types/_common.query_dsl.d.ts +++ b/api/_types/_common.query_dsl.d.ts @@ -153,9 +153,10 @@ export interface FuzzyQuery extends QueryBase { } export interface GeoBoundingBoxQuery extends QueryBase { - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; type?: GeoExecution; validation_method?: GeoValidationMethod; + [key: string]: any | Common.GeoBounds; } export type GeoDecayFunction = DecayFunctionBase & Record @@ -165,26 +166,37 @@ export type GeoDistanceFeatureQuery = DistanceFeatureQueryBaseGeoLocationDistanc export interface GeoDistanceQuery extends QueryBase { distance: Common.Distance; distance_type?: Common.GeoDistanceType; - field: Record; - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; validation_method?: GeoValidationMethod; + [key: string]: any | Common.GeoLocation; } export type GeoExecution = 'indexed' | 'memory' export interface GeoPolygonQuery extends QueryBase { - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; validation_method?: GeoValidationMethod; } +export interface GeoShape { + coordinates?: any[]; + type?: string; +} + +export interface GeoShapeField { + relation?: Common.GeoShapeRelation; + shape: GeoShape; +} + export interface GeoShapeQuery extends QueryBase { - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; + [key: string]: any | GeoShapeField; } export type GeoValidationMethod = 'coerce' | 'ignore_malformed' | 'strict' export interface HasChildQuery extends QueryBase { - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; inner_hits?: Core_Search.InnerHits; max_children?: number; min_children?: number; @@ -194,7 +206,7 @@ export interface HasChildQuery extends QueryBase { } export interface HasParentQuery extends QueryBase { - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; inner_hits?: Core_Search.InnerHits; parent_type: Common.RelationName; query: QueryContainer; @@ -205,6 +217,8 @@ export interface IdsQuery extends QueryBase { values?: Common.Ids; } +export type IgnoreUnmapped = boolean + export interface IntervalsAllOf { filter?: IntervalsFilter; intervals: IntervalsContainer[]; @@ -277,6 +291,8 @@ export interface IntervalsWildcard { use_field?: Common.Field; } +export type KnnQuery = Record + export type Like = string | LikeDocument export interface LikeDocument { @@ -382,13 +398,25 @@ export interface MultiMatchQuery extends QueryBase { export type MultiValueMode = 'avg' | 'max' | 'min' | 'sum' export interface NestedQuery extends QueryBase { - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; inner_hits?: Core_Search.InnerHits; path: Common.Field; query: QueryContainer; score_mode?: ChildScoreMode; } +export type NeuralQuery = QueryBase & Record + +export interface NeuralQueryVectorField { + filter?: QueryContainer; + k?: number; + max_distance?: number; + min_score?: number; + model_id?: string; + query_image?: string; + query_text?: string; +} + export interface NumberRangeQuery extends RangeQueryBase { from?: undefined | number | string; gt?: number; @@ -404,7 +432,7 @@ export type Operator = 'and' | 'or' export interface ParentIdQuery extends QueryBase { id?: Common.Id; - ignore_unmapped?: boolean; + ignore_unmapped?: IgnoreUnmapped; type?: Common.RelationName; } @@ -458,6 +486,7 @@ export interface QueryContainer { has_parent?: HasParentQuery; ids?: IdsQuery; intervals?: Record; + knn?: KnnQuery; match?: Record; match_all?: MatchAllQuery; match_bool_prefix?: Record; @@ -467,6 +496,7 @@ export interface QueryContainer { more_like_this?: MoreLikeThisQuery; multi_match?: MultiMatchQuery; nested?: NestedQuery; + neural?: NeuralQuery; parent_id?: ParentIdQuery; percolate?: PercolateQuery; pinned?: PinnedQuery; @@ -478,7 +508,6 @@ export interface QueryContainer { rule_query?: RuleQuery; script?: ScriptQuery; script_score?: ScriptScoreQuery; - shape?: ShapeQuery; simple_query_string?: SimpleQueryStringQuery; span_containing?: SpanContainingQuery; span_first?: SpanFirstQuery; @@ -489,13 +518,14 @@ export interface QueryContainer { span_term?: Record; span_within?: SpanWithinQuery; term?: Record; - terms?: TermsQuery; + terms?: Record; terms_set?: Record; text_expansion?: Record; type?: TypeQuery; weighted_tokens?: Record; wildcard?: Record; wrapper?: WrapperQuery; + xy_shape?: XyShapeQuery; } export interface QueryStringQuery extends QueryBase { @@ -592,10 +622,6 @@ export interface ScriptScoreQuery extends QueryBase { script: Common.Script; } -export interface ShapeQuery extends QueryBase { - ignore_unmapped?: boolean; -} - export type SimpleQueryStringFlag = 'ALL' | 'AND' | 'ESCAPE' | 'FUZZY' | 'NEAR' | 'NONE' | 'NOT' | 'OR' | 'PHRASE' | 'PRECEDENCE' | 'PREFIX' | 'SLOP' | 'WHITESPACE' export type SimpleQueryStringFlags = Common.PipeSeparatedFlagsSimpleQueryStringFlag & Record @@ -682,7 +708,12 @@ export interface TermQuery extends QueryBase { value: Common.FieldValue; } -export type TermsQuery = QueryBase & Record +export type TermsQuery = QueryBase | { + id?: Common.Id; + index?: Common.IndexName; + path?: Common.Field; + routing?: Common.Routing; +} export interface TermsSetQuery extends QueryBase { minimum_should_match_field?: Common.Field; @@ -724,5 +755,17 @@ export interface WrapperQuery extends QueryBase { query: string; } +export interface XyShape { + coordinates?: any[]; + type?: string; +} + +export interface XyShapeField { + relation?: Common.GeoShapeRelation; + shape: XyShape; +} + +export type XyShapeQuery = QueryBase & Record + export type ZeroTermsQuery = 'all' | 'none' diff --git a/api/_types/_core.msearch.d.ts b/api/_types/_core.msearch.d.ts index 91ed86092..2f755e223 100644 --- a/api/_types/_core.msearch.d.ts +++ b/api/_types/_core.msearch.d.ts @@ -17,8 +17,8 @@ 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_Mapping from './_common.mapping' +import * as Common from './_common' export interface MultisearchBody { _source?: Core_Search.SourceConfig; @@ -31,7 +31,7 @@ export interface MultisearchBody { from?: number; highlight?: Core_Search.Highlight; indices_boost?: Record[]; - knn?: Common.KnnQuery | Common.KnnQuery[]; + knn?: Common_QueryDsl.KnnQuery | Common_QueryDsl.KnnQuery[]; min_score?: number; pit?: Core_Search.PointInTimeReference; post_filter?: Common_QueryDsl.QueryContainer; diff --git a/api/_types/asynchronous_search._common.d.ts b/api/_types/asynchronous_search._common.d.ts new file mode 100644 index 000000000..d0c8ae255 --- /dev/null +++ b/api/_types/asynchronous_search._common.d.ts @@ -0,0 +1,87 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import * as 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_Mapping from './_common.mapping' + +export interface AsynchronousSearchStats { + cancelled?: number; + initialized?: number; + persist_failed?: number; + persisted?: number; + rejected?: number; + running_current?: number; + search_completed?: number; + search_failed?: number; + submitted?: number; +} + +export interface NodesStats { + asynchronous_search_stats?: AsynchronousSearchStats; +} + +export interface ResponseBody { + expiration_time_in_millis?: number; + id?: string; + response?: Core_Search.ResponseBody; + start_time_in_millis?: number; + state?: string; + took?: number; +} + +export interface Search { + _source?: Core_Search.SourceConfig; + aggregations?: Record; + collapse?: Core_Search.FieldCollapse; + docvalue_fields?: Common_QueryDsl.FieldAndFormat[]; + explain?: boolean; + ext?: Record>; + fields?: Common_QueryDsl.FieldAndFormat[]; + from?: number; + highlight?: Core_Search.Highlight; + indices_boost?: Record[]; + min_score?: number; + pit?: Core_Search.PointInTimeReference; + post_filter?: Common_QueryDsl.QueryContainer; + profile?: boolean; + query?: Common_QueryDsl.QueryContainer; + rank?: Common.RankContainer; + runtime_mappings?: Common_Mapping.RuntimeFields; + script_fields?: Record; + search_after?: Common.SortResults; + seq_no_primary_term?: boolean; + size?: number; + slice?: Common.SlicedScroll; + sort?: Common.Sort; + stats?: string[]; + stored_fields?: Common.Fields; + suggest?: Core_Search.Suggester; + terminate_after?: number; + timeout?: string; + track_scores?: boolean; + track_total_hits?: Core_Search.TrackHits; + version?: boolean; +} + +export interface StatsResponse { + _nodes?: Common.NodeStatistics; + cluster_name?: string; + nodes?: Record; +} + diff --git a/api/_types/cat.allocation.d.ts b/api/_types/cat.allocation.d.ts index 7d2c64df7..8a8cbc0a3 100644 --- a/api/_types/cat.allocation.d.ts +++ b/api/_types/cat.allocation.d.ts @@ -17,11 +17,11 @@ import * as Common from './_common' export interface AllocationRecord { - 'disk.avail'?: Common.ByteSize | undefined; - 'disk.indices'?: Common.ByteSize | undefined; + 'disk.avail'?: undefined | string; + 'disk.indices'?: undefined | string; 'disk.percent'?: Common.Percentage | undefined; - 'disk.total'?: Common.ByteSize | undefined; - 'disk.used'?: Common.ByteSize | undefined; + 'disk.total'?: undefined | string; + 'disk.used'?: undefined | string; host?: Common.Host | undefined; ip?: Common.Ip | undefined; node?: string; diff --git a/api/_types/cat.indices.d.ts b/api/_types/cat.indices.d.ts index e84078e16..88b0b7631 100644 --- a/api/_types/cat.indices.d.ts +++ b/api/_types/cat.indices.d.ts @@ -16,146 +16,150 @@ export interface IndicesRecord { - 'bulk.avg_size_in_bytes'?: string; - 'bulk.avg_time'?: string; - 'bulk.total_operations'?: string; - 'bulk.total_size_in_bytes'?: string; - 'bulk.total_time'?: string; - 'completion.size'?: string; + 'completion.size'?: undefined | string; 'creation.date'?: string; 'creation.date.string'?: string; 'docs.count'?: undefined | string; 'docs.deleted'?: undefined | string; - 'fielddata.evictions'?: string; - 'fielddata.memory_size'?: string; - 'flush.total'?: string; - 'flush.total_time'?: string; - 'get.current'?: string; - 'get.exists_time'?: string; - 'get.exists_total'?: string; - 'get.missing_time'?: string; - 'get.missing_total'?: string; - 'get.time'?: string; - 'get.total'?: string; + 'fielddata.evictions'?: undefined | string; + 'fielddata.memory_size'?: undefined | string; + 'flush.total'?: undefined | string; + 'flush.total_time'?: undefined | string; + 'get.current'?: undefined | string; + 'get.exists_time'?: undefined | string; + 'get.exists_total'?: undefined | string; + 'get.missing_time'?: undefined | string; + 'get.missing_total'?: undefined | string; + 'get.time'?: undefined | string; + 'get.total'?: undefined | string; health?: string; index?: string; - 'indexing.delete_current'?: string; - 'indexing.delete_time'?: string; - 'indexing.delete_total'?: string; - 'indexing.index_current'?: string; - 'indexing.index_failed'?: string; - 'indexing.index_time'?: string; - 'indexing.index_total'?: string; + 'indexing.delete_current'?: undefined | string; + 'indexing.delete_time'?: undefined | string; + 'indexing.delete_total'?: undefined | string; + 'indexing.index_current'?: undefined | string; + 'indexing.index_failed'?: undefined | string; + 'indexing.index_time'?: undefined | string; + 'indexing.index_total'?: undefined | string; 'memory.total'?: string; - 'merges.current'?: string; - 'merges.current_docs'?: string; - 'merges.current_size'?: string; - 'merges.total'?: string; - 'merges.total_docs'?: string; - 'merges.total_size'?: string; - 'merges.total_time'?: string; + 'merges.current'?: undefined | string; + 'merges.current_docs'?: undefined | string; + 'merges.current_size'?: undefined | string; + 'merges.total'?: undefined | string; + 'merges.total_docs'?: undefined | string; + 'merges.total_size'?: undefined | string; + 'merges.total_time'?: undefined | string; pri?: string; - 'pri.bulk.avg_size_in_bytes'?: string; - 'pri.bulk.avg_time'?: string; - 'pri.bulk.total_operations'?: string; - 'pri.bulk.total_size_in_bytes'?: string; - 'pri.bulk.total_time'?: string; - 'pri.completion.size'?: string; - 'pri.fielddata.evictions'?: string; - 'pri.fielddata.memory_size'?: string; - 'pri.flush.total'?: string; - 'pri.flush.total_time'?: string; - 'pri.get.current'?: string; - 'pri.get.exists_time'?: string; - 'pri.get.exists_total'?: string; - 'pri.get.missing_time'?: string; - 'pri.get.missing_total'?: string; - 'pri.get.time'?: string; - 'pri.get.total'?: string; - 'pri.indexing.delete_current'?: string; - 'pri.indexing.delete_time'?: string; - 'pri.indexing.delete_total'?: string; - 'pri.indexing.index_current'?: string; - 'pri.indexing.index_failed'?: string; - 'pri.indexing.index_time'?: string; - 'pri.indexing.index_total'?: string; + 'pri.completion.size'?: undefined | string; + 'pri.fielddata.evictions'?: undefined | string; + 'pri.fielddata.memory_size'?: undefined | string; + 'pri.flush.total'?: undefined | string; + 'pri.flush.total_time'?: undefined | string; + 'pri.get.current'?: undefined | string; + 'pri.get.exists_time'?: undefined | string; + 'pri.get.exists_total'?: undefined | string; + 'pri.get.missing_time'?: undefined | string; + 'pri.get.missing_total'?: undefined | string; + 'pri.get.time'?: undefined | string; + 'pri.get.total'?: undefined | string; + 'pri.indexing.delete_current'?: undefined | string; + 'pri.indexing.delete_time'?: undefined | string; + 'pri.indexing.delete_total'?: undefined | string; + 'pri.indexing.index_current'?: undefined | string; + 'pri.indexing.index_failed'?: undefined | string; + 'pri.indexing.index_time'?: undefined | string; + 'pri.indexing.index_total'?: undefined | string; 'pri.memory.total'?: string; - 'pri.merges.current'?: string; - 'pri.merges.current_docs'?: string; - 'pri.merges.current_size'?: string; - 'pri.merges.total'?: string; - 'pri.merges.total_docs'?: string; - 'pri.merges.total_size'?: string; - 'pri.merges.total_time'?: string; - 'pri.query_cache.evictions'?: string; - 'pri.query_cache.memory_size'?: string; - 'pri.refresh.external_time'?: string; - 'pri.refresh.external_total'?: string; - 'pri.refresh.listeners'?: string; - 'pri.refresh.time'?: string; - 'pri.refresh.total'?: string; - 'pri.request_cache.evictions'?: string; - 'pri.request_cache.hit_count'?: string; - 'pri.request_cache.memory_size'?: string; - 'pri.request_cache.miss_count'?: string; - 'pri.search.fetch_current'?: string; - 'pri.search.fetch_time'?: string; - 'pri.search.fetch_total'?: string; - 'pri.search.open_contexts'?: string; - 'pri.search.query_current'?: string; - 'pri.search.query_time'?: string; - 'pri.search.query_total'?: string; - 'pri.search.scroll_current'?: string; - 'pri.search.scroll_time'?: string; - 'pri.search.scroll_total'?: string; - 'pri.segments.count'?: string; - 'pri.segments.fixed_bitset_memory'?: string; - 'pri.segments.index_writer_memory'?: string; - 'pri.segments.memory'?: string; - 'pri.segments.version_map_memory'?: string; + 'pri.merges.current'?: undefined | string; + 'pri.merges.current_docs'?: undefined | string; + 'pri.merges.current_size'?: undefined | string; + 'pri.merges.total'?: undefined | string; + 'pri.merges.total_docs'?: undefined | string; + 'pri.merges.total_size'?: undefined | string; + 'pri.merges.total_time'?: undefined | string; + 'pri.query_cache.evictions'?: undefined | string; + 'pri.query_cache.memory_size'?: undefined | string; + 'pri.refresh.external_time'?: undefined | string; + 'pri.refresh.external_total'?: undefined | string; + 'pri.refresh.listeners'?: undefined | string; + 'pri.refresh.time'?: undefined | string; + 'pri.refresh.total'?: undefined | string; + 'pri.request_cache.evictions'?: undefined | string; + 'pri.request_cache.hit_count'?: undefined | string; + 'pri.request_cache.memory_size'?: undefined | string; + 'pri.request_cache.miss_count'?: undefined | string; + 'pri.search.concurrent_avg_slice_count'?: undefined | string; + 'pri.search.concurrent_query_current'?: undefined | string; + 'pri.search.concurrent_query_time'?: undefined | string; + 'pri.search.concurrent_query_total'?: undefined | string; + 'pri.search.fetch_current'?: undefined | string; + 'pri.search.fetch_time'?: undefined | string; + 'pri.search.fetch_total'?: undefined | string; + 'pri.search.open_contexts'?: undefined | string; + 'pri.search.point_in_time_current'?: undefined | string; + 'pri.search.point_in_time_time'?: undefined | string; + 'pri.search.point_in_time_total'?: undefined | string; + 'pri.search.query_current'?: undefined | string; + 'pri.search.query_time'?: undefined | string; + 'pri.search.query_total'?: undefined | string; + 'pri.search.scroll_current'?: undefined | string; + 'pri.search.scroll_time'?: undefined | string; + 'pri.search.scroll_total'?: undefined | string; + 'pri.segments.count'?: undefined | string; + 'pri.segments.fixed_bitset_memory'?: undefined | string; + 'pri.segments.index_writer_memory'?: undefined | string; + 'pri.segments.memory'?: undefined | string; + 'pri.segments.version_map_memory'?: undefined | string; 'pri.store.size'?: undefined | string; - 'pri.suggest.current'?: string; - 'pri.suggest.time'?: string; - 'pri.suggest.total'?: string; - 'pri.warmer.current'?: string; - 'pri.warmer.total'?: string; - 'pri.warmer.total_time'?: string; - 'query_cache.evictions'?: string; - 'query_cache.memory_size'?: string; - 'refresh.external_time'?: string; - 'refresh.external_total'?: string; - 'refresh.listeners'?: string; - 'refresh.time'?: string; - 'refresh.total'?: string; + 'pri.suggest.current'?: undefined | string; + 'pri.suggest.time'?: undefined | string; + 'pri.suggest.total'?: undefined | string; + 'pri.warmer.current'?: undefined | string; + 'pri.warmer.total'?: undefined | string; + 'pri.warmer.total_time'?: undefined | string; + 'query_cache.evictions'?: undefined | string; + 'query_cache.memory_size'?: undefined | string; + 'refresh.external_time'?: undefined | string; + 'refresh.external_total'?: undefined | string; + 'refresh.listeners'?: undefined | string; + 'refresh.time'?: undefined | string; + 'refresh.total'?: undefined | string; rep?: string; - 'request_cache.evictions'?: string; - 'request_cache.hit_count'?: string; - 'request_cache.memory_size'?: string; - 'request_cache.miss_count'?: string; - 'search.fetch_current'?: string; - 'search.fetch_time'?: string; - 'search.fetch_total'?: string; - 'search.open_contexts'?: string; - 'search.query_current'?: string; - 'search.query_time'?: string; - 'search.query_total'?: string; - 'search.scroll_current'?: string; - 'search.scroll_time'?: string; - 'search.scroll_total'?: string; + 'request_cache.evictions'?: undefined | string; + 'request_cache.hit_count'?: undefined | string; + 'request_cache.memory_size'?: undefined | string; + 'request_cache.miss_count'?: undefined | string; + 'search.concurrent_avg_slice_count'?: undefined | string; + 'search.concurrent_query_current'?: undefined | string; + 'search.concurrent_query_time'?: undefined | string; + 'search.concurrent_query_total'?: undefined | string; + 'search.fetch_current'?: undefined | string; + 'search.fetch_time'?: undefined | string; + 'search.fetch_total'?: undefined | string; + 'search.open_contexts'?: undefined | string; + 'search.point_in_time_current'?: undefined | string; + 'search.point_in_time_time'?: undefined | string; + 'search.point_in_time_total'?: undefined | string; + 'search.query_current'?: undefined | string; + 'search.query_time'?: undefined | string; + 'search.query_total'?: undefined | string; + 'search.scroll_current'?: undefined | string; + 'search.scroll_time'?: undefined | string; + 'search.scroll_total'?: undefined | string; 'search.throttled'?: string; - 'segments.count'?: string; - 'segments.fixed_bitset_memory'?: string; - 'segments.index_writer_memory'?: string; - 'segments.memory'?: string; - 'segments.version_map_memory'?: string; + 'segments.count'?: undefined | string; + 'segments.fixed_bitset_memory'?: undefined | string; + 'segments.index_writer_memory'?: undefined | string; + 'segments.memory'?: undefined | string; + 'segments.version_map_memory'?: undefined | string; status?: string; 'store.size'?: undefined | string; - 'suggest.current'?: string; - 'suggest.time'?: string; - 'suggest.total'?: string; + 'suggest.current'?: undefined | string; + 'suggest.time'?: undefined | string; + 'suggest.total'?: undefined | string; uuid?: string; - 'warmer.current'?: string; - 'warmer.total'?: string; - 'warmer.total_time'?: string; + 'warmer.current'?: undefined | string; + 'warmer.total'?: undefined | string; + 'warmer.total_time'?: undefined | string; } diff --git a/api/_types/cat.nodes.d.ts b/api/_types/cat.nodes.d.ts index 8a5340d22..22b9c4e09 100644 --- a/api/_types/cat.nodes.d.ts +++ b/api/_types/cat.nodes.d.ts @@ -26,9 +26,9 @@ export interface NodesRecord { cluster_manager?: string; 'completion.size'?: string; cpu?: string; - 'disk.avail'?: Common.ByteSize; - 'disk.total'?: Common.ByteSize; - 'disk.used'?: Common.ByteSize; + 'disk.avail'?: string; + 'disk.total'?: string; + 'disk.used'?: string; 'disk.used_percent'?: Common.Percentage; 'fielddata.evictions'?: string; 'fielddata.memory_size'?: string; @@ -94,10 +94,17 @@ export interface NodesRecord { 'script.cache_evictions'?: string; 'script.compilation_limit_triggered'?: string; 'script.compilations'?: string; + 'search.concurrent_avg_slice_count'?: string; + 'search.concurrent_query_current'?: string; + 'search.concurrent_query_time'?: string; + 'search.concurrent_query_total'?: string; 'search.fetch_current'?: string; 'search.fetch_time'?: string; 'search.fetch_total'?: string; 'search.open_contexts'?: string; + 'search.point_in_time_current'?: string; + 'search.point_in_time_time'?: string; + 'search.point_in_time_total'?: string; 'search.query_current'?: string; 'search.query_time'?: string; 'search.query_total'?: string; diff --git a/api/_types/cat.recovery.d.ts b/api/_types/cat.recovery.d.ts index 233ee551e..ad0ceffb6 100644 --- a/api/_types/cat.recovery.d.ts +++ b/api/_types/cat.recovery.d.ts @@ -33,9 +33,9 @@ export interface RecoveryRecord { source_node?: string; stage?: string; start_time?: Common.DateTime; - start_time_millis?: Common.EpochTimeUnitMillis; + start_time_millis?: Common.StringifiedEpochTimeUnitMillis; stop_time?: Common.DateTime; - stop_time_millis?: Common.EpochTimeUnitMillis; + stop_time_millis?: Common.StringifiedEpochTimeUnitMillis; target_host?: string; target_node?: string; time?: Common.Duration; diff --git a/api/_types/cat.segments.d.ts b/api/_types/cat.segments.d.ts index 30af8d6ae..c0319b293 100644 --- a/api/_types/cat.segments.d.ts +++ b/api/_types/cat.segments.d.ts @@ -29,8 +29,8 @@ export interface SegmentsRecord { searchable?: string; segment?: string; shard?: string; - size?: Common.ByteSize; - 'size.memory'?: Common.ByteSize; + size?: Common.StorageSize; + 'size.memory'?: string; version?: Common.VersionString; } diff --git a/api/_types/cat.shards.d.ts b/api/_types/cat.shards.d.ts index 228647410..3dd820baa 100644 --- a/api/_types/cat.shards.d.ts +++ b/api/_types/cat.shards.d.ts @@ -16,81 +16,90 @@ export interface ShardsRecord { - 'bulk.avg_size_in_bytes'?: string; - 'bulk.avg_time'?: string; - 'bulk.total_operations'?: string; - 'bulk.total_size_in_bytes'?: string; - 'bulk.total_time'?: string; - 'completion.size'?: string; + 'bulk.avg_size_in_bytes'?: undefined | string; + 'bulk.avg_time'?: undefined | string; + 'bulk.total_operations'?: undefined | string; + 'bulk.total_size_in_bytes'?: undefined | string; + 'bulk.total_time'?: undefined | string; + 'completion.size'?: undefined | string; docs?: undefined | string; - 'fielddata.evictions'?: string; - 'fielddata.memory_size'?: string; - 'flush.total'?: string; - 'flush.total_time'?: string; - 'get.current'?: string; - 'get.exists_time'?: string; - 'get.exists_total'?: string; - 'get.missing_time'?: string; - 'get.missing_total'?: string; - 'get.time'?: string; - 'get.total'?: string; - id?: string; + 'docs.deleted'?: undefined | string; + 'fielddata.evictions'?: undefined | string; + 'fielddata.memory_size'?: undefined | string; + 'flush.total'?: undefined | string; + 'flush.total_time'?: undefined | string; + 'get.current'?: undefined | string; + 'get.exists_time'?: undefined | string; + 'get.exists_total'?: undefined | string; + 'get.missing_time'?: undefined | string; + 'get.missing_total'?: undefined | string; + 'get.time'?: undefined | string; + 'get.total'?: undefined | string; + id?: undefined | string; index?: string; - 'indexing.delete_current'?: string; - 'indexing.delete_time'?: string; - 'indexing.delete_total'?: string; - 'indexing.index_current'?: string; - 'indexing.index_failed'?: string; - 'indexing.index_time'?: string; - 'indexing.index_total'?: string; + 'indexing.delete_current'?: undefined | string; + 'indexing.delete_time'?: undefined | string; + 'indexing.delete_total'?: undefined | string; + 'indexing.index_current'?: undefined | string; + 'indexing.index_failed'?: undefined | string; + 'indexing.index_time'?: undefined | string; + 'indexing.index_total'?: undefined | string; ip?: undefined | string; - 'merges.current'?: string; - 'merges.current_docs'?: string; - 'merges.current_size'?: string; - 'merges.total'?: string; - 'merges.total_docs'?: string; - 'merges.total_size'?: string; - 'merges.total_time'?: string; + 'merges.current'?: undefined | string; + 'merges.current_docs'?: undefined | string; + 'merges.current_size'?: undefined | string; + 'merges.total'?: undefined | string; + 'merges.total_docs'?: undefined | string; + 'merges.total_size'?: undefined | string; + 'merges.total_time'?: undefined | string; node?: undefined | string; - 'path.data'?: string; - 'path.state'?: string; + 'path.data'?: undefined | string; + 'path.state'?: undefined | string; prirep?: string; - 'query_cache.evictions'?: string; - 'query_cache.memory_size'?: string; - 'recoverysource.type'?: string; - 'refresh.external_time'?: string; - 'refresh.external_total'?: string; - 'refresh.listeners'?: string; - 'refresh.time'?: string; - 'refresh.total'?: string; - 'search.fetch_current'?: string; - 'search.fetch_time'?: string; - 'search.fetch_total'?: string; - 'search.open_contexts'?: string; - 'search.query_current'?: string; - 'search.query_time'?: string; - 'search.query_total'?: string; - 'search.scroll_current'?: string; - 'search.scroll_time'?: string; - 'search.scroll_total'?: string; - 'segments.count'?: string; - 'segments.fixed_bitset_memory'?: string; - 'segments.index_writer_memory'?: string; - 'segments.memory'?: string; - 'segments.version_map_memory'?: string; - 'seq_no.global_checkpoint'?: string; - 'seq_no.local_checkpoint'?: string; - 'seq_no.max'?: string; + 'query_cache.evictions'?: undefined | string; + 'query_cache.memory_size'?: undefined | string; + 'recoverysource.type'?: undefined | string; + 'refresh.external_time'?: undefined | string; + 'refresh.external_total'?: undefined | string; + 'refresh.listeners'?: undefined | string; + 'refresh.time'?: undefined | string; + 'refresh.total'?: undefined | string; + 'search.concurrent_avg_slice_count'?: undefined | string; + 'search.concurrent_query_current'?: undefined | string; + 'search.concurrent_query_time'?: undefined | string; + 'search.concurrent_query_total'?: undefined | string; + 'search.fetch_current'?: undefined | string; + 'search.fetch_time'?: undefined | string; + 'search.fetch_total'?: undefined | string; + 'search.open_contexts'?: undefined | string; + 'search.point_in_time_current'?: undefined | string; + 'search.point_in_time_time'?: undefined | string; + 'search.point_in_time_total'?: undefined | string; + 'search.query_current'?: undefined | string; + 'search.query_time'?: undefined | string; + 'search.query_total'?: undefined | string; + 'search.scroll_current'?: undefined | string; + 'search.scroll_time'?: undefined | string; + 'search.scroll_total'?: undefined | string; + 'search.search_idle_reactivate_count_total'?: undefined | string; + 'segments.count'?: undefined | string; + 'segments.fixed_bitset_memory'?: undefined | string; + 'segments.index_writer_memory'?: undefined | string; + 'segments.memory'?: undefined | string; + 'segments.version_map_memory'?: undefined | string; + 'seq_no.global_checkpoint'?: undefined | string; + 'seq_no.local_checkpoint'?: undefined | string; + 'seq_no.max'?: undefined | string; shard?: string; state?: string; store?: undefined | string; - sync_id?: string; - 'unassigned.at'?: string; - 'unassigned.details'?: string; - 'unassigned.for'?: string; - 'unassigned.reason'?: string; - 'warmer.current'?: string; - 'warmer.total'?: string; - 'warmer.total_time'?: string; + sync_id?: undefined | string; + 'unassigned.at'?: undefined | string; + 'unassigned.details'?: undefined | string; + 'unassigned.for'?: undefined | string; + 'unassigned.reason'?: undefined | string; + 'warmer.current'?: undefined | string; + 'warmer.total'?: undefined | string; + 'warmer.total_time'?: undefined | string; } diff --git a/api/_types/cat.thread_pool.d.ts b/api/_types/cat.thread_pool.d.ts index 3f02f37a1..62e99f254 100644 --- a/api/_types/cat.thread_pool.d.ts +++ b/api/_types/cat.thread_pool.d.ts @@ -36,6 +36,7 @@ export interface ThreadPoolRecord { queue_size?: string; rejected?: string; size?: undefined | string; + total_wait_time?: string; type?: string; } diff --git a/api/_types/cluster.allocation_explain.d.ts b/api/_types/cluster.allocation_explain.d.ts index ad0aca098..71e8b3164 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: number; + matching_size_in_bytes: Common.Bytes; 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,11 +52,14 @@ 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_bytes: number; + free?: Common.StorageSize; + free_bytes: Common.Bytes; free_disk_percent: number; path: string; - total_bytes: number; - used_bytes: number; + total?: Common.StorageSize; + total_bytes: Common.Bytes; + used?: Common.StorageSize; + used_bytes: Common.Bytes; used_disk_percent: number; } diff --git a/api/_types/cluster.decommission_awareness.d.ts b/api/_types/cluster.decommission_awareness.d.ts new file mode 100644 index 000000000..0cb185df7 --- /dev/null +++ b/api/_types/cluster.decommission_awareness.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + + +export type DecommissionStatusResponse = ZoneDecommissionStatusResponse + +export type ZoneDecommissionStatusResponse = Record + diff --git a/api/_types/cluster.health.d.ts b/api/_types/cluster.health.d.ts index 412fc21ba..0e3f1def8 100644 --- a/api/_types/cluster.health.d.ts +++ b/api/_types/cluster.health.d.ts @@ -16,12 +16,24 @@ import * as Common from './_common' +export interface AwarenessAttributeStats { + active_shards?: number; + data_nodes?: number; + initializing_shards?: number; + relocating_shards?: number; + unassigned_shards?: number; + weight?: number; +} + export interface HealthResponseBody { active_primary_shards: number; active_shards: number; active_shards_percent_as_number: Common.Percentage; + awareness_attributes?: Record; cluster_name: Common.Name; delayed_unassigned_shards: number; + discovered_cluster_manager?: boolean; + discovered_master?: boolean; indices?: Record; initializing_shards: number; number_of_data_nodes: number; diff --git a/api/_types/cluster.stats.d.ts b/api/_types/cluster.stats.d.ts index 1481336c0..c1390513d 100644 --- a/api/_types/cluster.stats.d.ts +++ b/api/_types/cluster.stats.d.ts @@ -29,9 +29,14 @@ export interface CharFilterTypes { } export interface ClusterFileSystem { - available_in_bytes: number; - free_in_bytes: number; - total_in_bytes: number; + 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; } export interface ClusterIndices { @@ -67,6 +72,7 @@ export interface ClusterIngest { } export interface ClusterJvm { + max_uptime?: Common.Duration; max_uptime_in_millis: Common.DurationValueUnitMillis; mem: ClusterJvmMemory; threads: number; @@ -74,8 +80,10 @@ export interface ClusterJvm { } export interface ClusterJvmMemory { - heap_max_in_bytes: number; - heap_used_in_bytes: number; + heap_max?: Common.StorageSize; + heap_max_in_bytes: Common.Bytes; + heap_used?: Common.StorageSize; + heap_used_in_bytes: Common.Bytes; } export interface ClusterJvmVersion { @@ -94,27 +102,29 @@ export interface ClusterNetworkTypes { } export interface ClusterNodeCount { + cluster_manager?: number; coordinating_only: number; data: number; - data_cold: number; - data_content: number; + data_cold?: number; + data_content?: number; data_frozen?: number; - data_hot: number; - data_warm: number; + data_hot?: number; + data_warm?: number; ingest: number; master: number; - ml: number; + ml?: number; remote_cluster_client: number; + search?: number; total: number; - transform: number; - voting_only: number; + transform?: number; + voting_only?: number; } export interface ClusterNodes { count: ClusterNodeCount; discovery_types: Record; fs: ClusterFileSystem; - indexing_pressure: IndexingPressure; + indexing_pressure?: IndexingPressure; ingest: ClusterIngest; jvm: ClusterJvm; network_types: ClusterNetworkTypes; @@ -192,8 +202,8 @@ export interface FieldTypesMappings { field_types: FieldTypes[]; runtime_field_types?: RuntimeFieldTypes[]; total_deduplicated_field_count?: number; - total_deduplicated_mapping_size?: Common.ByteSize; - total_deduplicated_mapping_size_in_bytes?: number; + total_deduplicated_mapping_size?: Common.StorageSize; + total_deduplicated_mapping_size_in_bytes?: Common.Bytes; total_field_count?: number; } @@ -203,40 +213,43 @@ export interface IndexingPressure { export interface IndexingPressureMemory { current: IndexingPressureMemorySummary; - limit_in_bytes: number; + limit_in_bytes: Common.Bytes; total: IndexingPressureMemorySummary; } export interface IndexingPressureMemorySummary { - all_in_bytes: number; - combined_coordinating_and_primary_in_bytes: number; - coordinating_in_bytes: number; + all_in_bytes: Common.Bytes; + combined_coordinating_and_primary_in_bytes: Common.Bytes; + coordinating_in_bytes: Common.Bytes; coordinating_rejections?: number; - primary_in_bytes: number; + primary_in_bytes: Common.Bytes; primary_rejections?: number; - replica_in_bytes: number; + replica_in_bytes: Common.Bytes; replica_rejections?: number; } export interface IndicesVersions { index_count: number; primary_shard_count: number; - total_primary_bytes: number; + total_primary_bytes: Common.Bytes; version: Common.VersionString; } export interface NodePackagingType { count: number; - flavor: string; + flavor?: string; type: string; } export interface OperatingSystemMemoryInfo { - adjusted_total_in_bytes?: number; - free_in_bytes: number; + adjusted_total_in_bytes?: Common.Bytes; + free?: Common.StorageSize; + free_in_bytes: Common.Bytes; free_percent: number; - total_in_bytes: number; - used_in_bytes: number; + total?: Common.StorageSize; + total_in_bytes: Common.Bytes; + used?: Common.StorageSize; + used_in_bytes: Common.Bytes; used_percent: number; } diff --git a/api/_types/cluster.weighted_routing.d.ts b/api/_types/cluster.weighted_routing.d.ts new file mode 100644 index 000000000..0daccbaa5 --- /dev/null +++ b/api/_types/cluster.weighted_routing.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 * as Common from './_common' + +export interface Weights extends WeightsBase { + weights?: Record; +} + +export interface WeightsBase { + _version?: Common.VersionNumber; +} + +export interface WeightsResponse extends Weights { + discovered_cluster_manager?: boolean; +} + diff --git a/api/_types/flow_framework.common.d.ts b/api/_types/flow_framework.common.d.ts new file mode 100644 index 000000000..688043d56 --- /dev/null +++ b/api/_types/flow_framework.common.d.ts @@ -0,0 +1,71 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + + +export interface FlowFrameworkCreate { + description?: string; + name: string; + use_case?: string; + version?: version; + workflows?: Record; +} + +export interface FlowFrameworkDeleteResponse { + _id?: string; + _index?: string; + _primary_term?: number; + _seq_no?: number; + _shards?: shards; + _version?: number; + result?: 'deleted' | 'not_found'; +} + +export interface FlowFrameworkGetResponse { + created_time?: number; + description?: string; + last_updated_time?: number; + name?: string; + use_case?: string; + user?: user; + workflows?: Record; +} + +export interface FlowFrameworkUpdate { + description?: string; + name?: string; + use_case?: string; + version?: version; +} + +export interface shards { + failed?: number; + successful?: number; + total?: number; +} + +export interface user { + backend_roles?: string[]; + custom_attribute_names?: string[]; + name?: string; + roles?: string[]; + user_requested_tenant?: string; +} + +export interface version { + compatibility?: string[]; + template?: string; +} + diff --git a/api/_types/flow_framework.errors.d.ts b/api/_types/flow_framework.errors.d.ts new file mode 100644 index 000000000..540e29dda --- /dev/null +++ b/api/_types/flow_framework.errors.d.ts @@ -0,0 +1,35 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + + +export type BadRequestError = Record + +export type ConflictError = Record + +export type FlowFrameworkAPIDisabledError = Record + +export type MaxWorkflowsLimitError = Record + +export type MissingParameterError = Record + +export type ParameterConflictError = Record + +export type TemplateNotFoundError = Record + +export type WorkFlowIdNullError = Record + +export type WorkflowSaveError = Record + diff --git a/api/_types/indices._common.d.ts b/api/_types/indices._common.d.ts index f50626d9d..d9ed806da 100644 --- a/api/_types/indices._common.d.ts +++ b/api/_types/indices._common.d.ts @@ -80,13 +80,13 @@ export interface DataStreamLifecycleRolloverConditions { max_age?: string; max_docs?: number; max_primary_shard_docs?: number; - max_primary_shard_size?: Common.ByteSize; - max_size?: Common.ByteSize; + max_primary_shard_size?: Common.StorageSize; + max_size?: Common.StorageSize; min_age?: Common.Duration; min_docs?: number; min_primary_shard_docs?: number; - min_primary_shard_size?: Common.ByteSize; - min_size?: Common.ByteSize; + min_primary_shard_size?: Common.StorageSize; + min_size?: Common.StorageSize; } export interface DataStreamLifecycleWithRollover { @@ -486,7 +486,7 @@ export interface TemplateMapping { export interface Translog { durability?: TranslogDurability; - flush_threshold_size?: Common.ByteSize; + flush_threshold_size?: Common.StorageSize; retention?: TranslogRetention; sync_interval?: Common.Duration; } @@ -495,6 +495,6 @@ export type TranslogDurability = 'async' | 'request' export interface TranslogRetention { age?: Common.Duration; - size?: Common.ByteSize; + size?: Common.StorageSize; } diff --git a/api/_types/indices.data_streams_stats.d.ts b/api/_types/indices.data_streams_stats.d.ts index f6b73d24d..6131cc6d9 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.ByteSize; - store_size_bytes: number; + store_size?: Common.StorageSize; + store_size_bytes: Common.Bytes; } diff --git a/api/_types/indices.recovery.d.ts b/api/_types/indices.recovery.d.ts index 3b59e2cc1..3b7286c9c 100644 --- a/api/_types/indices.recovery.d.ts +++ b/api/_types/indices.recovery.d.ts @@ -24,14 +24,14 @@ export interface FileDetails { export interface RecoveryBytes { percent: Common.Percentage; - recovered?: Common.ByteSize; - recovered_from_snapshot?: Common.ByteSize; - recovered_from_snapshot_in_bytes?: Common.ByteSize; - recovered_in_bytes: Common.ByteSize; - reused?: Common.ByteSize; - reused_in_bytes: Common.ByteSize; - total?: Common.ByteSize; - total_in_bytes: Common.ByteSize; + 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; } export interface RecoveryFiles { diff --git a/api/_types/indices.rollover.d.ts b/api/_types/indices.rollover.d.ts index 552fa035d..d7ebbe475 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.ByteSize; - max_primary_shard_size_bytes?: number; - max_size?: Common.ByteSize; - max_size_bytes?: number; + max_primary_shard_size?: Common.StorageSize; + max_primary_shard_size_bytes?: Common.Bytes; + max_size?: Common.StorageSize; + max_size_bytes?: Common.Bytes; min_age?: Common.Duration; min_docs?: number; min_primary_shard_docs?: number; - min_primary_shard_size?: Common.ByteSize; - min_primary_shard_size_bytes?: number; - min_size?: Common.ByteSize; - min_size_bytes?: number; + min_primary_shard_size?: Common.StorageSize; + min_primary_shard_size_bytes?: Common.Bytes; + min_size?: Common.StorageSize; + min_size_bytes?: Common.Bytes; } diff --git a/api/_types/indices.segments.d.ts b/api/_types/indices.segments.d.ts index 245f54f4a..0a37e1865 100644 --- a/api/_types/indices.segments.d.ts +++ b/api/_types/indices.segments.d.ts @@ -17,7 +17,7 @@ import * as Common from './_common' export interface IndexSegment { - shards: Record; + shards: Record; } export interface Segment { @@ -26,9 +26,12 @@ export interface Segment { compound: boolean; deleted_docs: number; generation: number; + memory?: Common.StorageSize; + memory_in_bytes?: Common.Bytes; num_docs: number; search: boolean; - size_in_bytes: number; + size?: Common.StorageSize; + size_in_bytes: Common.Bytes; version: Common.VersionString; } diff --git a/api/_types/indices.stats.d.ts b/api/_types/indices.stats.d.ts index a784f82c8..7f4ad4f2c 100644 --- a/api/_types/indices.stats.d.ts +++ b/api/_types/indices.stats.d.ts @@ -16,17 +16,28 @@ import * as Common from './_common' -export type IndexMetadataState = 'close' | 'open' +export interface AllIndicesStats { + primaries: IndexStats; + total: IndexStats; +} + +export interface IndexShardStats extends IndexStatsBase { + commit?: ShardCommit; + retention_leases?: ShardRetentionLeases; + routing?: ShardRouting; + seq_no?: ShardSequenceNumber; + shard_path?: ShardPath; +} -export interface IndexStats { - bulk?: Common.BulkStats; +export type IndexStats = IndexStatsBase & Record + +export interface IndexStatsBase { completion?: Common.CompletionStats; docs?: Common.DocStats; fielddata?: Common.FielddataStats; flush?: Common.FlushStats; get?: Common.GetStats; indexing?: Common.IndexingStats; - indices?: IndicesStats; merges?: Common.MergesStats; query_cache?: Common.QueryCacheStats; recovery?: Common.RecoveryStats; @@ -34,25 +45,16 @@ export interface IndexStats { request_cache?: Common.RequestCacheStats; search?: Common.SearchStats; segments?: Common.SegmentsStats; - shard_stats?: ShardsTotalStats; store?: Common.StoreStats; translog?: Common.TranslogStats; warmer?: Common.WarmerStats; } export interface IndicesStats { - health?: Common.HealthStatus; - primaries?: IndexStats; - shards?: Record; - status?: IndexMetadataState; - total?: IndexStats; - uuid?: Common.Uuid; -} - -export interface MappingStats { - total_count: number; - total_estimated_overhead?: Common.ByteSize; - total_estimated_overhead_in_bytes: number; + primaries: IndexStats; + shards?: Record; + total: IndexStats; + uuid: Common.Uuid; } export interface ShardCommit { @@ -63,12 +65,13 @@ export interface ShardCommit { } export interface ShardFileSizeInfo { - average_size_in_bytes?: number; + average_size_in_bytes?: Common.Bytes; count?: number; description: string; - max_size_in_bytes?: number; - min_size_in_bytes?: number; - size_in_bytes: number; + max_size_in_bytes?: Common.Bytes; + min_size_in_bytes?: Common.Bytes; + size?: Common.StorageSize; + size_in_bytes: Common.Bytes; } export interface ShardLease { @@ -84,16 +87,6 @@ export interface ShardPath { state_path: string; } -export interface ShardQueryCache { - cache_count: number; - cache_size: number; - evictions: number; - hit_count: number; - memory_size_in_bytes: number; - miss_count: number; - total_count: number; -} - export interface ShardRetentionLeases { leases: ShardLease[]; primary_term: number; @@ -115,36 +108,3 @@ export interface ShardSequenceNumber { max_seq_no: Common.SequenceNumber; } -export interface ShardStats { - bulk?: Common.BulkStats; - commit?: ShardCommit; - completion?: Common.CompletionStats; - docs?: Common.DocStats; - fielddata?: Common.FielddataStats; - flush?: Common.FlushStats; - get?: Common.GetStats; - indexing?: Common.IndexingStats; - indices?: IndicesStats; - mappings?: MappingStats; - merges?: Common.MergesStats; - query_cache?: ShardQueryCache; - recovery?: Common.RecoveryStats; - refresh?: Common.RefreshStats; - request_cache?: Common.RequestCacheStats; - retention_leases?: ShardRetentionLeases; - routing?: ShardRouting; - search?: Common.SearchStats; - segments?: Common.SegmentsStats; - seq_no?: ShardSequenceNumber; - shard_path?: ShardPath; - shard_stats?: ShardsTotalStats; - shards?: Record>; - store?: Common.StoreStats; - translog?: Common.TranslogStats; - warmer?: Common.WarmerStats; -} - -export interface ShardsTotalStats { - total_count: number; -} - diff --git a/api/_types/ml._common.d.ts b/api/_types/ml._common.d.ts index 2cf0b55fa..63c40a2dc 100644 --- a/api/_types/ml._common.d.ts +++ b/api/_types/ml._common.d.ts @@ -57,12 +57,22 @@ export interface SearchModelsResponse { export interface Task { create_time?: number; + error?: string; function_name?: string; is_async?: boolean; last_update_time?: number; model_id?: string; state: 'CANCELLED' | 'COMPLETED' | 'COMPLETED_WITH_ERROR' | 'CREATED' | 'FAILED' | 'RUNNING'; - task_type?: 'DEPLOY_MODEL'; + task_id?: string; + task_type?: 'DEPLOY_MODEL' | 'REGISTER_MODEL'; worker_node?: Common.NodeIds[]; } +export interface UndeployModelNode { + stats?: UndeployModelNodeStats; +} + +export type UndeployModelNodeStats = Record + +export type UndeployModelResponse = Record + diff --git a/api/_types/nodes._common.d.ts b/api/_types/nodes._common.d.ts index 4b55362ff..d9be31eb2 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?: string; - estimated_size_in_bytes?: number; - limit_size?: string; - limit_size_in_bytes?: number; + estimated_size?: Common.StorageSize; + estimated_size_in_bytes?: Common.Bytes; + limit_size?: Common.StorageSize; + limit_size_in_bytes?: Common.Bytes; overhead?: number; tripped?: number; } @@ -71,7 +71,7 @@ export interface Client { opened_time_millis?: number; remote_address?: string; request_count?: number; - request_size_bytes?: number; + request_size_bytes?: Common.Bytes; x_opaque_id?: string; } @@ -137,22 +137,23 @@ export interface CpuAcct { } export interface DataPathStats { - available?: string; - available_in_bytes?: number; - cache_reserved_in_bytes?: number; + available?: Common.StorageSize; + available_in_bytes?: Common.Bytes; + cache_reserved?: Common.StorageSize; + cache_reserved_in_bytes?: Common.Bytes; disk_queue?: string; - disk_read_size?: string; - disk_read_size_in_bytes?: number; + disk_read_size?: Common.StorageSize; + disk_read_size_in_bytes?: Common.Bytes; disk_reads?: number; - disk_write_size?: string; - disk_write_size_in_bytes?: number; + disk_write_size?: Common.StorageSize; + disk_write_size_in_bytes?: Common.Bytes; disk_writes?: number; - free?: string; - free_in_bytes?: number; + free?: Common.StorageSize; + free_in_bytes?: Common.Bytes; mount?: string; path?: string; - total?: string; - total_in_bytes?: number; + total?: Common.StorageSize; + total_in_bytes?: Common.Bytes; type?: string; } @@ -178,13 +179,14 @@ export interface FileSystem { } export interface FileSystemTotal { - available?: string; - available_in_bytes?: number; - cache_reserved_in_bytes?: number; - free?: string; - free_in_bytes?: number; - total?: string; - total_in_bytes?: number; + 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; } export interface GarbageCollector { @@ -209,8 +211,8 @@ export interface IndexingPressure { export interface IndexingPressureMemory { current?: PressureMemory; - limit?: Common.ByteSize; - limit_in_bytes?: number; + limit?: Common.StorageSize; + limit_in_bytes?: Common.Bytes; total?: PressureMemory; } @@ -224,16 +226,21 @@ export interface IngestTotal { current?: number; failed?: number; processors?: Record[]; + time?: Common.Duration; time_in_millis?: Common.DurationValueUnitMillis; } export interface IoStatDevice { device_name?: string; + io_time_in_millis?: Common.DurationValueUnitMillis; operations?: number; + queue_size?: number; read_kilobytes?: number; read_operations?: number; + read_time?: number; write_kilobytes?: number; write_operations?: number; + write_time?: number; } export interface IoStats { @@ -259,12 +266,17 @@ export interface JvmClasses { } export interface JvmMemoryStats { - heap_committed_in_bytes?: number; - heap_max_in_bytes?: number; - heap_used_in_bytes?: number; + 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_in_bytes?: number; - non_heap_used_in_bytes?: 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; pools?: Record; } @@ -279,30 +291,35 @@ export interface KeyedProcessor { } export interface LastGcStats { - max_in_bytes?: number; + max?: Common.StorageSize; + max_in_bytes?: Common.Bytes; usage_percent?: number; - used_in_bytes?: number; + used?: Common.StorageSize; + used_in_bytes?: Common.Bytes; } export interface MemoryStats { - adjusted_total_in_bytes?: number; - free_in_bytes?: number; - resident?: string; - resident_in_bytes?: number; - share?: string; - share_in_bytes?: number; - total_in_bytes?: number; - total_virtual?: string; - total_virtual_in_bytes?: number; - used_in_bytes?: number; + 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; } export interface NodeBufferPool { count?: number; - total_capacity?: string; - total_capacity_in_bytes?: number; - used?: string; - used_in_bytes?: number; + total_capacity?: Common.StorageSize; + total_capacity_in_bytes?: Common.Bytes; + used?: Common.StorageSize; + used_in_bytes?: Common.Bytes; } export interface NodeReloadError { @@ -326,25 +343,29 @@ export interface OperatingSystem { export interface Pool { last_gc_stats?: LastGcStats; - max_in_bytes?: number; - peak_max_in_bytes?: number; - peak_used_in_bytes?: number; - used_in_bytes?: number; + 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; } export interface PressureMemory { - all?: Common.ByteSize; - all_in_bytes?: number; - combined_coordinating_and_primary?: Common.ByteSize; - combined_coordinating_and_primary_in_bytes?: number; - coordinating?: Common.ByteSize; - coordinating_in_bytes?: number; + 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; coordinating_rejections?: number; - primary?: Common.ByteSize; - primary_in_bytes?: number; + primary?: Common.StorageSize; + primary_in_bytes?: Common.Bytes; primary_rejections?: number; - replica?: Common.ByteSize; - replica_in_bytes?: number; + replica?: Common.StorageSize; + replica_in_bytes?: Common.Bytes; replica_rejections?: number; } @@ -399,11 +420,11 @@ export interface SerializedClusterState { } export interface SerializedClusterStateDetail { - compressed_size?: string; - compressed_size_in_bytes?: number; + compressed_size?: Common.StorageSize; + compressed_size_in_bytes?: Common.Bytes; count?: number; - uncompressed_size?: string; - uncompressed_size_in_bytes?: number; + uncompressed_size?: Common.StorageSize; + uncompressed_size_in_bytes?: Common.Bytes; } export interface ShardAdmissionControlStats { @@ -418,7 +439,8 @@ export interface ShardCacheStats { hit_count?: number; item_count?: number; miss_count?: number; - size_in_bytes?: number; + size?: Common.StorageSize; + size_in_bytes?: Common.Bytes; store_name?: string; } @@ -435,7 +457,8 @@ export interface ShardIndexingPressureStats { enabled?: boolean; enforced?: boolean; stats?: Record; - total_rejections_breakup_shadow_mode?: TotalRejectionsBreakupShadowMode; + total_rejections_breakup?: TotalRejectionsBreakup; + total_rejections_breakup_shadow_mode?: TotalRejectionsBreakup; } export type ShardRepositoriesStats = any[] @@ -464,25 +487,34 @@ export interface ShardSearchBackpressureStats { export interface ShardSearchBackpressureTaskCancellationStats { cancellation_count?: number; cancellation_limit_reached_count?: number; + cancelled_task_percentage?: number; + current_cancellation_eligible_tasks_count?: number; } export interface ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats { cancellation_count?: number; + current_avg?: Common.Duration; current_avg_millis?: Common.DurationValueUnitMillis; + current_max?: Common.Duration; current_max_millis?: Common.DurationValueUnitMillis; } export interface ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats { cancellation_count?: number; + current_avg?: Common.Duration; current_avg_millis?: Common.DurationValueUnitMillis; + current_max?: Common.Duration; current_max_millis?: Common.DurationValueUnitMillis; } export interface ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats { cancellation_count?: number; - current_avg_bytes?: number; - current_max_bytes?: number; - rolling_avg_bytes?: 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; } export interface ShardSearchBackpressureTaskResourceTrackerStats { @@ -507,6 +539,7 @@ export interface ShardSearchPipelineTotalStats { count?: number; current?: number; failed?: number; + time?: Common.Duration; time_in_millis?: Common.DurationValueUnitMillis; } @@ -543,7 +576,7 @@ export interface Stats { host?: Common.Host; http?: Http; indexing_pressure?: IndexingPressure; - indices?: Indices_Stats.ShardStats; + indices?: Indices_Stats.IndexShardStats; ingest?: Ingest; ip?: Common.Ip | Common.Ip[]; jvm?: Jvm; @@ -574,10 +607,11 @@ export interface ThreadCount { queue?: number; rejected?: number; threads?: number; + total_wait_time?: Common.Duration; total_wait_time_in_nanos?: number; } -export interface TotalRejectionsBreakupShadowMode { +export interface TotalRejectionsBreakup { no_successful_request_limits?: number; node_limits?: number; throughput_degradation_limits?: number; @@ -587,13 +621,13 @@ export interface Transport { inbound_handling_time_histogram?: TransportHistogram[]; outbound_handling_time_histogram?: TransportHistogram[]; rx_count?: number; - rx_size?: string; - rx_size_in_bytes?: number; + rx_size?: Common.StorageSize; + rx_size_in_bytes?: Common.Bytes; server_open?: number; total_outbound_connections?: number; tx_count?: number; - tx_size?: string; - tx_size_in_bytes?: number; + tx_size?: Common.StorageSize; + tx_size_in_bytes?: Common.Bytes; } export interface TransportHistogram { diff --git a/api/_types/nodes.info.d.ts b/api/_types/nodes.info.d.ts index 9118f91ee..2670776b0 100644 --- a/api/_types/nodes.info.d.ts +++ b/api/_types/nodes.info.d.ts @@ -26,14 +26,14 @@ export type Metric = '_all' | 'aggregations' | 'http' | 'indices' | 'ingest' | ' export interface NodeInfo { aggregations?: Record; - attributes: Record; + attributes?: Record; build_flavor?: string; build_hash: string; build_type: string; - host: Common.Host; + host?: Common.Host; http?: NodeInfoHttp; ingest?: NodeInfoIngest; - ip: Common.Ip; + ip?: Common.Ip; jvm?: NodeJvmInfo; modules?: Common.PluginStats[]; name: Common.Name; @@ -46,9 +46,9 @@ export interface NodeInfo { settings?: NodeInfoSettings; thread_pool?: Record; total_indexing_buffer?: number; - total_indexing_buffer_in_bytes?: Common.ByteSize; + total_indexing_buffer_in_bytes?: Common.Bytes; transport?: NodeInfoTransport; - transport_address: Common.TransportAddress; + transport_address?: Common.TransportAddress; version: Common.VersionString; } @@ -75,8 +75,8 @@ export interface NodeInfoDiscovery { export interface NodeInfoHttp { bound_address: string[]; - max_content_length?: Common.ByteSize; - max_content_length_in_bytes: number; + max_content_length?: Common.StorageSize; + max_content_length_in_bytes: Common.Bytes; publish_address: string; } @@ -97,21 +97,21 @@ export interface NodeInfoIngestProcessor { } export interface NodeInfoJvmMemory { - direct_max?: Common.ByteSize; - direct_max_in_bytes: number; - heap_init?: Common.ByteSize; - heap_init_in_bytes: number; - heap_max?: Common.ByteSize; - heap_max_in_bytes: number; - non_heap_init?: Common.ByteSize; - non_heap_init_in_bytes: number; - non_heap_max?: Common.ByteSize; - non_heap_max_in_bytes: number; + 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; } export interface NodeInfoMemory { - total: string; - total_in_bytes: number; + total: Common.StorageSize; + total_in_bytes: Common.Bytes; } export interface NodeInfoNetwork { @@ -126,8 +126,8 @@ export interface NodeInfoNetworkInterface { } export interface NodeInfoOSCPU { - cache_size: string; - cache_size_in_bytes: number; + cache_size: Common.StorageSize; + cache_size_in_bytes: Common.Bytes; cores_per_socket: number; mhz: number; model: string; @@ -290,31 +290,31 @@ export interface NodeInfoTransport { export interface NodeJvmInfo { bundled_jdk: boolean; - gc_collectors: string[]; - input_arguments: string[]; + gc_collectors?: string[]; + input_arguments?: string[]; mem: NodeInfoJvmMemory; - memory_pools: string[]; + memory_pools?: string[]; pid: number; start_time_in_millis: Common.EpochTimeUnitMillis; - using_bundled_jdk?: boolean; + using_bundled_jdk?: boolean | undefined; using_compressed_ordinary_object_pointers?: boolean | string; - version: Common.VersionString; - vm_name: Common.Name; - vm_vendor: string; - vm_version: Common.VersionString; + version?: Common.VersionString; + vm_name?: Common.Name; + vm_vendor?: string; + vm_version?: Common.VersionString; } export interface NodeOperatingSystemInfo { allocated_processors?: number; - arch: string; + arch?: string; available_processors: number; cpu?: NodeInfoOSCPU; mem?: NodeInfoMemory; - name: Common.Name; - pretty_name: Common.Name; + name?: Common.Name; + pretty_name?: Common.Name; refresh_interval_in_millis: Common.DurationValueUnitMillis; swap?: NodeInfoMemory; - version: Common.VersionString; + version?: Common.VersionString; } export interface NodeProcessInfo { diff --git a/api/_types/observability._common.d.ts b/api/_types/observability._common.d.ts new file mode 100644 index 000000000..ee3ff48d0 --- /dev/null +++ b/api/_types/observability._common.d.ts @@ -0,0 +1,117 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + + +export interface ErrorResponse { + reason: string; + root_cause: RootCause[]; + type: string; +} + +export interface NotFoundResponse { + error: ErrorResponse; + status: number; +} + +export interface ObservabilityObject { + createdTimeMs?: number; + lastUpdatedTimeMs?: number; + objectId: string; + operationalPanel?: OperationalPanel; + savedQuery?: SavedQuery; + savedVisualization?: SavedVisualization; + tenant: string; +} + +export interface ObservabilityObjectList { + observabilityObjectList: ObservabilityObject[]; + startIndex: number; + totalHitRelation: string; + totalHits: number; +} + +export interface OperationalPanel { + applicationId: string; + name: string; + queryFilter: QueryFilter; + timeRange: TimeRange; + visualizations: Visualization[]; +} + +export interface QueryFilter { + language: string; + query: string; +} + +export interface RootCause { + reason: string; + type: string; +} + +export interface SavedQuery { + description: string; + name: string; + query: string; + selected_date_range: SelectedDateRange; + selected_fields: SelectedFields; + selected_timestamp: SelectedTimestamp; +} + +export interface SavedVisualization { + description: string; + name: string; + query: string; + selected_date_range: SelectedDateRange; + selected_fields: SelectedFields; + selected_timestamp: SelectedTimestamp; + type: string; +} + +export interface SelectedDateRange { + end: string; + start: string; + text: string; +} + +export interface SelectedFields { + text: string; + tokens: Token[]; +} + +export interface SelectedTimestamp { + name: string; + type: string; +} + +export interface TimeRange { + from: string; + to: string; +} + +export interface Token { + name: string; + type: string; +} + +export interface Visualization { + h: number; + id: string; + savedVisualizationId: string; + w: number; + x: number; + y: number; +} + diff --git a/api/_types/query._common.d.ts b/api/_types/query._common.d.ts new file mode 100644 index 000000000..35f4ea305 --- /dev/null +++ b/api/_types/query._common.d.ts @@ -0,0 +1,66 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + + +export interface Credentials { + password: string; + username: string; +} + +export interface DataSource { + allowedRoles?: string[]; + configuration?: DataSourceConfiguration; + connector: string; + description?: string; + name: string; + properties: Record; + resultIndex: string; + status: string; +} + +export interface DataSourceConfiguration { + credentials: Credentials; + endpoint: string; +} + +export type DataSourceList = DataSource[] + +export interface DataSourceNotFound { + error: ErrorResponse; +} + +export interface DataSourceRetrieve { + allowedRoles?: string[]; + configuration?: DataSourceConfiguration; + connector: string; + description?: string; + name: string; + properties: Record; + resultIndex: string; + status: string; +} + +export interface ErrorResponse { + reason: string; + root_cause: RootCause[]; + type: string; +} + +export interface RootCause { + reason: string; + type: string; +} + diff --git a/api/_types/search_pipeline._common.d.ts b/api/_types/search_pipeline._common.d.ts index cd2dd4980..13e60ac98 100644 --- a/api/_types/search_pipeline._common.d.ts +++ b/api/_types/search_pipeline._common.d.ts @@ -15,6 +15,14 @@ */ +export interface CollapseResponseProcessor { + context_prefix?: string; + description?: string; + field: string; + ignore_failure?: boolean; + tag?: string; +} + export interface FilterQueryRequestProcessor { description?: string; ignore_failure?: boolean; @@ -22,6 +30,10 @@ export interface FilterQueryRequestProcessor { tag?: string; } +export interface MLOpenSearchReranker { + model_id: string; +} + export type NeuralFieldMap = Record export interface NeuralQueryEnricherRequestProcessor { @@ -47,10 +59,29 @@ export interface OversampleRequestProcessor { tag?: string; } +export interface PersonalizeSearchRankingResponseProcessor { + campaign_arn: string; + description?: string; + iam_role_arn?: string; + ignore_failure?: boolean; + item_id_field?: string; + recipe: string; + tag?: string; + weight: number; +} + export interface PhaseResultsProcessor { 'normalization-processor': NormalizationPhaseResultsProcessor; } +export interface RenameFieldResponseProcessor { + description?: string; + field: string; + ignore_failure?: boolean; + tag?: string; + target_field: string; +} + export type RequestProcessor = { filter_query: FilterQueryRequestProcessor; } | { @@ -61,6 +92,45 @@ export type RequestProcessor = { oversample: OversampleRequestProcessor; } +export interface RerankContext { + document_fields: string[]; +} + +export interface RerankResponseProcessor { + context?: RerankContext; + description?: string; + ignore_failure?: boolean; + ml_opensearch?: MLOpenSearchReranker; + tag?: string; +} + +export type ResponseProcessor = { + personalize_search_ranking: PersonalizeSearchRankingResponseProcessor; +} | { + retrieval_augmented_generation: RetrievalAugmentedGenerationResponseProcessor; +} | { + rename_field: RenameFieldResponseProcessor; +} | { + rerank: RerankResponseProcessor; +} | { + collapse: CollapseResponseProcessor; +} | { + truncate_hits: TruncateHitsResponseProcessor; +} | { + sort: SortResponseProcessor; +} | { + split: SplitResponseProcessor; +} + +export interface RetrievalAugmentedGenerationResponseProcessor { + context_field_list: string[]; + description?: string; + model_id: string; + system_prompt?: string; + tag?: string; + user_instructions?: string; +} + export interface ScoreCombination { parameters?: number[]; technique?: ScoreCombinationTechnique; @@ -79,7 +149,7 @@ export type SearchPipelineMap = Record export interface SearchPipelineStructure { phase_results_processors?: PhaseResultsProcessor[]; request_processors?: RequestProcessor[]; - response_processors?: RequestProcessor[]; + response_processors?: ResponseProcessor[]; version?: number; } @@ -91,6 +161,33 @@ export interface SearchScriptRequestProcessor { tag?: string; } +export interface SortResponseProcessor { + description?: string; + field: string; + ignore_failure?: boolean; + order?: string; + tag?: string; + target_field?: string; +} + +export interface SplitResponseProcessor { + description?: string; + field: string; + ignore_failure?: boolean; + preserve_trailing?: boolean; + separator: string; + tag?: string; + target_field?: string; +} + +export interface TruncateHitsResponseProcessor { + context_prefix?: string; + description?: string; + ignore_failure?: boolean; + tag?: string; + target_size?: number; +} + export interface UserDefinedObjectStructure { bool?: any; boosting?: any; diff --git a/api/_types/security._common.d.ts b/api/_types/security._common.d.ts index a328f9bdf..754431369 100644 --- a/api/_types/security._common.d.ts +++ b/api/_types/security._common.d.ts @@ -24,7 +24,7 @@ export interface AccountDetails { roles?: string[]; tenants?: UserTenants; user_name?: string; - user_requested_tenant?: string; + user_requested_tenant?: undefined | string; } export interface ActionGroup { @@ -38,15 +38,11 @@ export interface ActionGroup { export type ActionGroupsMap = Record -export interface AllowConfig { +export interface AllowListConfig { enabled?: boolean; requests?: Record; } -export interface AllowListConfig { - config?: AllowConfig; -} - export interface AuditConfig { audit?: AuditLogsConfig; compliance?: ComplianceConfig; @@ -64,7 +60,9 @@ export interface AuditLogsConfig { enable_rest?: boolean; enable_transport?: boolean; exclude_sensitive_headers?: boolean; + ignore_headers?: string[]; ignore_requests?: string[]; + ignore_url_params?: string[]; ignore_users?: string[]; log_request_body?: boolean; resolve_bulk_requests?: boolean; @@ -72,25 +70,26 @@ export interface AuditLogsConfig { } export interface AuthInfo { - backend_roles?: any[]; - custom_attribute_names?: any[]; - peer_certificates?: number; - principal?: string; - remote_address?: string; - roles?: any[]; + backend_roles?: string[]; + custom_attribute_names?: string[]; + peer_certificates?: number | string; + principal?: undefined | string; + remote_address?: undefined | string; + roles?: string[]; size_of_backendroles?: string; size_of_custom_attributes?: string; size_of_user?: string; - sso_logout_url?: string; + sso_logout_url?: undefined | string; tenants?: Record; user?: string; user_name?: string; - user_requested_tenant?: string; + user_requested_tenant?: undefined | string; } -export interface BadRequest { - message?: string; - status?: '400'; +export interface CertificateCountPerNode { + failed?: number; + successful?: number; + total?: number; } export interface CertificatesDetail { @@ -101,6 +100,16 @@ export interface CertificatesDetail { subject_dn?: string; } +export interface CertificatesPerNode { + certificates?: Record; + name?: string; +} + +export interface CertificateTypes { + http?: Record[]; + transport?: Record[]; +} + export interface ChangePasswordRequestContent { current_password: string; password: string; @@ -120,7 +129,12 @@ export interface ComplianceConfig { } export interface ConfigUpgradePayload { - config?: any[]; + config?: string[]; +} + +export interface Created { + message?: string; + status?: number | string; } export interface CreateTenantParams { @@ -137,7 +151,7 @@ export interface DashboardsInfo { password_validation_error_message?: string; password_validation_regex?: string; private_tenant_enabled?: boolean; - sign_in_options?: any[]; + sign_in_options?: string[]; user_name?: string; } @@ -152,19 +166,21 @@ export interface DynamicConfig { } export interface DynamicOptions { - authc?: any; - authFailureListeners?: any; - authz?: any; - disableIntertransportAuth?: boolean; - disableRestAuth?: boolean; - doNotFailOnForbidden?: boolean; - doNotFailOnForbiddenEmpty?: boolean; - filteredAliasMode?: string; - hostsResolverMode?: string; - http?: any; - kibana?: any; - multiRolespanEnabled?: boolean; - respectRequestIndicesOptions?: boolean; + auth_failure_listeners?: Record; + authc?: Record; + authz?: Record; + disable_intertransport_auth?: boolean; + disable_rest_auth?: boolean; + do_not_fail_on_forbidden?: boolean; + do_not_fail_on_forbidden_empty?: boolean; + filtered_alias_mode?: string; + hosts_resolver_mode?: string; + http?: Record; + kibana?: Record; + multi_rolespan_enabled?: boolean; + on_behalf_of?: Record; + 'opensearch-dashboards'?: Record; + respect_request_indices_options?: boolean; } export interface GenerateOBOToken { @@ -178,8 +194,14 @@ export interface GetCertificates { transport_certificates_list?: CertificatesDetail[]; } +export interface GetCertificatesNew { + _nodes?: Record; + cluster_name?: string; + nodes?: Record; +} + export interface HealthInfo { - message?: string; + message?: undefined | string; mode?: string; status?: string; } @@ -196,11 +218,6 @@ export interface InternalServerError { error?: string; } -export interface MethodNotImplemented { - message?: string; - status?: '501'; -} - export interface MultiTenancyConfig { default_tenant?: string; multitenancy_enabled?: boolean; @@ -216,7 +233,7 @@ export interface OBOToken { export interface Ok { message?: string; - status?: '200'; + status?: number | string; } export interface PatchOperation { @@ -256,22 +273,26 @@ export type RoleMappings = Record export type RolesMap = Record +export interface SecurityConfig { + config?: DynamicConfig; +} + export interface SSLInfo { - local_certificates_list?: any[]; - peer_certificates?: number; - peer_certificates_list?: any[]; - principal?: string; - ssl_cipher?: string; - ssl_openssl_available?: boolean; - ssl_openssl_non_available_cause?: string; - ssl_openssl_supports_hostname_validation?: boolean; - ssl_openssl_supports_key_manager_factory?: boolean; - ssl_openssl_version?: string; - ssl_openssl_version_string?: string; - ssl_protocol?: string; - ssl_provider_http?: string; - ssl_provider_transport_client?: string; - ssl_provider_transport_server?: string; + local_certificates_list?: string[]; + peer_certificates: number | string; + peer_certificates_list?: string[]; + principal: undefined | string; + ssl_cipher: undefined | string; + ssl_openssl_available: boolean; + ssl_openssl_non_available_cause: undefined | string; + ssl_openssl_supports_hostname_validation: boolean; + ssl_openssl_supports_key_manager_factory: boolean; + ssl_openssl_version: number | string; + ssl_openssl_version_string: undefined | string; + ssl_protocol: undefined | string; + ssl_provider_http: undefined | string; + ssl_provider_transport_client: string; + ssl_provider_transport_server: string; } export interface Tenant { @@ -290,11 +311,6 @@ export interface TenantPermission { export type TenantsMap = Record -export interface Unauthorized { - message?: string; - status?: '403'; -} - export interface UpgradeCheck { status?: string; upgradeActions?: Record; @@ -313,6 +329,7 @@ export interface User { hash?: string; hidden?: boolean; opendistro_security_roles?: string[]; + password?: string; reserved?: boolean; static?: boolean; } @@ -328,8 +345,8 @@ export interface UserTenants { } export interface WhoAmI { - dn?: string; - is_admin?: string; - is_node_certificate_request?: string; + dn?: undefined | string; + is_admin?: boolean; + is_node_certificate_request?: boolean; } diff --git a/api/_types/snapshot._common.d.ts b/api/_types/snapshot._common.d.ts index 3ce38b8b8..8a17bf2f9 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: number; + size_in_bytes: Common.Bytes; } export interface IndexDetails { max_segments_per_shard: number; shard_count: number; - size?: Common.ByteSize; - size_in_bytes: number; + size?: Common.StorageSize; + size_in_bytes: Common.Bytes; } export interface InfoFeatureState { @@ -68,7 +68,7 @@ export interface ShardsStatsSummary { export interface ShardsStatsSummaryItem { file_count: number; - size_in_bytes: number; + size_in_bytes: Common.Bytes; } export interface SnapshotIndexStats { diff --git a/api/asynchronousSearch/_api.js b/api/asynchronousSearch/_api.js new file mode 100644 index 000000000..946db73e0 --- /dev/null +++ b/api/asynchronousSearch/_api.js @@ -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. + */ + +'use strict'; + +/** @namespace API-Asynchronous-Search */ + +function AsynchronousSearchApi(bindObj) { + this.delete = require('./delete').bind(bindObj); + this.get = require('./get').bind(bindObj); + this.search = require('./search').bind(bindObj); + this.stats = require('./stats').bind(bindObj); + +} + +module.exports = AsynchronousSearchApi; diff --git a/api/asynchronousSearch/delete.d.ts b/api/asynchronousSearch/delete.d.ts new file mode 100644 index 000000000..e87afd556 --- /dev/null +++ b/api/asynchronousSearch/delete.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' + +export interface AsynchronousSearch_Delete_Request extends Global.Params { + id: string; +} + +export interface AsynchronousSearch_Delete_Response extends ApiResponse { + body: AsynchronousSearch_Delete_ResponseBody; +} + +export interface AsynchronousSearch_Delete_ResponseBody { + acknowledged?: boolean; +} + diff --git a/api/asynchronousSearch/delete.js b/api/asynchronousSearch/delete.js new file mode 100644 index 000000000..bdb6fa5e8 --- /dev/null +++ b/api/asynchronousSearch/delete.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 asynchronous search. + *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/async/index/#delete-searches-and-results - asynchronous_search.delete} + * + * @memberOf API-Asynchronous-Search + * + * @param {object} params + * @param {string} params.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 deleteFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.id == null) return handleMissingParam('id', this, callback); + + let { body, id, ...querystring } = params; + id = parsePathParam(id); + + const path = '/_plugins/_asynchronous_search/' + id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteFunc; diff --git a/api/asynchronousSearch/get.d.ts b/api/asynchronousSearch/get.d.ts new file mode 100644 index 000000000..1bbbee3cf --- /dev/null +++ b/api/asynchronousSearch/get.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 AsynchronousSearch_Common from '../_types/asynchronous_search._common' + +export interface AsynchronousSearch_Get_Request extends Global.Params { + id: string; +} + +export interface AsynchronousSearch_Get_Response extends ApiResponse { + body: AsynchronousSearch_Get_ResponseBody; +} + +export type AsynchronousSearch_Get_ResponseBody = AsynchronousSearch_Common.ResponseBody + diff --git a/api/asynchronousSearch/get.js b/api/asynchronousSearch/get.js new file mode 100644 index 000000000..34aee7d32 --- /dev/null +++ b/api/asynchronousSearch/get.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'); + +/** + * Get partial responses from asynchronous search. + *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/async/index/#get-partial-results - asynchronous_search.get} + * + * @memberOf API-Asynchronous-Search + * + * @param {object} params + * @param {string} params.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 getFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.id == null) return handleMissingParam('id', this, callback); + + let { body, id, ...querystring } = params; + id = parsePathParam(id); + + const path = '/_plugins/_asynchronous_search/' + id; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getFunc; diff --git a/api/asynchronousSearch/search.d.ts b/api/asynchronousSearch/search.d.ts new file mode 100644 index 000000000..5139f0b38 --- /dev/null +++ b/api/asynchronousSearch/search.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as AsynchronousSearch_Common from '../_types/asynchronous_search._common' + +export interface AsynchronousSearch_Search_Request extends Global.Params { + body?: AsynchronousSearch_Common.Search; + index?: string; + keep_alive?: string; + keep_on_completion?: boolean; + wait_for_completion_timeout?: string; +} + +export interface AsynchronousSearch_Search_Response extends ApiResponse { + body: AsynchronousSearch_Search_ResponseBody; +} + +export type AsynchronousSearch_Search_ResponseBody = AsynchronousSearch_Common.ResponseBody + diff --git a/api/asynchronousSearch/search.js b/api/asynchronousSearch/search.js new file mode 100644 index 000000000..d62e3ca7b --- /dev/null +++ b/api/asynchronousSearch/search.js @@ -0,0 +1,51 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Perform an asynchronous search. + *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/async/index/#rest-api - asynchronous_search.search} + * + * @memberOf API-Asynchronous-Search + * + * @param {object} [params] + * @param {string} [params.index] - The name of the index to be searched. + * @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster. + * @param {boolean} [params.keep_on_completion] - Whether you want to save the results in the cluster after the search is complete. + * @param {string} [params.wait_for_completion_timeout] - The amount of time that you plan to wait for the results. + * @param {object} [params.body] - The search definition using the Query DSL. + * + * @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); + + let { body, ...querystring } = params; + + const path = '/_plugins/_asynchronous_search'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = searchFunc; diff --git a/api/asynchronousSearch/stats.d.ts b/api/asynchronousSearch/stats.d.ts new file mode 100644 index 000000000..7d961f264 --- /dev/null +++ b/api/asynchronousSearch/stats.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 AsynchronousSearch_Common from '../_types/asynchronous_search._common' + +export type AsynchronousSearch_Stats_Request = Global.Params & Record + +export interface AsynchronousSearch_Stats_Response extends ApiResponse { + body: AsynchronousSearch_Stats_ResponseBody; +} + +export type AsynchronousSearch_Stats_ResponseBody = AsynchronousSearch_Common.StatsResponse + diff --git a/api/asynchronousSearch/stats.js b/api/asynchronousSearch/stats.js new file mode 100644 index 000000000..a25f83c10 --- /dev/null +++ b/api/asynchronousSearch/stats.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'); + +/** + * Monitoring of asynchronous searches that are running, completed, and/or persisted. + *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/async/index/#monitor-stats - asynchronous_search.stats} + * + * @memberOf API-Asynchronous-Search + * + * @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 statsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_asynchronous_search/stats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = statsFunc; diff --git a/api/cat/allPitSegments.d.ts b/api/cat/allPitSegments.d.ts index 87e364a7b..cc82d52df 100644 --- a/api/cat/allPitSegments.d.ts +++ b/api/cat/allPitSegments.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Common from '../_types/cat._common' export interface Cat_AllPitSegments_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; format?: string; h?: string[]; help?: boolean; diff --git a/api/cat/allocation.d.ts b/api/cat/allocation.d.ts index ad32879da..ad8c4113d 100644 --- a/api/cat/allocation.d.ts +++ b/api/cat/allocation.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Allocation from '../_types/cat.allocation' export interface Cat_Allocation_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; cluster_manager_timeout?: Common.Duration; format?: string; h?: string[]; diff --git a/api/cat/fielddata.d.ts b/api/cat/fielddata.d.ts index 920256052..e4685f999 100644 --- a/api/cat/fielddata.d.ts +++ b/api/cat/fielddata.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Fielddata from '../_types/cat.fielddata' export interface Cat_Fielddata_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; fields?: Common.Fields; format?: string; h?: string[]; diff --git a/api/cat/indices.d.ts b/api/cat/indices.d.ts index 4c23dfedb..fa8300d6a 100644 --- a/api/cat/indices.d.ts +++ b/api/cat/indices.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Indices from '../_types/cat.indices' export interface Cat_Indices_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; cluster_manager_timeout?: Common.Duration; expand_wildcards?: Common.ExpandWildcards; format?: string; diff --git a/api/cat/nodes.d.ts b/api/cat/nodes.d.ts index d7eeca57c..f00520104 100644 --- a/api/cat/nodes.d.ts +++ b/api/cat/nodes.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Nodes from '../_types/cat.nodes' export interface Cat_Nodes_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; cluster_manager_timeout?: Common.Duration; format?: string; full_id?: boolean | string; diff --git a/api/cat/pitSegments.d.ts b/api/cat/pitSegments.d.ts index 377f3f135..2dfffbd51 100644 --- a/api/cat/pitSegments.d.ts +++ b/api/cat/pitSegments.d.ts @@ -21,7 +21,7 @@ import * as Cat_Common from '../_types/cat._common' export interface Cat_PitSegments_Request extends Global.Params { body?: Cat_PitSegments_RequestBody; - bytes?: Common.Bytes; + bytes?: Common.StorageType; format?: string; h?: string[]; help?: boolean; diff --git a/api/cat/recovery.d.ts b/api/cat/recovery.d.ts index f38cff916..179506999 100644 --- a/api/cat/recovery.d.ts +++ b/api/cat/recovery.d.ts @@ -21,7 +21,7 @@ import * as Cat_Recovery from '../_types/cat.recovery' export interface Cat_Recovery_Request extends Global.Params { active_only?: boolean; - bytes?: Common.Bytes; + bytes?: Common.StorageType; detailed?: boolean; format?: string; h?: string[]; diff --git a/api/cat/segmentReplication.d.ts b/api/cat/segmentReplication.d.ts index 46fbcac7c..4cc0adfef 100644 --- a/api/cat/segmentReplication.d.ts +++ b/api/cat/segmentReplication.d.ts @@ -22,7 +22,7 @@ import * as Cat_Common from '../_types/cat._common' export interface Cat_SegmentReplication_Request extends Global.Params { active_only?: boolean; allow_no_indices?: boolean; - bytes?: Common.Bytes; + bytes?: Common.StorageType; completed_only?: boolean; detailed?: boolean; expand_wildcards?: Common.ExpandWildcards; diff --git a/api/cat/segments.d.ts b/api/cat/segments.d.ts index c6a9fa7f0..023cd8afc 100644 --- a/api/cat/segments.d.ts +++ b/api/cat/segments.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Segments from '../_types/cat.segments' export interface Cat_Segments_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; cluster_manager_timeout?: Common.Duration; format?: string; h?: string[]; diff --git a/api/cat/shards.d.ts b/api/cat/shards.d.ts index 78b4fca1f..dcf6d9700 100644 --- a/api/cat/shards.d.ts +++ b/api/cat/shards.d.ts @@ -20,7 +20,7 @@ import * as Common from '../_types/_common' import * as Cat_Shards from '../_types/cat.shards' export interface Cat_Shards_Request extends Global.Params { - bytes?: Common.Bytes; + bytes?: Common.StorageType; cluster_manager_timeout?: Common.Duration; format?: string; h?: string[]; diff --git a/api/cat/threadPool.js b/api/cat/threadPool.js index f7d126349..552c2a555 100644 --- a/api/cat/threadPool.js +++ b/api/cat/threadPool.js @@ -33,7 +33,7 @@ By default the active, queue and rejected statistics are returned for all thread * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. - * @param {integer} [params.size] - The multiplier in which to display values. + * @param {number} [params.size] - The multiplier in which to display values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * @param {string} [params.thread_pool_patterns] - A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. * diff --git a/api/cluster/deleteDecommissionAwareness.d.ts b/api/cluster/deleteDecommissionAwareness.d.ts index ee279a2cc..ea137c2a2 100644 --- a/api/cluster/deleteDecommissionAwareness.d.ts +++ b/api/cluster/deleteDecommissionAwareness.d.ts @@ -16,6 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Common from '../_types/_common' export type Cluster_DeleteDecommissionAwareness_Request = Global.Params & Record @@ -23,5 +24,5 @@ export interface Cluster_DeleteDecommissionAwareness_Response extends ApiRespons body: Cluster_DeleteDecommissionAwareness_ResponseBody; } -export type Cluster_DeleteDecommissionAwareness_ResponseBody = Record +export type Cluster_DeleteDecommissionAwareness_ResponseBody = Common.AcknowledgedResponseBase diff --git a/api/cluster/deleteWeightedRouting.d.ts b/api/cluster/deleteWeightedRouting.d.ts index dda305c10..7bbb831ee 100644 --- a/api/cluster/deleteWeightedRouting.d.ts +++ b/api/cluster/deleteWeightedRouting.d.ts @@ -16,12 +16,16 @@ 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' -export type Cluster_DeleteWeightedRouting_Request = Global.Params & Record +export interface Cluster_DeleteWeightedRouting_Request extends Global.Params { + body?: Cluster_WeightedRouting.WeightsBase; +} export interface Cluster_DeleteWeightedRouting_Response extends ApiResponse { body: Cluster_DeleteWeightedRouting_ResponseBody; } -export type Cluster_DeleteWeightedRouting_ResponseBody = Record +export type Cluster_DeleteWeightedRouting_ResponseBody = Common.AcknowledgedResponseBase diff --git a/api/cluster/deleteWeightedRouting.js b/api/cluster/deleteWeightedRouting.js index 48e85d989..ac3afe426 100644 --- a/api/cluster/deleteWeightedRouting.js +++ b/api/cluster/deleteWeightedRouting.js @@ -24,7 +24,9 @@ const { normalizeArguments } = require('../utils'); * * @memberOf API-Cluster * - * @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 * diff --git a/api/cluster/getDecommissionAwareness.d.ts b/api/cluster/getDecommissionAwareness.d.ts index a59f579e5..a1a3dff40 100644 --- a/api/cluster/getDecommissionAwareness.d.ts +++ b/api/cluster/getDecommissionAwareness.d.ts @@ -16,6 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Cluster_DecommissionAwareness from '../_types/cluster.decommission_awareness' export interface Cluster_GetDecommissionAwareness_Request extends Global.Params { awareness_attribute_name: string; @@ -25,5 +26,5 @@ export interface Cluster_GetDecommissionAwareness_Response extends ApiResponse { body: Cluster_GetDecommissionAwareness_ResponseBody; } -export type Cluster_GetDecommissionAwareness_ResponseBody = Record +export type Cluster_GetDecommissionAwareness_ResponseBody = Cluster_DecommissionAwareness.DecommissionStatusResponse diff --git a/api/cluster/getSettings.d.ts b/api/cluster/getSettings.d.ts index f8b539a79..6e289b03c 100644 --- a/api/cluster/getSettings.d.ts +++ b/api/cluster/getSettings.d.ts @@ -31,8 +31,8 @@ export interface Cluster_GetSettings_Response extends ApiResponse { } export interface Cluster_GetSettings_ResponseBody { - defaults?: Record>; - persistent: Record>; - transient: Record>; + defaults?: Record; + persistent: Record; + transient: Record; } diff --git a/api/cluster/getWeightedRouting.d.ts b/api/cluster/getWeightedRouting.d.ts index 5114c747e..3e489d8d0 100644 --- a/api/cluster/getWeightedRouting.d.ts +++ b/api/cluster/getWeightedRouting.d.ts @@ -16,6 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Cluster_WeightedRouting from '../_types/cluster.weighted_routing' export interface Cluster_GetWeightedRouting_Request extends Global.Params { attribute: string; @@ -25,5 +26,5 @@ export interface Cluster_GetWeightedRouting_Response extends ApiResponse { body: Cluster_GetWeightedRouting_ResponseBody; } -export type Cluster_GetWeightedRouting_ResponseBody = Record +export type Cluster_GetWeightedRouting_ResponseBody = Cluster_WeightedRouting.WeightsResponse diff --git a/api/cluster/putDecommissionAwareness.d.ts b/api/cluster/putDecommissionAwareness.d.ts index 560323e8c..b09b4fba0 100644 --- a/api/cluster/putDecommissionAwareness.d.ts +++ b/api/cluster/putDecommissionAwareness.d.ts @@ -16,6 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Common from '../_types/_common' export interface Cluster_PutDecommissionAwareness_Request extends Global.Params { awareness_attribute_name: string; @@ -26,5 +27,5 @@ export interface Cluster_PutDecommissionAwareness_Response extends ApiResponse { body: Cluster_PutDecommissionAwareness_ResponseBody; } -export type Cluster_PutDecommissionAwareness_ResponseBody = Record +export type Cluster_PutDecommissionAwareness_ResponseBody = Common.AcknowledgedResponseBase diff --git a/api/cluster/putWeightedRouting.d.ts b/api/cluster/putWeightedRouting.d.ts index 1f73a95bb..036583c1a 100644 --- a/api/cluster/putWeightedRouting.d.ts +++ b/api/cluster/putWeightedRouting.d.ts @@ -16,9 +16,11 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Cluster_WeightedRouting from '../_types/cluster.weighted_routing' export interface Cluster_PutWeightedRouting_Request extends Global.Params { attribute: string; + body?: Cluster_WeightedRouting.Weights; } export interface Cluster_PutWeightedRouting_Response extends ApiResponse { diff --git a/api/cluster/putWeightedRouting.js b/api/cluster/putWeightedRouting.js index c704a8576..89e3a7e60 100644 --- a/api/cluster/putWeightedRouting.js +++ b/api/cluster/putWeightedRouting.js @@ -26,6 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} params.attribute - Awareness attribute name. + * @param {string} [params.body] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/danglingIndices/_api.js b/api/danglingIndices/_api.js index f575bf65c..fac1b0880 100644 --- a/api/danglingIndices/_api.js +++ b/api/danglingIndices/_api.js @@ -18,7 +18,7 @@ /** @namespace API-Dangling-Indices */ -function DanglingindicesApi(bindObj) { +function DanglingIndicesApi(bindObj) { this.deleteDanglingIndex = require('./deleteDanglingIndex').bind(bindObj); this.importDanglingIndex = require('./importDanglingIndex').bind(bindObj); this.listDanglingIndices = require('./listDanglingIndices').bind(bindObj); @@ -31,4 +31,4 @@ function DanglingindicesApi(bindObj) { this.list_dangling_indices = require('./listDanglingIndices').bind(bindObj); } -module.exports = DanglingindicesApi; +module.exports = DanglingIndicesApi; diff --git a/api/flowFramework/_api.js b/api/flowFramework/_api.js new file mode 100644 index 000000000..887e3811f --- /dev/null +++ b/api/flowFramework/_api.js @@ -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. + */ + +'use strict'; + +/** @namespace API-Flow-Framework */ + +function FlowFrameworkApi(bindObj) { + this.create = require('./create').bind(bindObj); + this.delete = require('./delete').bind(bindObj); + this.get = require('./get').bind(bindObj); + this.update = require('./update').bind(bindObj); + +} + +module.exports = FlowFrameworkApi; diff --git a/api/flowFramework/create.d.ts b/api/flowFramework/create.d.ts new file mode 100644 index 000000000..bb04e63b1 --- /dev/null +++ b/api/flowFramework/create.d.ts @@ -0,0 +1,36 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as FlowFramework_Common from '../_types/flow_framework.common' + +export interface FlowFramework_Create_Request extends Global.Params { + body?: FlowFramework_Common.FlowFrameworkCreate; + provision?: boolean; + reprovision?: boolean; + use_case?: string; + validation?: string; +} + +export interface FlowFramework_Create_Response extends ApiResponse { + body: FlowFramework_Create_ResponseBody; +} + +export interface FlowFramework_Create_ResponseBody { + workflow_id: string; +} + diff --git a/api/flowFramework/create.js b/api/flowFramework/create.js new file mode 100644 index 000000000..618bed821 --- /dev/null +++ b/api/flowFramework/create.js @@ -0,0 +1,51 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Create a workflow. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/ - flow_framework.create} + * + * @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 {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] + * + * @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 createFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_flow_framework/workflow'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createFunc; diff --git a/api/flowFramework/delete.d.ts b/api/flowFramework/delete.d.ts new file mode 100644 index 000000000..19cc3db5b --- /dev/null +++ b/api/flowFramework/delete.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' + +export interface FlowFramework_Delete_Request extends Global.Params { + clear_status?: boolean; + workflow_id: string; +} + +export interface FlowFramework_Delete_Response extends ApiResponse { + body: FlowFramework_Delete_ResponseBody; +} + +export type FlowFramework_Delete_ResponseBody = Record + diff --git a/api/flowFramework/delete.js b/api/flowFramework/delete.js new file mode 100644 index 000000000..95728d208 --- /dev/null +++ b/api/flowFramework/delete.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'); + +/** + * Delete a workflow. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/delete-workflow/ - flow_framework.delete} + * + * @memberOf API-Flow-Framework + * + * @param {object} params + * @param {boolean} [params.clear_status=false] - Delete the workflow state (without deprovisioning resources) after deleting the template. OpenSearch deletes the workflow state only if the provisioning status is not IN_PROGRESS. Default is false. + * @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 deleteFunc(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; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteFunc; diff --git a/api/flowFramework/get.d.ts b/api/flowFramework/get.d.ts new file mode 100644 index 000000000..56c13c379 --- /dev/null +++ b/api/flowFramework/get.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 FlowFramework_Get_Request extends Global.Params { + workflow_id: string; +} + +export interface FlowFramework_Get_Response extends ApiResponse { + body: FlowFramework_Get_ResponseBody; +} + +export type FlowFramework_Get_ResponseBody = Record + diff --git a/api/flowFramework/get.js b/api/flowFramework/get.js new file mode 100644 index 000000000..3f5bdf76a --- /dev/null +++ b/api/flowFramework/get.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'); + +/** + * Get a workflow. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/get-workflow/ - flow_framework.get} + * + * @memberOf API-Flow-Framework + * + * @param {object} params + * @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 getFunc(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; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getFunc; diff --git a/api/flowFramework/update.d.ts b/api/flowFramework/update.d.ts new file mode 100644 index 000000000..2babf31d6 --- /dev/null +++ b/api/flowFramework/update.d.ts @@ -0,0 +1,34 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as FlowFramework_Common from '../_types/flow_framework.common' + +export interface FlowFramework_Update_Request extends Global.Params { + body?: FlowFramework_Common.FlowFrameworkUpdate; + update_fields?: boolean; + workflow_id: string; +} + +export interface FlowFramework_Update_Response extends ApiResponse { + body: FlowFramework_Update_ResponseBody; +} + +export interface FlowFramework_Update_ResponseBody { + workflow_id: string; +} + diff --git a/api/flowFramework/update.js b/api/flowFramework/update.js new file mode 100644 index 000000000..0408b1af6 --- /dev/null +++ b/api/flowFramework/update.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, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Update a workflow. You can only update a complete workflow if it has not yet been provisioned. + *
See Also: {@link https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/ - flow_framework.update} + * + * @memberOf API-Flow-Framework + * + * @param {object} params + * @param {boolean} [params.update_fields=false] - Update only the fields included in the request body. + * @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 updateFunc(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; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = updateFunc; diff --git a/api/index.d.ts b/api/index.d.ts index 9f54c829b..c1473992d 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -181,6 +181,8 @@ import { Security_PatchAuditConfiguration_Request, Security_PatchAuditConfigurat import { Security_UpdateAuditConfiguration_Request, Security_UpdateAuditConfiguration_Response, Security_UpdateAuditConfiguration_ResponseBody } from './security/updateAuditConfiguration'; import { Security_Authtoken_Request, Security_Authtoken_Response, Security_Authtoken_ResponseBody } from './security/authtoken'; import { Security_FlushCache_Request, Security_FlushCache_Response, Security_FlushCache_ResponseBody } from './security/flushCache'; +import { Security_GetAllCertificates_Request, Security_GetAllCertificates_Response, Security_GetAllCertificates_ResponseBody } from './security/getAllCertificates'; +import { Security_GetNodeCertificates_Request, Security_GetNodeCertificates_Response, Security_GetNodeCertificates_ResponseBody } from './security/getNodeCertificates'; import { Security_GenerateOboToken_Request, Security_GenerateOboToken_Response, Security_GenerateOboToken_ResponseBody } from './security/generateOboToken'; import { Security_GetUsers_Request, Security_GetUsers_Response, Security_GetUsers_ResponseBody } from './security/getUsers'; import { Security_PatchUsers_Request, Security_PatchUsers_RequestBody, Security_PatchUsers_Response, Security_PatchUsers_ResponseBody } from './security/patchUsers'; @@ -216,7 +218,7 @@ import { Security_GetCertificates_Request, Security_GetCertificates_Response, Se import { Security_ReloadHttpCertificates_Request, Security_ReloadHttpCertificates_Response, Security_ReloadHttpCertificates_ResponseBody } from './security/reloadHttpCertificates'; import { Security_ReloadTransportCertificates_Request, Security_ReloadTransportCertificates_Response, Security_ReloadTransportCertificates_ResponseBody } from './security/reloadTransportCertificates'; import { Security_GetTenancyConfig_Request, Security_GetTenancyConfig_Response, Security_GetTenancyConfig_ResponseBody } from './security/getTenancyConfig'; -import { Security_CreateUpdateTenancyConfig_Request, Security_CreateUpdateTenancyConfig_RequestBody, Security_CreateUpdateTenancyConfig_Response, Security_CreateUpdateTenancyConfig_ResponseBody } from './security/createUpdateTenancyConfig'; +import { Security_CreateUpdateTenancyConfig_Request, Security_CreateUpdateTenancyConfig_Response, Security_CreateUpdateTenancyConfig_ResponseBody } from './security/createUpdateTenancyConfig'; import { Security_GetTenants_Request, Security_GetTenants_Response, Security_GetTenants_ResponseBody } from './security/getTenants'; import { Security_PatchTenants_Request, Security_PatchTenants_RequestBody, Security_PatchTenants_Response, Security_PatchTenants_ResponseBody } from './security/patchTenants'; import { Security_DeleteTenant_Request, Security_DeleteTenant_Response, Security_DeleteTenant_ResponseBody } from './security/deleteTenant'; @@ -227,7 +229,6 @@ 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'; @@ -236,6 +237,14 @@ import { Security_Health_Request, Security_Health_Response, Security_Health_Resp import { Security_TenantInfo_Request, Security_TenantInfo_Response, Security_TenantInfo_ResponseBody } from './security/tenantInfo'; import { Security_WhoAmI_Request, Security_WhoAmI_Response, Security_WhoAmI_ResponseBody } from './security/whoAmI'; import { Security_WhoAmIProtected_Request, Security_WhoAmIProtected_Response, Security_WhoAmIProtected_ResponseBody } from './security/whoAmIProtected'; +import { AsynchronousSearch_Search_Request, AsynchronousSearch_Search_Response, AsynchronousSearch_Search_ResponseBody } from './asynchronousSearch/search'; +import { AsynchronousSearch_Delete_Request, AsynchronousSearch_Delete_Response, AsynchronousSearch_Delete_ResponseBody } from './asynchronousSearch/delete'; +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_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 { 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'; @@ -248,6 +257,9 @@ import { Ml_GetModelGroup_Request, Ml_GetModelGroup_Response, Ml_GetModelGroup_R import { Ml_RegisterModel_Request, Ml_RegisterModel_RequestBody, Ml_RegisterModel_Response, Ml_RegisterModel_ResponseBody } from './ml/registerModel'; import { Ml_SearchModels_Request, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody } from './ml/searchModels'; import { Ml_DeleteModel_Request, Ml_DeleteModel_Response, Ml_DeleteModel_ResponseBody } from './ml/deleteModel'; +import { Ml_DeployModel_Request, Ml_DeployModel_Response, Ml_DeployModel_ResponseBody } from './ml/deployModel'; +import { Ml_UndeployModel_Request, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody } from './ml/undeployModel'; +import { Ml_DeleteTask_Request, Ml_DeleteTask_Response, Ml_DeleteTask_ResponseBody } from './ml/deleteTask'; import { Ml_GetTask_Request, Ml_GetTask_Response, Ml_GetTask_ResponseBody } from './ml/getTask'; import { Notifications_ListChannels_Request, Notifications_ListChannels_Response, Notifications_ListChannels_ResponseBody } from './notifications/listChannels'; import { Notifications_DeleteConfigs_Request, Notifications_DeleteConfigs_Response, Notifications_DeleteConfigs_ResponseBody } from './notifications/deleteConfigs'; @@ -258,10 +270,22 @@ import { Notifications_GetConfig_Request, Notifications_GetConfig_Response, Noti import { Notifications_UpdateConfig_Request, Notifications_UpdateConfig_Response, Notifications_UpdateConfig_ResponseBody } from './notifications/updateConfig'; import { Notifications_SendTest_Request, Notifications_SendTest_Response, Notifications_SendTest_ResponseBody } from './notifications/sendTest'; import { Notifications_ListFeatures_Request, Notifications_ListFeatures_Response, Notifications_ListFeatures_ResponseBody } from './notifications/listFeatures'; +import { Observability_GetLocalstats_Request, Observability_GetLocalstats_Response, Observability_GetLocalstats_ResponseBody } from './observability/getLocalstats'; +import { Observability_DeleteObjects_Request, Observability_DeleteObjects_Response, Observability_DeleteObjects_ResponseBody } from './observability/deleteObjects'; +import { Observability_ListObjects_Request, Observability_ListObjects_Response, Observability_ListObjects_ResponseBody } from './observability/listObjects'; +import { Observability_CreateObject_Request, Observability_CreateObject_Response, Observability_CreateObject_ResponseBody } from './observability/createObject'; +import { Observability_DeleteObject_Request, Observability_DeleteObject_Response, Observability_DeleteObject_ResponseBody } from './observability/deleteObject'; +import { Observability_GetObject_Request, Observability_GetObject_Response, Observability_GetObject_ResponseBody } from './observability/getObject'; +import { Observability_UpdateObject_Request, Observability_UpdateObject_Response, Observability_UpdateObject_ResponseBody } from './observability/updateObject'; import { Ppl_Query_Request, Ppl_Query_Response, Ppl_Query_ResponseBody } from './ppl/query'; import { Ppl_Explain_Request, Ppl_Explain_Response, Ppl_Explain_ResponseBody } from './ppl/explain'; import { Ppl_GetStats_Request, Ppl_GetStats_Response, Ppl_GetStats_ResponseBody } from './ppl/getStats'; import { Ppl_PostStats_Request, Ppl_PostStats_Response, Ppl_PostStats_ResponseBody } from './ppl/postStats'; +import { Query_DatasourcesList_Request, Query_DatasourcesList_Response, Query_DatasourcesList_ResponseBody } from './query/datasourcesList'; +import { Query_DatasourcesCreate_Request, Query_DatasourcesCreate_Response, Query_DatasourcesCreate_ResponseBody } from './query/datasourcesCreate'; +import { Query_DatasourcesUpdate_Request, Query_DatasourcesUpdate_Response, Query_DatasourcesUpdate_ResponseBody } from './query/datasourcesUpdate'; +import { Query_DatasourceDelete_Request, Query_DatasourceDelete_Response, Query_DatasourceDelete_ResponseBody } from './query/datasourceDelete'; +import { Query_DatasourceRetrieve_Request, Query_DatasourceRetrieve_Response, Query_DatasourceRetrieve_ResponseBody } from './query/datasourceRetrieve'; import { Sql_Settings_Request, Sql_Settings_RequestBody, Sql_Settings_Response, Sql_Settings_ResponseBody } from './sql/settings'; import { Sql_Query_Request, Sql_Query_Response, Sql_Query_ResponseBody } from './sql/query'; import { Sql_Explain_Request, Sql_Explain_Response, Sql_Explain_ResponseBody } from './sql/explain'; @@ -469,6 +493,8 @@ export { Security_UpdateAuditConfiguration_Request, Security_UpdateAuditConfiguration_Response, Security_UpdateAuditConfiguration_ResponseBody, Security_Authtoken_Request, Security_Authtoken_Response, Security_Authtoken_ResponseBody, Security_FlushCache_Request, Security_FlushCache_Response, Security_FlushCache_ResponseBody, + Security_GetAllCertificates_Request, Security_GetAllCertificates_Response, Security_GetAllCertificates_ResponseBody, + Security_GetNodeCertificates_Request, Security_GetNodeCertificates_Response, Security_GetNodeCertificates_ResponseBody, Security_GenerateOboToken_Request, Security_GenerateOboToken_Response, Security_GenerateOboToken_ResponseBody, Security_GetUsers_Request, Security_GetUsers_Response, Security_GetUsers_ResponseBody, Security_PatchUsers_Request, Security_PatchUsers_RequestBody, Security_PatchUsers_Response, Security_PatchUsers_ResponseBody, @@ -504,7 +530,7 @@ export { Security_ReloadHttpCertificates_Request, Security_ReloadHttpCertificates_Response, Security_ReloadHttpCertificates_ResponseBody, Security_ReloadTransportCertificates_Request, Security_ReloadTransportCertificates_Response, Security_ReloadTransportCertificates_ResponseBody, Security_GetTenancyConfig_Request, Security_GetTenancyConfig_Response, Security_GetTenancyConfig_ResponseBody, - Security_CreateUpdateTenancyConfig_Request, Security_CreateUpdateTenancyConfig_RequestBody, Security_CreateUpdateTenancyConfig_Response, Security_CreateUpdateTenancyConfig_ResponseBody, + Security_CreateUpdateTenancyConfig_Request, Security_CreateUpdateTenancyConfig_Response, Security_CreateUpdateTenancyConfig_ResponseBody, Security_GetTenants_Request, Security_GetTenants_Response, Security_GetTenants_ResponseBody, Security_PatchTenants_Request, Security_PatchTenants_RequestBody, Security_PatchTenants_Response, Security_PatchTenants_ResponseBody, Security_DeleteTenant_Request, Security_DeleteTenant_Response, Security_DeleteTenant_ResponseBody, @@ -515,7 +541,6 @@ 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, @@ -524,6 +549,14 @@ export { Security_TenantInfo_Request, Security_TenantInfo_Response, Security_TenantInfo_ResponseBody, Security_WhoAmI_Request, Security_WhoAmI_Response, Security_WhoAmI_ResponseBody, Security_WhoAmIProtected_Request, Security_WhoAmIProtected_Response, Security_WhoAmIProtected_ResponseBody, + AsynchronousSearch_Search_Request, AsynchronousSearch_Search_Response, AsynchronousSearch_Search_ResponseBody, + AsynchronousSearch_Delete_Request, AsynchronousSearch_Delete_Response, AsynchronousSearch_Delete_ResponseBody, + 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_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, 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, @@ -536,6 +569,9 @@ export { Ml_RegisterModel_Request, Ml_RegisterModel_RequestBody, Ml_RegisterModel_Response, Ml_RegisterModel_ResponseBody, Ml_SearchModels_Request, Ml_SearchModels_Response, Ml_SearchModels_ResponseBody, Ml_DeleteModel_Request, Ml_DeleteModel_Response, Ml_DeleteModel_ResponseBody, + Ml_DeployModel_Request, Ml_DeployModel_Response, Ml_DeployModel_ResponseBody, + Ml_UndeployModel_Request, Ml_UndeployModel_Response, Ml_UndeployModel_ResponseBody, + Ml_DeleteTask_Request, Ml_DeleteTask_Response, Ml_DeleteTask_ResponseBody, Ml_GetTask_Request, Ml_GetTask_Response, Ml_GetTask_ResponseBody, Notifications_ListChannels_Request, Notifications_ListChannels_Response, Notifications_ListChannels_ResponseBody, Notifications_DeleteConfigs_Request, Notifications_DeleteConfigs_Response, Notifications_DeleteConfigs_ResponseBody, @@ -546,10 +582,22 @@ export { Notifications_UpdateConfig_Request, Notifications_UpdateConfig_Response, Notifications_UpdateConfig_ResponseBody, Notifications_SendTest_Request, Notifications_SendTest_Response, Notifications_SendTest_ResponseBody, Notifications_ListFeatures_Request, Notifications_ListFeatures_Response, Notifications_ListFeatures_ResponseBody, + Observability_GetLocalstats_Request, Observability_GetLocalstats_Response, Observability_GetLocalstats_ResponseBody, + Observability_DeleteObjects_Request, Observability_DeleteObjects_Response, Observability_DeleteObjects_ResponseBody, + Observability_ListObjects_Request, Observability_ListObjects_Response, Observability_ListObjects_ResponseBody, + Observability_CreateObject_Request, Observability_CreateObject_Response, Observability_CreateObject_ResponseBody, + Observability_DeleteObject_Request, Observability_DeleteObject_Response, Observability_DeleteObject_ResponseBody, + Observability_GetObject_Request, Observability_GetObject_Response, Observability_GetObject_ResponseBody, + Observability_UpdateObject_Request, Observability_UpdateObject_Response, Observability_UpdateObject_ResponseBody, Ppl_Query_Request, Ppl_Query_Response, Ppl_Query_ResponseBody, Ppl_Explain_Request, Ppl_Explain_Response, Ppl_Explain_ResponseBody, Ppl_GetStats_Request, Ppl_GetStats_Response, Ppl_GetStats_ResponseBody, Ppl_PostStats_Request, Ppl_PostStats_Response, Ppl_PostStats_ResponseBody, + Query_DatasourcesList_Request, Query_DatasourcesList_Response, Query_DatasourcesList_ResponseBody, + Query_DatasourcesCreate_Request, Query_DatasourcesCreate_Response, Query_DatasourcesCreate_ResponseBody, + Query_DatasourcesUpdate_Request, Query_DatasourcesUpdate_Response, Query_DatasourcesUpdate_ResponseBody, + Query_DatasourceDelete_Request, Query_DatasourceDelete_Response, Query_DatasourceDelete_ResponseBody, + Query_DatasourceRetrieve_Request, Query_DatasourceRetrieve_Response, Query_DatasourceRetrieve_ResponseBody, Sql_Settings_Request, Sql_Settings_RequestBody, Sql_Settings_Response, Sql_Settings_ResponseBody, Sql_Query_Request, Sql_Query_Response, Sql_Query_ResponseBody, Sql_Explain_Request, Sql_Explain_Response, Sql_Explain_ResponseBody, diff --git a/api/indices/dataStreamsStats.d.ts b/api/indices/dataStreamsStats.d.ts index 2a8931def..cfcea78dc 100644 --- a/api/indices/dataStreamsStats.d.ts +++ b/api/indices/dataStreamsStats.d.ts @@ -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: number; - total_store_sizes?: Common.ByteSize; + total_store_size_bytes: Common.Bytes; + total_store_sizes?: Common.StorageSize; } diff --git a/api/indices/stats.d.ts b/api/indices/stats.d.ts index a6fd4b1dc..27ce8cf22 100644 --- a/api/indices/stats.d.ts +++ b/api/indices/stats.d.ts @@ -38,7 +38,7 @@ export interface Indices_Stats_Response extends ApiResponse { } export interface Indices_Stats_ResponseBody { - _all: Indices_Stats.IndicesStats; + _all: Indices_Stats.AllIndicesStats; _shards: Common.ShardStatistics; indices?: Record; } diff --git a/api/knn/searchModels.js b/api/knn/searchModels.js index bf42b642f..023b903fe 100644 --- a/api/knn/searchModels.js +++ b/api/knn/searchModels.js @@ -32,19 +32,19 @@ const { normalizeArguments } = require('../utils'); * @param {boolean} [params.allow_partial_search_results=true] - Indicate if an error should be returned if there is a partial search failure or timeout. * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed. * @param {string} [params.analyzer] - The analyzer to use for the query string. - * @param {integer} [params.batched_reduce_size=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. + * @param {number} [params.batched_reduce_size=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. * @param {boolean} [params.ccs_minimize_roundtrips=true] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. * @param {string} [params.default_operator] - The default operator for query string query (AND or OR). * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string. * @param {array} [params.docvalue_fields] - Comma-separated list of fields to return as the docvalue representation of a field for each hit. * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit. - * @param {integer} [params.from=0] - Starting offset. + * @param {number} [params.from=0] - Starting offset. * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled. * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed). * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored. - * @param {integer} [params.max_concurrent_shard_requests=5] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. - * @param {integer} [params.pre_filter_shard_size] - Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {number} [params.max_concurrent_shard_requests=5] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. + * @param {number} [params.pre_filter_shard_size] - Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. * @param {string} [params.preference=random] - Specify the node or shard the operation should be performed on. * @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. @@ -53,15 +53,15 @@ const { normalizeArguments } = require('../utils'); * @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. - * @param {integer} [params.size=10] - Number of hits to return. + * @param {number} [params.size=10] - Number of hits to return. * @param {array} [params.sort] - Comma-separated list of : pairs. * @param {array} [params.stats] - Specific 'tag' of the request for logging and statistical purposes. * @param {array} [params.stored_fields] - Comma-separated list of stored fields to return. * @param {string} [params.suggest_field] - Specify which field to use for suggestions. * @param {string} [params.suggest_mode] - Specify suggest mode. - * @param {integer} [params.suggest_size] - How many suggestions to return in response. + * @param {number} [params.suggest_size] - How many suggestions to return in response. * @param {string} [params.suggest_text] - The source text for which the suggestions should be returned. - * @param {integer} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. * @param {string} [params.timeout] - Operation timeout. * @param {boolean} [params.track_scores] - Whether to calculate and return scores even if they are not used for sorting. * @param {boolean} [params.track_total_hits] - Indicate if the number of documents that match the query should be tracked. diff --git a/api/ml/_api.js b/api/ml/_api.js index 70765af54..7ac3f3e4f 100644 --- a/api/ml/_api.js +++ b/api/ml/_api.js @@ -21,16 +21,23 @@ function MlApi(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.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 deleteModel instead. this.delete_model = require('./deleteModel').bind(bindObj); // Deprecated: Use deleteModelGroup instead. this.delete_model_group = require('./deleteModelGroup').bind(bindObj); + // Deprecated: Use deleteTask instead. + this.delete_task = require('./deleteTask').bind(bindObj); + // Deprecated: Use deployModel instead. + this.deploy_model = require('./deployModel').bind(bindObj); // Deprecated: Use getModelGroup instead. this.get_model_group = require('./getModelGroup').bind(bindObj); // Deprecated: Use getTask instead. @@ -41,6 +48,8 @@ function MlApi(bindObj) { this.register_model_group = require('./registerModelGroup').bind(bindObj); // Deprecated: Use searchModels instead. this.search_models = require('./searchModels').bind(bindObj); + // Deprecated: Use undeployModel instead. + this.undeploy_model = require('./undeployModel').bind(bindObj); } module.exports = MlApi; diff --git a/api/ml/deleteModel.d.ts b/api/ml/deleteModel.d.ts index b5abf4c23..b35a9405e 100644 --- a/api/ml/deleteModel.d.ts +++ b/api/ml/deleteModel.d.ts @@ -16,7 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' -import * as Ml_Common from '../_types/ml._common' +import * as Common from '../_types/_common' export interface Ml_DeleteModel_Request extends Global.Params { model_id: string; @@ -26,5 +26,5 @@ export interface Ml_DeleteModel_Response extends ApiResponse { body: Ml_DeleteModel_ResponseBody; } -export type Ml_DeleteModel_ResponseBody = Ml_Common.ModelGroup +export type Ml_DeleteModel_ResponseBody = Common.WriteResponseBase diff --git a/api/ml/deleteModelGroup.d.ts b/api/ml/deleteModelGroup.d.ts index 08c6c2778..2cf347dbc 100644 --- a/api/ml/deleteModelGroup.d.ts +++ b/api/ml/deleteModelGroup.d.ts @@ -16,7 +16,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' -import * as Ml_Common from '../_types/ml._common' +import * as Common from '../_types/_common' export interface Ml_DeleteModelGroup_Request extends Global.Params { model_group_id: string; @@ -26,5 +26,5 @@ export interface Ml_DeleteModelGroup_Response extends ApiResponse { body: Ml_DeleteModelGroup_ResponseBody; } -export type Ml_DeleteModelGroup_ResponseBody = Ml_Common.ModelGroup +export type Ml_DeleteModelGroup_ResponseBody = Common.WriteResponseBase diff --git a/api/ml/deleteTask.d.ts b/api/ml/deleteTask.d.ts new file mode 100644 index 000000000..b3b68dc96 --- /dev/null +++ b/api/ml/deleteTask.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 Common from '../_types/_common' + +export interface Ml_DeleteTask_Request extends Global.Params { + task_id: string; +} + +export interface Ml_DeleteTask_Response extends ApiResponse { + body: Ml_DeleteTask_ResponseBody; +} + +export type Ml_DeleteTask_ResponseBody = Common.WriteResponseBase + diff --git a/api/ml/deleteTask.js b/api/ml/deleteTask.js new file mode 100644 index 000000000..fe8c4ffe4 --- /dev/null +++ b/api/ml/deleteTask.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 task. + *
See Also: {@link undefined - ml.delete_task} + * + * @memberOf API-Ml + * + * @param {object} params + * @param {string} params.task_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 deleteTaskFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.task_id == null) return handleMissingParam('task_id', this, callback); + + let { body, task_id, ...querystring } = params; + task_id = parsePathParam(task_id); + + const path = '/_plugins/_ml/tasks/' + task_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteTaskFunc; diff --git a/api/ml/deployModel.d.ts b/api/ml/deployModel.d.ts new file mode 100644 index 000000000..cbe6f2563 --- /dev/null +++ b/api/ml/deployModel.d.ts @@ -0,0 +1,33 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' + +export interface Ml_DeployModel_Request extends Global.Params { + model_id: string; +} + +export interface Ml_DeployModel_Response extends ApiResponse { + body: Ml_DeployModel_ResponseBody; +} + +export interface Ml_DeployModel_ResponseBody { + status: string; + task_id: string; + task_type?: string; +} + diff --git a/api/security/generateUserTokenLegacy.js b/api/ml/deployModel.js similarity index 64% rename from api/security/generateUserTokenLegacy.js rename to api/ml/deployModel.js index f6c08fcfd..668ea89c5 100644 --- a/api/security/generateUserTokenLegacy.js +++ b/api/ml/deployModel.js @@ -19,31 +19,31 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); /** - * Generates authorization token for the given user. Legacy API. - *
See Also: {@link undefined - security.generate_user_token_legacy} + * Deploys a model. + *
See Also: {@link undefined - ml.deploy_model} * - * @memberOf API-Security + * @memberOf API-Ml * * @param {object} params - * @param {string} params.username + * @param {string} params.model_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 generateUserTokenLegacyFunc(params, options, callback) { +function deployModelFunc(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); - if (params.username == null) return handleMissingParam('username', this, callback); + if (params.model_id == null) return handleMissingParam('model_id', this, callback); - let { body, username, ...querystring } = params; - username = parsePathParam(username); + let { body, model_id, ...querystring } = params; + model_id = parsePathParam(model_id); - const path = '/_plugins/_security/api/user/' + username + '/authtoken'; + const path = '/_plugins/_ml/models/' + model_id + '/_deploy'; const method = 'POST'; body = body || ''; return this.transport.request({ method, path, querystring, body }, options, callback); } -module.exports = generateUserTokenLegacyFunc; +module.exports = deployModelFunc; diff --git a/api/ml/registerModel.d.ts b/api/ml/registerModel.d.ts index 065d500ef..1b775abc6 100644 --- a/api/ml/registerModel.d.ts +++ b/api/ml/registerModel.d.ts @@ -16,7 +16,6 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' -import * as Ml_Common from '../_types/ml._common' export interface Ml_RegisterModel_Request extends Global.Params { body?: Ml_RegisterModel_RequestBody; @@ -34,5 +33,8 @@ export interface Ml_RegisterModel_Response extends ApiResponse { body: Ml_RegisterModel_ResponseBody; } -export type Ml_RegisterModel_ResponseBody = Ml_Common.Task +export interface Ml_RegisterModel_ResponseBody { + status: string; + task_id: string; +} diff --git a/api/ml/undeployModel.d.ts b/api/ml/undeployModel.d.ts new file mode 100644 index 000000000..596508cd8 --- /dev/null +++ b/api/ml/undeployModel.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 Ml_Common from '../_types/ml._common' + +export interface Ml_UndeployModel_Request extends Global.Params { + model_id: string; +} + +export interface Ml_UndeployModel_Response extends ApiResponse { + body: Ml_UndeployModel_ResponseBody; +} + +export type Ml_UndeployModel_ResponseBody = Ml_Common.UndeployModelResponse + diff --git a/api/ml/undeployModel.js b/api/ml/undeployModel.js new file mode 100644 index 000000000..eae870a3e --- /dev/null +++ b/api/ml/undeployModel.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'); + +/** + * Undeploys a model. + *
See Also: {@link undefined - ml.undeploy_model} + * + * @memberOf API-Ml + * + * @param {object} params + * @param {string} params.model_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 undeployModelFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.model_id == null) return handleMissingParam('model_id', this, callback); + + let { body, model_id, ...querystring } = params; + model_id = parsePathParam(model_id); + + const path = '/_plugins/_ml/models/' + model_id + '/_undeploy'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = undeployModelFunc; diff --git a/api/nodes/hotThreads.js b/api/nodes/hotThreads.js index 7122655e5..da8f0ff5f 100644 --- a/api/nodes/hotThreads.js +++ b/api/nodes/hotThreads.js @@ -27,8 +27,8 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {boolean} [params.ignore_idle_threads=true] - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue. * @param {string} [params.interval] - The interval for the second sampling of threads. - * @param {integer} [params.snapshots=10] - Number of samples of thread stacktrace. - * @param {integer} [params.threads=3] - Specify the number of threads to provide information for. + * @param {number} [params.snapshots=10] - Number of samples of thread stacktrace. + * @param {number} [params.threads=3] - Specify the number of threads to provide information for. * @param {string} [params.timeout] - Operation timeout. * @param {string} [params.type] - The type to sample. * @param {array} [params.node_id] - Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. diff --git a/api/notifications/getConfigs.js b/api/notifications/getConfigs.js index 89a053185..796f68ae0 100644 --- a/api/notifications/getConfigs.js +++ b/api/notifications/getConfigs.js @@ -28,7 +28,7 @@ const { normalizeArguments } = require('../utils'); * @param {string} [params.chime.url] * @param {string} [params.chime.url.keyword] * @param {string} [params.config_type] - Type of notification configuration. - * @param {integer} [params.created_time_ms] + * @param {number} [params.created_time_ms] * @param {string} [params.description] * @param {string} [params.description.keyword] * @param {string} [params.email.email_account_id] @@ -38,7 +38,7 @@ const { normalizeArguments } = require('../utils'); * @param {string} [params.email_group.recipient_list.recipient] * @param {string} [params.email_group.recipient_list.recipient.keyword] * @param {boolean} [params.is_enabled] - * @param {integer} [params.last_updated_time_ms] + * @param {number} [params.last_updated_time_ms] * @param {string} [params.microsoft_teams.url] * @param {string} [params.microsoft_teams.url.keyword] * @param {string} [params.name] diff --git a/api/observability/_api.js b/api/observability/_api.js new file mode 100644 index 000000000..74274daa9 --- /dev/null +++ b/api/observability/_api.js @@ -0,0 +1,46 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +/** @namespace API-Observability */ + +function ObservabilityApi(bindObj) { + this.createObject = require('./createObject').bind(bindObj); + this.deleteObject = require('./deleteObject').bind(bindObj); + this.deleteObjects = require('./deleteObjects').bind(bindObj); + this.getLocalstats = require('./getLocalstats').bind(bindObj); + this.getObject = require('./getObject').bind(bindObj); + this.listObjects = require('./listObjects').bind(bindObj); + this.updateObject = require('./updateObject').bind(bindObj); + + // Deprecated: Use createObject instead. + this.create_object = require('./createObject').bind(bindObj); + // Deprecated: Use deleteObject instead. + this.delete_object = require('./deleteObject').bind(bindObj); + // Deprecated: Use deleteObjects instead. + this.delete_objects = require('./deleteObjects').bind(bindObj); + // Deprecated: Use getLocalstats instead. + this.get_localstats = require('./getLocalstats').bind(bindObj); + // Deprecated: Use getObject instead. + this.get_object = require('./getObject').bind(bindObj); + // Deprecated: Use listObjects instead. + this.list_objects = require('./listObjects').bind(bindObj); + // Deprecated: Use updateObject instead. + this.update_object = require('./updateObject').bind(bindObj); +} + +module.exports = ObservabilityApi; diff --git a/api/observability/createObject.d.ts b/api/observability/createObject.d.ts new file mode 100644 index 000000000..0e7e3dbf0 --- /dev/null +++ b/api/observability/createObject.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 Observability_Common from '../_types/observability._common' + +export interface Observability_CreateObject_Request extends Global.Params { + body?: Observability_Common.ObservabilityObject; +} + +export interface Observability_CreateObject_Response extends ApiResponse { + body: Observability_CreateObject_ResponseBody; +} + +export interface Observability_CreateObject_ResponseBody { + objectId?: string; +} + diff --git a/api/observability/createObject.js b/api/observability/createObject.js new file mode 100644 index 000000000..3204779c2 --- /dev/null +++ b/api/observability/createObject.js @@ -0,0 +1,47 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Creates a new observability object. + *
See Also: {@link undefined - observability.create_object} + * + * @memberOf API-Observability + * + * @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 createObjectFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_observability/object'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createObjectFunc; diff --git a/api/observability/deleteObject.d.ts b/api/observability/deleteObject.d.ts new file mode 100644 index 000000000..55d7deab2 --- /dev/null +++ b/api/observability/deleteObject.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' + +export interface Observability_DeleteObject_Request extends Global.Params { + object_id: string; +} + +export interface Observability_DeleteObject_Response extends ApiResponse { + body: Observability_DeleteObject_ResponseBody; +} + +export interface Observability_DeleteObject_ResponseBody { + deleteResponseList?: Record; +} + diff --git a/api/observability/deleteObject.js b/api/observability/deleteObject.js new file mode 100644 index 000000000..e067b416d --- /dev/null +++ b/api/observability/deleteObject.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 specific observability object specified by ID. + *
See Also: {@link undefined - observability.delete_object} + * + * @memberOf API-Observability + * + * @param {object} params + * @param {string} params.object_id - The ID of the Observability Object. + * + * @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 deleteObjectFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.object_id == null) return handleMissingParam('object_id', this, callback); + + let { body, object_id, ...querystring } = params; + object_id = parsePathParam(object_id); + + const path = '/_plugins/_observability/object/' + object_id; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteObjectFunc; diff --git a/api/observability/deleteObjects.d.ts b/api/observability/deleteObjects.d.ts new file mode 100644 index 000000000..c8a364c54 --- /dev/null +++ b/api/observability/deleteObjects.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' + +export interface Observability_DeleteObjects_Request extends Global.Params { + objectId?: string; + objectIdList?: string; +} + +export interface Observability_DeleteObjects_Response extends ApiResponse { + body: Observability_DeleteObjects_ResponseBody; +} + +export interface Observability_DeleteObjects_ResponseBody { + deleteResponseList?: Record; +} + diff --git a/api/observability/deleteObjects.js b/api/observability/deleteObjects.js new file mode 100644 index 000000000..c7921e292 --- /dev/null +++ b/api/observability/deleteObjects.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 } = require('../utils'); + +/** + * Deletes specific observability objects specified by ID or a list of IDs. + *
See Also: {@link undefined - observability.delete_objects} + * + * @memberOf API-Observability + * + * @param {object} [params] + * @param {string} [params.objectId] - The ID of a single Observability Object to delete. + * @param {string} [params.objectIdList] - A comma-separated list of Observability Object IDs to delete. + * + * @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 deleteObjectsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_observability/object'; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteObjectsFunc; diff --git a/api/observability/getLocalstats.d.ts b/api/observability/getLocalstats.d.ts new file mode 100644 index 000000000..df6df9716 --- /dev/null +++ b/api/observability/getLocalstats.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' + +export type Observability_GetLocalstats_Request = Global.Params & Record + +export interface Observability_GetLocalstats_Response extends ApiResponse { + body: Observability_GetLocalstats_ResponseBody; +} + +export type Observability_GetLocalstats_ResponseBody = string + diff --git a/api/observability/getLocalstats.js b/api/observability/getLocalstats.js new file mode 100644 index 000000000..2a617cbdf --- /dev/null +++ b/api/observability/getLocalstats.js @@ -0,0 +1,45 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Retrieves Local Stats of all observability objects. + *
See Also: {@link undefined - observability.get_localstats} + * + * @memberOf API-Observability + * + * @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 getLocalstatsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_observability/_local/stats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getLocalstatsFunc; diff --git a/api/observability/getObject.d.ts b/api/observability/getObject.d.ts new file mode 100644 index 000000000..735e4f2f4 --- /dev/null +++ b/api/observability/getObject.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 Observability_Common from '../_types/observability._common' + +export interface Observability_GetObject_Request extends Global.Params { + object_id: string; +} + +export interface Observability_GetObject_Response extends ApiResponse { + body: Observability_GetObject_ResponseBody; +} + +export type Observability_GetObject_ResponseBody = Observability_Common.ObservabilityObjectList + diff --git a/api/observability/getObject.js b/api/observability/getObject.js new file mode 100644 index 000000000..2832ffebc --- /dev/null +++ b/api/observability/getObject.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Retrieves specific observability object specified by ID. + *
See Also: {@link undefined - observability.get_object} + * + * @memberOf API-Observability + * + * @param {object} params + * @param {string} params.object_id - The ID of the Observability Object. + * + * @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 getObjectFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.object_id == null) return handleMissingParam('object_id', this, callback); + + let { body, object_id, ...querystring } = params; + object_id = parsePathParam(object_id); + + const path = '/_plugins/_observability/object/' + object_id; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getObjectFunc; diff --git a/api/observability/listObjects.d.ts b/api/observability/listObjects.d.ts new file mode 100644 index 000000000..f558377cd --- /dev/null +++ b/api/observability/listObjects.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 Observability_Common from '../_types/observability._common' + +export type Observability_ListObjects_Request = Global.Params & Record + +export interface Observability_ListObjects_Response extends ApiResponse { + body: Observability_ListObjects_ResponseBody; +} + +export type Observability_ListObjects_ResponseBody = Observability_Common.ObservabilityObjectList + diff --git a/api/observability/listObjects.js b/api/observability/listObjects.js new file mode 100644 index 000000000..72bed8bb7 --- /dev/null +++ b/api/observability/listObjects.js @@ -0,0 +1,45 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Retrieves list of all observability objects. + *
See Also: {@link undefined - observability.list_objects} + * + * @memberOf API-Observability + * + * @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 listObjectsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_observability/object'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = listObjectsFunc; diff --git a/api/observability/updateObject.d.ts b/api/observability/updateObject.d.ts new file mode 100644 index 000000000..d785e625c --- /dev/null +++ b/api/observability/updateObject.d.ts @@ -0,0 +1,33 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Observability_Common from '../_types/observability._common' + +export interface Observability_UpdateObject_Request extends Global.Params { + body?: Observability_Common.ObservabilityObject; + object_id: string; +} + +export interface Observability_UpdateObject_Response extends ApiResponse { + body: Observability_UpdateObject_ResponseBody; +} + +export interface Observability_UpdateObject_ResponseBody { + objectId?: string; +} + diff --git a/api/observability/updateObject.js b/api/observability/updateObject.js new file mode 100644 index 000000000..b00160a52 --- /dev/null +++ b/api/observability/updateObject.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'); + +/** + * Updates an existing observability object. + *
See Also: {@link undefined - observability.update_object} + * + * @memberOf API-Observability + * + * @param {object} params + * @param {string} params.object_id - The ID of the Observability Object. + * @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 updateObjectFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.object_id == null) return handleMissingParam('object_id', this, callback); + + let { body, object_id, ...querystring } = params; + object_id = parsePathParam(object_id); + + const path = '/_plugins/_observability/object/' + object_id; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = updateObjectFunc; diff --git a/api/query/_api.js b/api/query/_api.js new file mode 100644 index 000000000..c281a57b5 --- /dev/null +++ b/api/query/_api.js @@ -0,0 +1,40 @@ +/* + * 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-Query */ + +function QueryApi(bindObj) { + this.datasourceDelete = require('./datasourceDelete').bind(bindObj); + this.datasourceRetrieve = require('./datasourceRetrieve').bind(bindObj); + this.datasourcesCreate = require('./datasourcesCreate').bind(bindObj); + this.datasourcesList = require('./datasourcesList').bind(bindObj); + this.datasourcesUpdate = require('./datasourcesUpdate').bind(bindObj); + + // Deprecated: Use datasourceDelete instead. + this.datasource_delete = require('./datasourceDelete').bind(bindObj); + // Deprecated: Use datasourceRetrieve instead. + this.datasource_retrieve = require('./datasourceRetrieve').bind(bindObj); + // Deprecated: Use datasourcesCreate instead. + this.datasources_create = require('./datasourcesCreate').bind(bindObj); + // Deprecated: Use datasourcesList instead. + this.datasources_list = require('./datasourcesList').bind(bindObj); + // Deprecated: Use datasourcesUpdate instead. + this.datasources_update = require('./datasourcesUpdate').bind(bindObj); +} + +module.exports = QueryApi; diff --git a/api/query/datasourceDelete.d.ts b/api/query/datasourceDelete.d.ts new file mode 100644 index 000000000..6079c1a2f --- /dev/null +++ b/api/query/datasourceDelete.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 Query_DatasourceDelete_Request extends Global.Params { + datasource_name: string; +} + +export interface Query_DatasourceDelete_Response extends ApiResponse { + body: Query_DatasourceDelete_ResponseBody; +} + +export type Query_DatasourceDelete_ResponseBody = Record + diff --git a/api/query/datasourceDelete.js b/api/query/datasourceDelete.js new file mode 100644 index 000000000..b83319ac7 --- /dev/null +++ b/api/query/datasourceDelete.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 specific datasource specified by name. + *
See Also: {@link undefined - query.datasource_delete} + * + * @memberOf API-Query + * + * @param {object} params + * @param {string} params.datasource_name - The Name of the DataSource to delete. + * + * @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 datasourceDeleteFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.datasource_name == null) return handleMissingParam('datasource_name', this, callback); + + let { body, datasource_name, ...querystring } = params; + datasource_name = parsePathParam(datasource_name); + + const path = '/_plugins/_query/_datasources/' + datasource_name; + const method = 'DELETE'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = datasourceDeleteFunc; diff --git a/api/query/datasourceRetrieve.d.ts b/api/query/datasourceRetrieve.d.ts new file mode 100644 index 000000000..a100080b4 --- /dev/null +++ b/api/query/datasourceRetrieve.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 Query_Common from '../_types/query._common' + +export interface Query_DatasourceRetrieve_Request extends Global.Params { + datasource_name: string; +} + +export interface Query_DatasourceRetrieve_Response extends ApiResponse { + body: Query_DatasourceRetrieve_ResponseBody; +} + +export type Query_DatasourceRetrieve_ResponseBody = Query_Common.DataSourceRetrieve + diff --git a/api/query/datasourceRetrieve.js b/api/query/datasourceRetrieve.js new file mode 100644 index 000000000..5094e58e6 --- /dev/null +++ b/api/query/datasourceRetrieve.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Retrieves specific datasource specified by name. + *
See Also: {@link undefined - query.datasource_retrieve} + * + * @memberOf API-Query + * + * @param {object} params + * @param {string} params.datasource_name - The Name of the DataSource to retrieve. + * + * @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 datasourceRetrieveFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.datasource_name == null) return handleMissingParam('datasource_name', this, callback); + + let { body, datasource_name, ...querystring } = params; + datasource_name = parsePathParam(datasource_name); + + const path = '/_plugins/_query/_datasources/' + datasource_name; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = datasourceRetrieveFunc; diff --git a/api/query/datasourcesCreate.d.ts b/api/query/datasourcesCreate.d.ts new file mode 100644 index 000000000..3b01a716f --- /dev/null +++ b/api/query/datasourcesCreate.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 Query_Common from '../_types/query._common' + +export interface Query_DatasourcesCreate_Request extends Global.Params { + body?: Query_Common.DataSource; +} + +export interface Query_DatasourcesCreate_Response extends ApiResponse { + body: Query_DatasourcesCreate_ResponseBody; +} + +export type Query_DatasourcesCreate_ResponseBody = string + diff --git a/api/query/datasourcesCreate.js b/api/query/datasourcesCreate.js new file mode 100644 index 000000000..5695a6ace --- /dev/null +++ b/api/query/datasourcesCreate.js @@ -0,0 +1,47 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Creates a new query datasource. + *
See Also: {@link undefined - query.datasources_create} + * + * @memberOf API-Query + * + * @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 datasourcesCreateFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_query/_datasources'; + const method = 'POST'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = datasourcesCreateFunc; diff --git a/api/query/datasourcesList.d.ts b/api/query/datasourcesList.d.ts new file mode 100644 index 000000000..ce090304f --- /dev/null +++ b/api/query/datasourcesList.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 Query_Common from '../_types/query._common' + +export type Query_DatasourcesList_Request = Global.Params & Record + +export interface Query_DatasourcesList_Response extends ApiResponse { + body: Query_DatasourcesList_ResponseBody; +} + +export type Query_DatasourcesList_ResponseBody = Query_Common.DataSourceList + diff --git a/api/query/datasourcesList.js b/api/query/datasourcesList.js new file mode 100644 index 000000000..2ebf8c7df --- /dev/null +++ b/api/query/datasourcesList.js @@ -0,0 +1,45 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Retrieves list of all datasources. + *
See Also: {@link undefined - query.datasources_list} + * + * @memberOf API-Query + * + * @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 datasourcesListFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_query/_datasources'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = datasourcesListFunc; diff --git a/api/query/datasourcesUpdate.d.ts b/api/query/datasourcesUpdate.d.ts new file mode 100644 index 000000000..ac0dd49c3 --- /dev/null +++ b/api/query/datasourcesUpdate.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 Query_Common from '../_types/query._common' + +export interface Query_DatasourcesUpdate_Request extends Global.Params { + body?: Query_Common.DataSource; +} + +export interface Query_DatasourcesUpdate_Response extends ApiResponse { + body: Query_DatasourcesUpdate_ResponseBody; +} + +export type Query_DatasourcesUpdate_ResponseBody = string + diff --git a/api/query/datasourcesUpdate.js b/api/query/datasourcesUpdate.js new file mode 100644 index 000000000..b1e52ce39 --- /dev/null +++ b/api/query/datasourcesUpdate.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'); + +/** + * Updates an existing query datasource. + *
See Also: {@link undefined - query.datasources_update} + * + * @memberOf API-Query + * + * @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 datasourcesUpdateFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_query/_datasources'; + const method = 'PUT'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = datasourcesUpdateFunc; diff --git a/api/remoteStore/_api.js b/api/remoteStore/_api.js index 26f1d6a84..28a83fb29 100644 --- a/api/remoteStore/_api.js +++ b/api/remoteStore/_api.js @@ -18,9 +18,9 @@ /** @namespace API-Remote-Store */ -function RemotestoreApi(bindObj) { +function RemoteStoreApi(bindObj) { this.restore = require('./restore').bind(bindObj); } -module.exports = RemotestoreApi; +module.exports = RemoteStoreApi; diff --git a/api/searchPipeline/_api.js b/api/searchPipeline/_api.js index 0d82e02f2..9ee0a8a94 100644 --- a/api/searchPipeline/_api.js +++ b/api/searchPipeline/_api.js @@ -18,11 +18,11 @@ /** @namespace API-Search-Pipeline */ -function SearchpipelineApi(bindObj) { +function SearchPipelineApi(bindObj) { this.delete = require('./delete').bind(bindObj); this.get = require('./get').bind(bindObj); this.put = require('./put').bind(bindObj); } -module.exports = SearchpipelineApi; +module.exports = SearchPipelineApi; diff --git a/api/security/_api.js b/api/security/_api.js index 118b12d7b..dde793fae 100644 --- a/api/security/_api.js +++ b/api/security/_api.js @@ -42,10 +42,10 @@ 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); + this.getAllCertificates = require('./getAllCertificates').bind(bindObj); this.getAllowlist = require('./getAllowlist').bind(bindObj); this.getAuditConfiguration = require('./getAuditConfiguration').bind(bindObj); this.getCertificates = require('./getCertificates').bind(bindObj); @@ -53,6 +53,7 @@ function SecurityApi(bindObj) { this.getDashboardsInfo = require('./getDashboardsInfo').bind(bindObj); this.getDistinguishedName = require('./getDistinguishedName').bind(bindObj); this.getDistinguishedNames = require('./getDistinguishedNames').bind(bindObj); + this.getNodeCertificates = require('./getNodeCertificates').bind(bindObj); this.getPermissionsInfo = require('./getPermissionsInfo').bind(bindObj); this.getRole = require('./getRole').bind(bindObj); this.getRoleMapping = require('./getRoleMapping').bind(bindObj); @@ -136,14 +137,14 @@ 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. this.get_action_group = require('./getActionGroup').bind(bindObj); // Deprecated: Use getActionGroups instead. this.get_action_groups = require('./getActionGroups').bind(bindObj); + // Deprecated: Use getAllCertificates instead. + this.get_all_certificates = require('./getAllCertificates').bind(bindObj); // Deprecated: Use getAllowlist instead. this.get_allowlist = require('./getAllowlist').bind(bindObj); // Deprecated: Use getAuditConfiguration instead. @@ -158,6 +159,8 @@ function SecurityApi(bindObj) { this.get_distinguished_name = require('./getDistinguishedName').bind(bindObj); // Deprecated: Use getDistinguishedNames instead. this.get_distinguished_names = require('./getDistinguishedNames').bind(bindObj); + // Deprecated: Use getNodeCertificates instead. + this.get_node_certificates = require('./getNodeCertificates').bind(bindObj); // Deprecated: Use getPermissionsInfo instead. this.get_permissions_info = require('./getPermissionsInfo').bind(bindObj); // Deprecated: Use getRole instead. diff --git a/api/security/configUpgradeCheck.js b/api/security/configUpgradeCheck.js index c001c6bae..ead2a570f 100644 --- a/api/security/configUpgradeCheck.js +++ b/api/security/configUpgradeCheck.js @@ -35,7 +35,7 @@ function configUpgradeCheckFunc(params, options, callback) { let { body, ...querystring } = params; - const path = '/_plugins/_security/_upgrade_check'; + const path = '/_plugins/_security/api/_upgrade_check'; const method = 'GET'; body = body || ''; diff --git a/api/security/configUpgradePerform.js b/api/security/configUpgradePerform.js index 0ee113156..076edec4b 100644 --- a/api/security/configUpgradePerform.js +++ b/api/security/configUpgradePerform.js @@ -37,7 +37,7 @@ function configUpgradePerformFunc(params, options, callback) { let { body, ...querystring } = params; - const path = '/_plugins/_security/_upgrade_perform'; + const path = '/_plugins/_security/api/_upgrade_perform'; const method = 'POST'; body = body || ''; diff --git a/api/security/createRole.js b/api/security/createRole.js index c583878a7..d47049b3f 100644 --- a/api/security/createRole.js +++ b/api/security/createRole.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.role + * @param {string} params.role - The name of the role to be created. * @param {object} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/createRoleMapping.js b/api/security/createRoleMapping.js index 9bceb855c..ae6856378 100644 --- a/api/security/createRoleMapping.js +++ b/api/security/createRoleMapping.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.role + * @param {string} params.role - The name of the role to create a role mapping for. * @param {object} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/createTenant.js b/api/security/createTenant.js index 1edb41096..9f4c9600c 100644 --- a/api/security/createTenant.js +++ b/api/security/createTenant.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.tenant + * @param {string} params.tenant - The name of the tenant to be created. * @param {object} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/createUpdateTenancyConfig.d.ts b/api/security/createUpdateTenancyConfig.d.ts index 7286e5db4..5402b421d 100644 --- a/api/security/createUpdateTenancyConfig.d.ts +++ b/api/security/createUpdateTenancyConfig.d.ts @@ -19,11 +19,9 @@ import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_CreateUpdateTenancyConfig_Request extends Global.Params { - body: Security_CreateUpdateTenancyConfig_RequestBody; + body: Security_Common.MultiTenancyConfig; } -export type Security_CreateUpdateTenancyConfig_RequestBody = Security_Common.MultiTenancyConfig[] - export interface Security_CreateUpdateTenancyConfig_Response extends ApiResponse { body: Security_CreateUpdateTenancyConfig_ResponseBody; } diff --git a/api/security/createUpdateTenancyConfig.js b/api/security/createUpdateTenancyConfig.js index c6dfc7842..29ba08cef 100644 --- a/api/security/createUpdateTenancyConfig.js +++ b/api/security/createUpdateTenancyConfig.js @@ -25,7 +25,7 @@ const { normalizeArguments, handleMissingParam } = require('../utils'); * @memberOf API-Security * * @param {object} params - * @param {array} params.body + * @param {object} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/createUser.js b/api/security/createUser.js index 7b7552172..83f6debf2 100644 --- a/api/security/createUser.js +++ b/api/security/createUser.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to be created. * @param {object} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/createUserLegacy.js b/api/security/createUserLegacy.js index 04cec64cd..73fccdcc7 100644 --- a/api/security/createUserLegacy.js +++ b/api/security/createUserLegacy.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to be created. * @param {object} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/deleteActionGroup.js b/api/security/deleteActionGroup.js index 6d766b69f..47662f76f 100644 --- a/api/security/deleteActionGroup.js +++ b/api/security/deleteActionGroup.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.action_group - Action group to delete. + * @param {string} params.action_group - The name of the action group to delete. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/deleteDistinguishedName.js b/api/security/deleteDistinguishedName.js index e490161de..817b98907 100644 --- a/api/security/deleteDistinguishedName.js +++ b/api/security/deleteDistinguishedName.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.cluster_name + * @param {string} params.cluster_name - The cluster-name to delete from list of distinguished names. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/deleteRole.js b/api/security/deleteRole.js index 390ab9562..d37514d92 100644 --- a/api/security/deleteRole.js +++ b/api/security/deleteRole.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.role + * @param {string} params.role - The name of the role to delete. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/deleteRoleMapping.js b/api/security/deleteRoleMapping.js index f63ff39ea..07c3f10ec 100644 --- a/api/security/deleteRoleMapping.js +++ b/api/security/deleteRoleMapping.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.role + * @param {string} params.role - The name of the role whose mapping needs to delete. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/deleteTenant.js b/api/security/deleteTenant.js index 700a2ca6b..08fabbaa1 100644 --- a/api/security/deleteTenant.js +++ b/api/security/deleteTenant.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.tenant + * @param {string} params.tenant - The name of the tenant to delete. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/deleteUser.js b/api/security/deleteUser.js index 41d1796a5..d17365f2a 100644 --- a/api/security/deleteUser.js +++ b/api/security/deleteUser.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to delete. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/deleteUserLegacy.js b/api/security/deleteUserLegacy.js index 2a5b1a2fd..dba548273 100644 --- a/api/security/deleteUserLegacy.js +++ b/api/security/deleteUserLegacy.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to delete. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/generateUserToken.js b/api/security/generateUserToken.js index 36330e412..15f388256 100644 --- a/api/security/generateUserToken.js +++ b/api/security/generateUserToken.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @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 diff --git a/api/security/getActionGroup.js b/api/security/getActionGroup.js index 0d7be28c4..ad7052dae 100644 --- a/api/security/getActionGroup.js +++ b/api/security/getActionGroup.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.action_group - Action group to retrieve. + * @param {string} params.action_group - The name of the action group to retrieve. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/generateUserTokenLegacy.d.ts b/api/security/getAllCertificates.d.ts similarity index 60% rename from api/security/generateUserTokenLegacy.d.ts rename to api/security/getAllCertificates.d.ts index f7cbac65d..de5d82780 100644 --- a/api/security/generateUserTokenLegacy.d.ts +++ b/api/security/getAllCertificates.d.ts @@ -16,15 +16,17 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' +import * as Common from '../_types/_common' import * as Security_Common from '../_types/security._common' -export interface Security_GenerateUserTokenLegacy_Request extends Global.Params { - username: string; +export interface Security_GetAllCertificates_Request extends Global.Params { + cert_type?: string; + timeout?: Common.Duration; } -export interface Security_GenerateUserTokenLegacy_Response extends ApiResponse { - body: Security_GenerateUserTokenLegacy_ResponseBody; +export interface Security_GetAllCertificates_Response extends ApiResponse { + body: Security_GetAllCertificates_ResponseBody; } -export type Security_GenerateUserTokenLegacy_ResponseBody = Security_Common.Ok +export type Security_GetAllCertificates_ResponseBody = Security_Common.GetCertificatesNew diff --git a/api/security/getAllCertificates.js b/api/security/getAllCertificates.js new file mode 100644 index 000000000..ee61df943 --- /dev/null +++ b/api/security/getAllCertificates.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 } = require('../utils'); + +/** + * Retrieves the cluster security certificates. + *
See Also: {@link undefined - security.get_all_certificates} + * + * @memberOf API-Security + * + * @param {object} [params] + * @param {string} [params.cert_type] - The type of certificates (HTTP, TRANSPORT, ALL) to retrieve from all nodes. + * @param {string} [params.timeout] - The maximum duration, in seconds, to be spent to retrieve certificates from all nodes. + * + * @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 getAllCertificatesFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_security/api/certificates'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getAllCertificatesFunc; diff --git a/api/security/getConfiguration.d.ts b/api/security/getConfiguration.d.ts index 6e0837627..92a8a0a1f 100644 --- a/api/security/getConfiguration.d.ts +++ b/api/security/getConfiguration.d.ts @@ -24,5 +24,5 @@ export interface Security_GetConfiguration_Response extends ApiResponse { body: Security_GetConfiguration_ResponseBody; } -export type Security_GetConfiguration_ResponseBody = Security_Common.DynamicConfig +export type Security_GetConfiguration_ResponseBody = Security_Common.SecurityConfig diff --git a/api/security/getDistinguishedName.js b/api/security/getDistinguishedName.js index 58a97ad90..8334f5f6b 100644 --- a/api/security/getDistinguishedName.js +++ b/api/security/getDistinguishedName.js @@ -25,8 +25,8 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {boolean} [params.show_all] - * @param {string} params.cluster_name + * @param {boolean} [params.show_all] - A boolean flag to include/exclude static nodes DN from final result. + * @param {string} params.cluster_name - The cluster-name to retrieve nodes DN setting for. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/getDistinguishedNames.js b/api/security/getDistinguishedNames.js index 596ae50f3..4e51259d8 100644 --- a/api/security/getDistinguishedNames.js +++ b/api/security/getDistinguishedNames.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Security * * @param {object} [params] - * @param {boolean} [params.show_all] + * @param {boolean} [params.show_all] - A boolean flag to include/exclude static nodes DN from final result. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/getNodeCertificates.d.ts b/api/security/getNodeCertificates.d.ts new file mode 100644 index 000000000..cff9c688f --- /dev/null +++ b/api/security/getNodeCertificates.d.ts @@ -0,0 +1,33 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Global from '../_types/_global' +import * as Common from '../_types/_common' +import * as Security_Common from '../_types/security._common' + +export interface Security_GetNodeCertificates_Request extends Global.Params { + cert_type?: string; + node_id: string; + timeout?: Common.Duration; +} + +export interface Security_GetNodeCertificates_Response extends ApiResponse { + body: Security_GetNodeCertificates_ResponseBody; +} + +export type Security_GetNodeCertificates_ResponseBody = Security_Common.GetCertificatesNew + diff --git a/api/security/getNodeCertificates.js b/api/security/getNodeCertificates.js new file mode 100644 index 000000000..0370db242 --- /dev/null +++ b/api/security/getNodeCertificates.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, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Retrieves the given node's security certificates. + *
See Also: {@link undefined - security.get_node_certificates} + * + * @memberOf API-Security + * + * @param {object} params + * @param {string} [params.cert_type] - The type of certificates (HTTP, TRANSPORT, ALL) to retrieve for a node. + * @param {string} [params.timeout] - The maximum duration, in seconds, to be spent to retrieve a node's certificates. + * @param {string} params.node_id - The full-id of the node to retrieve certificates. + * + * @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 getNodeCertificatesFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.node_id == null) return handleMissingParam('node_id', this, callback); + + let { body, node_id, ...querystring } = params; + node_id = parsePathParam(node_id); + + const path = '/_plugins/_security/api/certificates/' + node_id; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = getNodeCertificatesFunc; diff --git a/api/security/getSslinfo.d.ts b/api/security/getSslinfo.d.ts index ab1b5ec9d..095db3f1c 100644 --- a/api/security/getSslinfo.d.ts +++ b/api/security/getSslinfo.d.ts @@ -19,7 +19,7 @@ import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_GetSslinfo_Request extends Global.Params { - show_dn?: string; + show_dn?: boolean | string; } export interface Security_GetSslinfo_Response extends ApiResponse { diff --git a/api/security/getSslinfo.js b/api/security/getSslinfo.js index 74183cc6b..7abf2d762 100644 --- a/api/security/getSslinfo.js +++ b/api/security/getSslinfo.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Security * * @param {object} [params] - * @param {string} [params.show_dn] - The domain names from all certificates. + * @param {boolean | string} [params.show_dn] - A boolean flag to indicate whether all domain names should be returned. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/getTenant.js b/api/security/getTenant.js index 52aa2b639..417108645 100644 --- a/api/security/getTenant.js +++ b/api/security/getTenant.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.tenant + * @param {string} params.tenant - The name of the tenant to retrieve. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/getUser.js b/api/security/getUser.js index 36dd7c3c7..da612887c 100644 --- a/api/security/getUser.js +++ b/api/security/getUser.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to retrieve. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/getUserLegacy.js b/api/security/getUserLegacy.js index b0ed266f8..9498f6c20 100644 --- a/api/security/getUserLegacy.js +++ b/api/security/getUserLegacy.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to retrieve. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/health.js b/api/security/health.js index 0a345bb3c..97d8c99dc 100644 --- a/api/security/health.js +++ b/api/security/health.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Security * * @param {object} [params] - * @param {string} [params.mode] + * @param {string} [params.mode] - A flag to indicate whether service should consider security-plugin's status before returning health response. `strict` mode indicates service should check security plugin status. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/security/patchActionGroup.js b/api/security/patchActionGroup.js index 7b0eb94bf..b5446624b 100644 --- a/api/security/patchActionGroup.js +++ b/api/security/patchActionGroup.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.action_group + * @param {string} params.action_group - The name of the action group to update. * @param {array} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/patchDistinguishedName.js b/api/security/patchDistinguishedName.js index 7a10673a7..9cab0df00 100644 --- a/api/security/patchDistinguishedName.js +++ b/api/security/patchDistinguishedName.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.cluster_name + * @param {string} params.cluster_name - The cluster-name to update nodesDn value. * @param {object} [params.body] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/patchRole.js b/api/security/patchRole.js index 48e0341a2..b63dce2c0 100644 --- a/api/security/patchRole.js +++ b/api/security/patchRole.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.role + * @param {string} params.role - The name of the role to update. * @param {array} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/patchRoleMapping.js b/api/security/patchRoleMapping.js index f6fab6020..8822bb751 100644 --- a/api/security/patchRoleMapping.js +++ b/api/security/patchRoleMapping.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.role + * @param {string} params.role - The name of the role to update role-mapping for. * @param {array} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/patchTenant.js b/api/security/patchTenant.js index 4e7e78358..d0b9c5f7f 100644 --- a/api/security/patchTenant.js +++ b/api/security/patchTenant.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.tenant + * @param {string} params.tenant - The name of the tenant to update. * @param {array} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/patchUser.js b/api/security/patchUser.js index 0706ae0c0..8ae3e87de 100644 --- a/api/security/patchUser.js +++ b/api/security/patchUser.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.username + * @param {string} params.username - The name of the user to update. * @param {array} params.body * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/postDashboardsInfo.d.ts b/api/security/postDashboardsInfo.d.ts index 4cffc802e..0805f5723 100644 --- a/api/security/postDashboardsInfo.d.ts +++ b/api/security/postDashboardsInfo.d.ts @@ -18,9 +18,7 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' -export interface Security_PostDashboardsInfo_Request extends Global.Params { - body?: Security_Common.DashboardsInfo; -} +export type Security_PostDashboardsInfo_Request = Global.Params & Record export interface Security_PostDashboardsInfo_Response extends ApiResponse { body: Security_PostDashboardsInfo_ResponseBody; diff --git a/api/security/postDashboardsInfo.js b/api/security/postDashboardsInfo.js index b0ecf9a4b..631becac5 100644 --- a/api/security/postDashboardsInfo.js +++ b/api/security/postDashboardsInfo.js @@ -24,9 +24,7 @@ const { normalizeArguments } = require('../utils'); * * @memberOf API-Security * - * @param {object} [params] - * @param {object} [params.body] - * + * @param {object} [params] - (Unused) * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response * diff --git a/api/security/updateDistinguishedName.d.ts b/api/security/updateDistinguishedName.d.ts index 7b0809943..9d8cd133b 100644 --- a/api/security/updateDistinguishedName.d.ts +++ b/api/security/updateDistinguishedName.d.ts @@ -19,7 +19,7 @@ import * as Global from '../_types/_global' import * as Security_Common from '../_types/security._common' export interface Security_UpdateDistinguishedName_Request extends Global.Params { - body?: Security_Common.PatchOperation; + body?: Security_Common.DistinguishedNames; cluster_name: string; } diff --git a/api/security/updateDistinguishedName.js b/api/security/updateDistinguishedName.js index e51be903a..227a0f6de 100644 --- a/api/security/updateDistinguishedName.js +++ b/api/security/updateDistinguishedName.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Security * * @param {object} params - * @param {string} params.cluster_name + * @param {string} params.cluster_name - The cluster-name to create/update nodesDn value for. * @param {object} [params.body] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/security/validate.js b/api/security/validate.js index 7f71c9f96..b56d77b57 100644 --- a/api/security/validate.js +++ b/api/security/validate.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Security * * @param {object} [params] - * @param {boolean} [params.accept_invalid] + * @param {boolean} [params.accept_invalid] - A boolean flag to indicate whether invalid v6 configuration should be allowed. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/package.json b/package.json index 0cdb38530..1a10f4cea 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "LICENSE.txt" ], "homepage": "https://www.opensearch.org/", - "version": "3.0.0", + "version": "3.0.0-beta.7", "versionCanary": "7.10.0-canary.6", "keywords": [ "opensearch",