diff --git a/api/OpenSearchApi.d.ts b/api/OpenSearchApi.d.ts index 42eb79c91..7c2d038f8 100644 --- a/api/OpenSearchApi.d.ts +++ b/api/OpenSearchApi.d.ts @@ -913,6 +913,56 @@ export default class OpenSearchAPI { }; + replication: { + deleteReplicationRule (params: API.Replication_DeleteReplicationRule_Request, options?: TransportRequestOptions): TransportRequestPromise; + deleteReplicationRule (params: API.Replication_DeleteReplicationRule_Request, callback: callbackFn): TransportRequestCallback; + deleteReplicationRule (params: API.Replication_DeleteReplicationRule_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + createReplicationRule (params: API.Replication_CreateReplicationRule_Request, options?: TransportRequestOptions): TransportRequestPromise; + createReplicationRule (params: API.Replication_CreateReplicationRule_Request, callback: callbackFn): TransportRequestCallback; + createReplicationRule (params: API.Replication_CreateReplicationRule_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + pause (params: API.Replication_Pause_Request, options?: TransportRequestOptions): TransportRequestPromise; + pause (params: API.Replication_Pause_Request, callback: callbackFn): TransportRequestCallback; + pause (params: API.Replication_Pause_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + resume (params: API.Replication_Resume_Request, options?: TransportRequestOptions): TransportRequestPromise; + resume (params: API.Replication_Resume_Request, callback: callbackFn): TransportRequestCallback; + resume (params: API.Replication_Resume_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + start (params: API.Replication_Start_Request, options?: TransportRequestOptions): TransportRequestPromise; + start (params: API.Replication_Start_Request, callback: callbackFn): TransportRequestCallback; + start (params: API.Replication_Start_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + status (params: API.Replication_Status_Request, options?: TransportRequestOptions): TransportRequestPromise; + status (params: API.Replication_Status_Request, callback: callbackFn): TransportRequestCallback; + status (params: API.Replication_Status_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + stop (params: API.Replication_Stop_Request, options?: TransportRequestOptions): TransportRequestPromise; + stop (params: API.Replication_Stop_Request, callback: callbackFn): TransportRequestCallback; + stop (params: API.Replication_Stop_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + updateSettings (params: API.Replication_UpdateSettings_Request, options?: TransportRequestOptions): TransportRequestPromise; + updateSettings (params: API.Replication_UpdateSettings_Request, callback: callbackFn): TransportRequestCallback; + updateSettings (params: API.Replication_UpdateSettings_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + autofollowStats (params?: API.Replication_AutofollowStats_Request, options?: TransportRequestOptions): TransportRequestPromise; + autofollowStats (callback: callbackFn): TransportRequestCallback; + autofollowStats (params: API.Replication_AutofollowStats_Request, callback: callbackFn): TransportRequestCallback; + autofollowStats (params: API.Replication_AutofollowStats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + followerStats (params?: API.Replication_FollowerStats_Request, options?: TransportRequestOptions): TransportRequestPromise; + followerStats (callback: callbackFn): TransportRequestCallback; + followerStats (params: API.Replication_FollowerStats_Request, callback: callbackFn): TransportRequestCallback; + followerStats (params: API.Replication_FollowerStats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + leaderStats (params?: API.Replication_LeaderStats_Request, options?: TransportRequestOptions): TransportRequestPromise; + leaderStats (callback: callbackFn): TransportRequestCallback; + leaderStats (params: API.Replication_LeaderStats_Request, callback: callbackFn): TransportRequestCallback; + leaderStats (params: API.Replication_LeaderStats_Request, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback; + + }; + rollups: { delete (params: API.Rollups_Delete_Request, options?: TransportRequestOptions): TransportRequestPromise; delete (params: API.Rollups_Delete_Request, callback: callbackFn): TransportRequestCallback; diff --git a/api/OpenSearchApi.js b/api/OpenSearchApi.js index 6eb8a2556..1e7ca795e 100644 --- a/api/OpenSearchApi.js +++ b/api/OpenSearchApi.js @@ -42,6 +42,7 @@ class OpenSearchAPI { ppl: new(require('./ppl/_api'))(this), query: new(require('./query/_api'))(this), remoteStore: new(require('./remoteStore/_api'))(this), + replication: new(require('./replication/_api'))(this), rollups: new(require('./rollups/_api'))(this), searchPipeline: new(require('./searchPipeline/_api'))(this), security: new(require('./security/_api'))(this), @@ -170,6 +171,7 @@ class OpenSearchAPI { ppl: { get() { return this[kApiModules].ppl } }, query: { get() { return this[kApiModules].query } }, remoteStore: { get() { return this[kApiModules].remoteStore } }, + replication: { get() { return this[kApiModules].replication } }, rollups: { get() { return this[kApiModules].rollups } }, searchPipeline: { get() { return this[kApiModules].searchPipeline } }, security: { get() { return this[kApiModules].security } }, diff --git a/api/_core/bulk.js b/api/_core/bulk.js index ab2003991..acde21cec 100644 --- a/api/_core/bulk.js +++ b/api/_core/bulk.js @@ -50,7 +50,7 @@ function bulkFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_bulk'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_bulk'].filter(c => c != null).join('/'); const method = index == null ? 'POST' : 'PUT'; return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback); diff --git a/api/_core/bulkStream.js b/api/_core/bulkStream.js index f9a00e346..c4367d54f 100644 --- a/api/_core/bulkStream.js +++ b/api/_core/bulkStream.js @@ -52,7 +52,7 @@ function bulkStreamFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_bulk/stream'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_bulk/stream'].filter(c => c != null).join('/'); const method = index == null ? 'POST' : 'PUT'; return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback); diff --git a/api/_core/clearScroll.js b/api/_core/clearScroll.js index 03eccc93f..284d69e68 100644 --- a/api/_core/clearScroll.js +++ b/api/_core/clearScroll.js @@ -39,7 +39,7 @@ function clearScrollFunc(params, options, callback) { let { body, scroll_id, ...querystring } = params; scroll_id = parsePathParam(scroll_id); - const path = ['/_search/scroll/', scroll_id].filter(c => c).join('').replace('//', '/'); + const path = ['/_search/scroll', scroll_id].filter(c => c != null).join('/'); const method = 'DELETE'; body = body || ''; diff --git a/api/_core/count.js b/api/_core/count.js index 35e93ec29..f6fd51e01 100644 --- a/api/_core/count.js +++ b/api/_core/count.js @@ -53,7 +53,7 @@ function countFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_count'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_count'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/deleteByQuery.d.ts b/api/_core/deleteByQuery.d.ts index 640a09b3b..9f0488bc2 100644 --- a/api/_core/deleteByQuery.d.ts +++ b/api/_core/deleteByQuery.d.ts @@ -38,7 +38,7 @@ export type DeleteByQuery_Request = Global.Params & { max_docs?: number; preference?: string; q?: string; - refresh?: boolean; + refresh?: Common.Refresh; request_cache?: boolean; requests_per_second?: number; routing?: Common.RoutingInQueryString; diff --git a/api/_core/deleteByQuery.js b/api/_core/deleteByQuery.js index f7a37654b..8ecd1dc00 100644 --- a/api/_core/deleteByQuery.js +++ b/api/_core/deleteByQuery.js @@ -25,9 +25,9 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {array} [params._source] - True or false to return the _source field or not, or a list of fields to return. - * @param {array} [params._source_excludes] - List of fields to exclude from the returned _source field. - * @param {array} [params._source_includes] - List of fields to extract and return from the _source field. + * @param {array} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. + * @param {array} [params._source_excludes] - List of fields to exclude from the returned `_source` field. + * @param {array} [params._source_includes] - List of fields to extract and return from the `_source` field. * @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. * @param {boolean} [params.analyze_wildcard=false] - If `true`, wildcard and prefix queries are analyzed. * @param {string} [params.analyzer] - Analyzer to use for the query string. @@ -41,7 +41,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {number} [params.max_docs] - Maximum number of documents to process. Defaults to all documents. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {string} [params.q] - Query in the Lucene query string syntax. - * @param {boolean} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. * @param {boolean} [params.request_cache] - If `true`, the request cache is used for this request. Defaults to the index-level setting. * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. @@ -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 {number} [params.size] - Deprecated, please use `max_docs` instead. + * @param {number} [params.size] - Deprecated, 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/deleteScript.js b/api/_core/deleteScript.js index 537b204bf..02657d32a 100644 --- a/api/_core/deleteScript.js +++ b/api/_core/deleteScript.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.id - Identifier for the stored script or search template. * diff --git a/api/_core/exists.d.ts b/api/_core/exists.d.ts index d100b7816..304e7ffcd 100644 --- a/api/_core/exists.d.ts +++ b/api/_core/exists.d.ts @@ -27,7 +27,7 @@ export type Exists_Request = Global.Params & { index: Common.IndexName; preference?: string; realtime?: boolean; - refresh?: boolean; + refresh?: Common.Refresh; routing?: Common.RoutingInQueryString; stored_fields?: Common.Fields; version?: Common.VersionNumber; diff --git a/api/_core/exists.js b/api/_core/exists.js index fd2f5e0b9..e3bc6aff3 100644 --- a/api/_core/exists.js +++ b/api/_core/exists.js @@ -30,7 +30,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {boolean} [params.realtime] - If `true`, the request is real-time as opposed to near-real-time. - * @param {boolean} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. * @param {string} [params.routing] - Target the specified primary shard. * @param {string} [params.stored_fields] - List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to false. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. diff --git a/api/_core/existsSource.d.ts b/api/_core/existsSource.d.ts index 8a102215e..c6c77bb7c 100644 --- a/api/_core/existsSource.d.ts +++ b/api/_core/existsSource.d.ts @@ -27,7 +27,7 @@ export type ExistsSource_Request = Global.Params & { index: Common.IndexName; preference?: string; realtime?: boolean; - refresh?: boolean; + refresh?: Common.Refresh; routing?: Common.RoutingInQueryString; version?: Common.VersionNumber; version_type?: Common.VersionType; diff --git a/api/_core/existsSource.js b/api/_core/existsSource.js index 7d96295c2..76cc332cf 100644 --- a/api/_core/existsSource.js +++ b/api/_core/existsSource.js @@ -29,8 +29,8 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the response. * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. - * @param {boolean} [params.realtime] - If true, the request is real-time as opposed to near-real-time. - * @param {boolean} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. + * @param {boolean} [params.realtime] - If `true`, the request is real-time as opposed to near-real-time. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. * @param {string} [params.routing] - Target the specified primary shard. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`. diff --git a/api/_core/explain.js b/api/_core/explain.js index a52503559..ada0c3b35 100644 --- a/api/_core/explain.js +++ b/api/_core/explain.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {string} [params._source] - True or false to return the `_source` field or not, or a list of fields to return. + * @param {string} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude from the response. * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. * @param {boolean} [params.analyze_wildcard=false] - If `true`, wildcard and prefix queries are analyzed. diff --git a/api/_core/fieldCaps.js b/api/_core/fieldCaps.js index 67aca4141..d65e7580f 100644 --- a/api/_core/fieldCaps.js +++ b/api/_core/fieldCaps.js @@ -25,12 +25,12 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Core * * @param {object} [params] - * @param {boolean} [params.allow_no_indices] - If false, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. + * @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. * @param {string} [params.fields] - Comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. * @param {boolean} [params.ignore_unavailable] - If `true`, missing or closed indexes are not included in the response. - * @param {boolean} [params.include_unmapped=false] - If true, unmapped fields are included in the response. - * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or _all. + * @param {boolean} [params.include_unmapped=false] - If `true`, unmapped fields are included in the response. + * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or `_all`. * @param {object} [params.body] - An index filter specified with the Query DSL * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} @@ -44,7 +44,7 @@ function fieldCapsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_field_caps'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_field_caps'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/get.d.ts b/api/_core/get.d.ts index 59d1e85eb..bd567f64d 100644 --- a/api/_core/get.d.ts +++ b/api/_core/get.d.ts @@ -28,7 +28,7 @@ export type Get_Request = Global.Params & { index: Common.IndexName; preference?: string; realtime?: boolean; - refresh?: boolean; + refresh?: Common.Refresh; routing?: Common.RoutingInQueryString; stored_fields?: Common.Fields; version?: Common.VersionNumber; diff --git a/api/_core/get.js b/api/_core/get.js index 190364e60..662ef9cb8 100644 --- a/api/_core/get.js +++ b/api/_core/get.js @@ -25,16 +25,16 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return. + * @param {string} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the response. * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {boolean} [params.realtime] - If `true`, the request is real-time as opposed to near-real-time. - * @param {boolean} [params.refresh] - If true, OpenSearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search. If `false`, do nothing with refreshes. * @param {string} [params.routing] - Target the specified primary shard. * @param {string} [params.stored_fields] - List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the `_source` parameter defaults to false. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. - * @param {string} [params.version_type] - Specific version type: internal, external, external_gte. + * @param {string} [params.version_type] - Specific version type: `internal`, `external`, `external_gte`. * @param {string} params.id - Unique identifier of the document. * @param {string} params.index - Name of the index that contains the document. * diff --git a/api/_core/getSource.d.ts b/api/_core/getSource.d.ts index 9abf805ac..77a574413 100644 --- a/api/_core/getSource.d.ts +++ b/api/_core/getSource.d.ts @@ -27,7 +27,7 @@ export type GetSource_Request = Global.Params & { index: Common.IndexName; preference?: string; realtime?: boolean; - refresh?: boolean; + refresh?: Common.Refresh; routing?: Common.RoutingInQueryString; version?: Common.VersionNumber; version_type?: Common.VersionType; diff --git a/api/_core/getSource.js b/api/_core/getSource.js index 2c490a7d4..4bd27f4a4 100644 --- a/api/_core/getSource.js +++ b/api/_core/getSource.js @@ -25,15 +25,15 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return. + * @param {string} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the response. * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. - * @param {boolean} [params.realtime] - Boolean) If true, the request is real-time as opposed to near-real-time. - * @param {boolean} [params.refresh] - If true, OpenSearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + * @param {boolean} [params.realtime] - Boolean) If `true`, the request is real-time as opposed to near-real-time. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search. If `false`, do nothing with refreshes. * @param {string} [params.routing] - Target the specified primary shard. * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. - * @param {string} [params.version_type] - Specific version type: internal, external, external_gte. + * @param {string} [params.version_type] - Specific version type. One of `internal`, `external`, `external_gte`. * @param {string} params.id - Unique identifier of the document. * @param {string} params.index - Name of the index that contains the document. * diff --git a/api/_core/index.js b/api/_core/index.js index a193019c1..007a5f652 100644 --- a/api/_core/index.js +++ b/api/_core/index.js @@ -54,7 +54,7 @@ function indexFunc(params, options, callback) { index = parsePathParam(index); id = parsePathParam(id); - const path = ['/', index, '/_doc/', id].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_doc', id].filter(c => c != null).join('/'); const method = id == null ? 'POST' : 'PUT'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/_core/mget.d.ts b/api/_core/mget.d.ts index bbfa7fb98..dbcb38824 100644 --- a/api/_core/mget.d.ts +++ b/api/_core/mget.d.ts @@ -28,7 +28,7 @@ export type Mget_Request = Global.Params & { index?: Common.IndexName; preference?: string; realtime?: boolean; - refresh?: boolean; + refresh?: Common.Refresh; routing?: Common.RoutingInQueryString; stored_fields?: Common.Fields; } diff --git a/api/_core/mget.js b/api/_core/mget.js index 2cd3ddfb2..4fe9b4e0c 100644 --- a/api/_core/mget.js +++ b/api/_core/mget.js @@ -25,12 +25,12 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {string} [params._source] - True or false to return the `_source` field or not, or a list of fields to return. + * @param {string} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {boolean} [params.realtime] - If `true`, the request is real-time as opposed to near-real-time. - * @param {boolean} [params.refresh] - If `true`, the request refreshes relevant shards before retrieving documents. + * @param {string} [params.refresh] - If `true`, the request refreshes relevant shards before retrieving documents. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. * @param {string} [params.stored_fields] - If `true`, retrieves the document fields stored in the index rather than the document `_source`. * @param {string} [params.index] - Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. @@ -48,7 +48,7 @@ function mgetFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_mget'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_mget'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/_core/msearch.js b/api/_core/msearch.js index 316e93b87..c235e192d 100644 --- a/api/_core/msearch.js +++ b/api/_core/msearch.js @@ -25,11 +25,11 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {boolean} [params.ccs_minimize_roundtrips=true] - If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. + * @param {boolean} [params.ccs_minimize_roundtrips=true] - If `true`, network round-trips between the coordinating node and remote clusters are minimized for cross-cluster search requests. * @param {number} [params.max_concurrent_searches] - Maximum number of concurrent searches the multi search API can execute. * @param {number} [params.max_concurrent_shard_requests=5] - Maximum number of concurrent shard requests that each sub-search request executes per node. * @param {number} [params.pre_filter_shard_size] - Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {boolean} [params.rest_total_hits_as_int=false] - If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. + * @param {boolean} [params.rest_total_hits_as_int=false] - If `true`, hits.total are returned as an integer in the response. Defaults to false, which returns an object. * @param {string} [params.search_type] - Indicates whether global term and document frequencies should be used when scoring returned documents. * @param {boolean} [params.typed_keys] - Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and index aliases to search. @@ -47,7 +47,7 @@ function msearchFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_msearch'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_msearch'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback); diff --git a/api/_core/msearchTemplate.js b/api/_core/msearchTemplate.js index 766801217..4d8c9b959 100644 --- a/api/_core/msearchTemplate.js +++ b/api/_core/msearchTemplate.js @@ -45,7 +45,7 @@ function msearchTemplateFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_msearch/template'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_msearch/template'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback); diff --git a/api/_core/mtermvectors.js b/api/_core/mtermvectors.js index 33c8db0e7..add491213 100644 --- a/api/_core/mtermvectors.js +++ b/api/_core/mtermvectors.js @@ -32,9 +32,9 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.payloads=true] - If `true`, the response includes term payloads. * @param {boolean} [params.positions=true] - If `true`, the response includes term positions. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. - * @param {boolean} [params.realtime=true] - If true, the request is real-time as opposed to near-real-time. + * @param {boolean} [params.realtime=true] - If `true`, the request is real-time as opposed to near-real-time. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. - * @param {boolean} [params.term_statistics=false] - If true, the response includes term frequency and document frequency. + * @param {boolean} [params.term_statistics=false] - If `true`, the response includes term frequency and document frequency. * @param {number} [params.version] - If `true`, returns the document version as part of a hit. * @param {string} [params.version_type] - Specific version type. * @param {string} [params.index] - Name of the index that contains the documents. @@ -51,7 +51,7 @@ function mtermvectorsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_mtermvectors'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_mtermvectors'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/putScript.js b/api/_core/putScript.js index 86e81a67d..a70e02fb9 100644 --- a/api/_core/putScript.js +++ b/api/_core/putScript.js @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.context] - Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.id - Identifier for the stored script or search template. Must be unique within the cluster. * @param {object} params.body - The document @@ -46,7 +46,7 @@ function putScriptFunc(params, options, callback) { id = parsePathParam(id); context = parsePathParam(context); - const path = ['/_scripts/', id, '/', context].filter(c => c).join('').replace('//', '/'); + const path = ['/_scripts', id, context].filter(c => c != null).join('/'); const method = context == null ? 'POST' : 'PUT'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/_core/rankEval.js b/api/_core/rankEval.js index c4e6b2567..7c77ec401 100644 --- a/api/_core/rankEval.js +++ b/api/_core/rankEval.js @@ -44,7 +44,7 @@ function rankEvalFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_rank_eval'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_rank_eval'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/_core/reindex.d.ts b/api/_core/reindex.d.ts index 2d9cc8bbc..7b618b300 100644 --- a/api/_core/reindex.d.ts +++ b/api/_core/reindex.d.ts @@ -22,7 +22,7 @@ import * as Global from '../_types/_global' export type Reindex_Request = Global.Params & { body: Reindex_RequestBody; max_docs?: number; - refresh?: boolean; + refresh?: Common.Refresh; requests_per_second?: number; scroll?: Common.Duration; slices?: Common.Slices; diff --git a/api/_core/reindex.js b/api/_core/reindex.js index 0b59788f0..76bbbd5e6 100644 --- a/api/_core/reindex.js +++ b/api/_core/reindex.js @@ -28,7 +28,7 @@ documents from a remote cluster. * * @param {object} params * @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 {string} [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. * @param {string} [params.slices] - The number of slices this task should be divided into. Defaults to 1 slice, meaning the task isn't sliced into subtasks. diff --git a/api/_core/renderSearchTemplate.js b/api/_core/renderSearchTemplate.js index 89f3e0a43..4929c6437 100644 --- a/api/_core/renderSearchTemplate.js +++ b/api/_core/renderSearchTemplate.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.id] - ID of the search template to render. If no `source` is specified, this or the `id` request body parameter is required. - * @param {object} [params.body] - The search definition template and its params + * @param {object} [params.body] - The search definition template and its parameters. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response @@ -39,7 +39,7 @@ function renderSearchTemplateFunc(params, options, callback) { let { body, id, ...querystring } = params; id = parsePathParam(id); - const path = ['/_render/template/', id].filter(c => c).join('').replace('//', '/'); + const path = ['/_render/template', id].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/scroll.js b/api/_core/scroll.js index 982d2b76b..3137386e8 100644 --- a/api/_core/scroll.js +++ b/api/_core/scroll.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Core * * @param {object} [params] - * @param {boolean} [params.rest_total_hits_as_int=false] - If true, the API response's hit.total property is returned as an integer. If false, the API response's hit.total property is returned as an object. + * @param {boolean} [params.rest_total_hits_as_int=false] - If `true`, the API response's `hit.total` property is returned as an integer. If `false`, the API response's `hit.total` property is returned as an object. * @param {string} [params.scroll] - Period to retain the search context for scrolling. * @param {string} [params.scroll_id] DEPRECATED - The scroll ID * @param {object} [params.body] - The scroll ID if not passed by URL or query parameter. @@ -41,7 +41,7 @@ function scrollFunc(params, options, callback) { let { body, scroll_id, ...querystring } = params; scroll_id = parsePathParam(scroll_id); - const path = ['/_search/scroll/', scroll_id].filter(c => c).join('').replace('//', '/'); + const path = ['/_search/scroll', scroll_id].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/search.js b/api/_core/search.js index 5deb13f6f..c357753d3 100644 --- a/api/_core/search.js +++ b/api/_core/search.js @@ -29,12 +29,12 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. * @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. - * @param {boolean} [params.allow_partial_search_results=true] - If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. - * @param {boolean} [params.analyze_wildcard=false] - If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified. + * @param {boolean} [params.allow_partial_search_results=true] - If `true`, returns partial results if there are shard request timeouts or shard failures. If `false`, returns an error with no partial results. + * @param {boolean} [params.analyze_wildcard=false] - If `true`, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified. * @param {string} [params.analyzer] - Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified. * @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 {string} [params.cancel_after_time_interval] - The time after which the search request will be canceled. Request-level parameter takes precedence over `cancel_after_time_interval` cluster setting. - * @param {boolean} [params.ccs_minimize_roundtrips=true] - If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. + * @param {boolean} [params.ccs_minimize_roundtrips=true] - If `true`, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. * @param {string} [params.default_operator] - The default operator for query string query: AND or OR. This parameter can only be used when the `q` query string parameter is specified. * @param {string} [params.df] - Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified. * @param {string} [params.docvalue_fields] - A comma-separated list of fields to return as the docvalue representation for each hit. @@ -43,7 +43,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {number} [params.from=0] - Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. * @param {boolean} [params.ignore_throttled] - If `true`, concrete, expanded or aliased indexes will be ignored when frozen. * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. - * @param {boolean} [params.include_named_queries_score=false] - Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) + * @param {boolean} [params.include_named_queries_score=false] - Indicates whether `hit.matched_queries` should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) * @param {boolean} [params.lenient] - If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the `q` query string parameter is specified. * @param {number} [params.max_concurrent_shard_requests=5] - Defines 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 {boolean} [params.phase_took=false] - Indicates whether to return phase-level `took` time values in the response. @@ -85,7 +85,7 @@ function searchFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_search'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_search'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/searchShards.js b/api/_core/searchShards.js index 991bc8a6b..b7ddf445f 100644 --- a/api/_core/searchShards.js +++ b/api/_core/searchShards.js @@ -44,7 +44,7 @@ function searchShardsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_search_shards'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_search_shards'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/searchTemplate.js b/api/_core/searchTemplate.js index 34c7bad4b..aa412516a 100644 --- a/api/_core/searchTemplate.js +++ b/api/_core/searchTemplate.js @@ -33,13 +33,13 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {boolean} [params.profile] - If `true`, the query execution is profiled. - * @param {boolean} [params.rest_total_hits_as_int=false] - If true, hits.total are rendered as an integer in the response. + * @param {boolean} [params.rest_total_hits_as_int=false] - If `true`, hits.total are rendered as an integer in the response. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. * @param {string} [params.scroll] - Specifies how long a consistent view of the index should be maintained for scrolled search. * @param {string} [params.search_type] - The type of the search operation. * @param {boolean} [params.typed_keys] - If `true`, the response prefixes aggregation and suggester names with their respective types. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (*). - * @param {object} params.body - The search definition template and its params + * @param {object} params.body - The search definition template and its parameters. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response @@ -53,7 +53,7 @@ function searchTemplateFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_search/template'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_search/template'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/_core/termvectors.js b/api/_core/termvectors.js index 054198da0..904014153 100644 --- a/api/_core/termvectors.js +++ b/api/_core/termvectors.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {boolean} [params.payloads=true] - If `true`, the response includes term payloads. * @param {boolean} [params.positions=true] - If `true`, the response includes term positions. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. - * @param {boolean} [params.realtime=true] - If true, the request is real-time as opposed to near-real-time. + * @param {boolean} [params.realtime=true] - If `true`, the request is real-time as opposed to near-real-time. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. * @param {boolean} [params.term_statistics=false] - If `true`, the response includes term frequency and document frequency. * @param {number} [params.version] - If `true`, returns the document version as part of a hit. @@ -53,7 +53,7 @@ function termvectorsFunc(params, options, callback) { index = parsePathParam(index); id = parsePathParam(id); - const path = ['/', index, '/_termvectors/', id].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_termvectors', id].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/_core/update.js b/api/_core/update.js index 1171d2031..fe6d91538 100644 --- a/api/_core/update.js +++ b/api/_core/update.js @@ -25,14 +25,14 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Core * * @param {object} params - * @param {string} [params._source] - Set to false to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve. + * @param {string} [params._source] - Set to `false` to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve. * @param {string} [params._source_excludes] - Specify the source fields you want to exclude. * @param {string} [params._source_includes] - Specify the source fields you want to retrieve. * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term. * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number. * @param {string} [params.lang=painless] - The script language. - * @param {string} [params.refresh] - If 'true', OpenSearch refreshes the affected shards to make this operation visible to search, if 'wait_for' then wait for a refresh to make this operation visible to search, if 'false' do nothing with refreshes. - * @param {boolean} [params.require_alias=false] - If true, the destination must be an index alias. + * @param {string} [params.refresh] - If 'true', OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. + * @param {boolean} [params.require_alias=false] - If `true`, the destination must be an index alias. * @param {number} [params.retry_on_conflict=0] - Specify how many times should the operation be retried when a conflict occurs. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. * @param {string} [params.timeout] - Period to wait for dynamic mapping updates and active shards. This guarantees OpenSearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur. diff --git a/api/_core/updateByQuery.d.ts b/api/_core/updateByQuery.d.ts index 63e1738bb..11df000a5 100644 --- a/api/_core/updateByQuery.d.ts +++ b/api/_core/updateByQuery.d.ts @@ -39,7 +39,7 @@ export type UpdateByQuery_Request = Global.Params & { pipeline?: string; preference?: string; q?: string; - refresh?: boolean; + refresh?: Common.Refresh; request_cache?: boolean; requests_per_second?: number; routing?: Common.RoutingInQueryString; diff --git a/api/_core/updateByQuery.js b/api/_core/updateByQuery.js index 8320ab945..bb7e9147e 100644 --- a/api/_core/updateByQuery.js +++ b/api/_core/updateByQuery.js @@ -26,9 +26,9 @@ for example to pick up a mapping change. * @memberOf API-Core * * @param {object} params - * @param {array} [params._source] - True or false to return the _source field or not, or a list of fields to return. - * @param {array} [params._source_excludes] - List of fields to exclude from the returned _source field. - * @param {array} [params._source_includes] - List of fields to extract and return from the _source field. + * @param {array} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. + * @param {array} [params._source_excludes] - List of fields to exclude from the returned `_source` field. + * @param {array} [params._source_includes] - List of fields to extract and return from the `_source` field. * @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. * @param {boolean} [params.analyze_wildcard=false] - If `true`, wildcard and prefix queries are analyzed. * @param {string} [params.analyzer] - Analyzer to use for the query string. @@ -43,7 +43,7 @@ for example to pick up a mapping change. * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default. * @param {string} [params.q] - Query in the Lucene query string syntax. - * @param {boolean} [params.refresh] - If `true`, OpenSearch refreshes affected shards to make the operation visible to search. + * @param {string} [params.refresh] - If `true`, OpenSearch refreshes affected shards to make the operation visible to search. * @param {boolean} [params.request_cache] - If `true`, the request cache is used for this request. * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. * @param {string} [params.routing] - Custom value used to route operations to a specific shard. @@ -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 {number} [params.size] - Deprecated, please use `max_docs` instead. + * @param {number} [params.size] - Deprecated, 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 3dbaf6aab..f339a82f1 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -510,7 +510,7 @@ export type RecoveryStats = { throttle_time_in_millis: DurationValueUnitMillis; } -export type Refresh = 'false' | 'true' | 'wait_for' +export type Refresh = boolean | 'false' | 'true' | 'wait_for' export type RefreshStats = { external_total: number; diff --git a/api/_types/replication._common.d.ts b/api/_types/replication._common.d.ts new file mode 100644 index 000000000..f448216f1 --- /dev/null +++ b/api/_types/replication._common.d.ts @@ -0,0 +1,143 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import * as Common from './_common' + +export type AutoFollowStats = { + failed_indices?: string[]; + last_execution_time?: number; + name?: string; + num_failed_leader_calls?: number; + num_failed_start_replication?: number; + num_success_start_replication?: number; + pattern?: string; +} + +export type AutoFollowStatus = { + autofollow_stats?: AutoFollowStats[]; + failed_indices?: string[]; + num_failed_leader_calls?: number; + num_failed_start_replication?: number; + num_success_start_replication?: number; +} + +export type CreateReplicationRule = { + leader_alias?: Common.IndexAlias; + name?: string; + pattern?: string; + use_roles?: UseRoles; +} + +export type DeleteReplicationRule = { + leader_alias?: Common.IndexAlias; + name?: string; +} + +export type FollowerStatus = { + failed_read_requests?: number; + failed_write_requests?: number; + follower_checkpoint?: number; + index_stats?: Record; + leader_checkpoint?: number; + num_bootstrapping_indices?: number; + num_failed_indices?: number; + num_index_tasks?: number; + num_paused_indices?: number; + num_shard_tasks?: number; + num_syncing_indices?: number; + operations_read?: number; + operations_written?: number; + throttled_read_requests?: number; + throttled_write_requests?: number; + total_write_time_millis?: Common.StringifiedEpochTimeUnitMillis; +} + +export type IndexFollowerStatus = { + failed_read_requests?: number; + failed_write_requests?: number; + follower_checkpoint?: number; + leader_checkpoint?: number; + operations_read?: number; + operations_written?: number; + throttled_read_requests?: number; + throttled_write_requests?: number; + total_write_time_millis?: Common.StringifiedEpochTimeUnitMillis; +} + +export type IndexSchema = { + number_of_replicas?: number; + number_of_shards?: number; +} + +export type IndexStatus = { + bytes_read?: Common.ByteCount; + operations_read?: number; + operations_read_lucene?: number; + operations_read_translog?: number; + total_read_time_lucene_millis?: Common.StringifiedEpochTimeUnitMillis; + total_read_time_translog_millis?: Common.StringifiedEpochTimeUnitMillis; + translog_size_bytes?: Common.ByteCount; +} + +export type LeaderStatus = { + bytes_read?: Common.ByteCount; + index_stats?: Record; + num_replicated_indices?: number; + operations_read?: number; + operations_read_lucene?: number; + operations_read_translog?: number; + total_read_time_lucene_millis?: Common.StringifiedEpochTimeUnitMillis; + total_read_time_translog_millis?: Common.StringifiedEpochTimeUnitMillis; + translog_size_bytes?: Common.ByteCount; +} + +export type Replication = { + leader_alias?: Common.IndexAlias; + leader_index?: Common.IndexName; + use_roles?: UseRoles; +} + +export type SettingsBody = { + index?: IndexSchema; +} + +export type Status = { + follower_index?: Common.IndexName; + leader_alias?: Common.IndexAlias; + leader_index?: Common.IndexName; + reason?: string; + status?: 'BOOTSTRAPPING' | 'PAUSED' | 'REPLICATION NOT IN PROGRESS' | 'RUNNING' | 'SYNCING'; + syncing_details?: SyncingDetails; +} + +export type SyncingDetails = { + follower_checkpoint?: number; + leader_checkpoint?: number; + seq_no?: Common.SequenceNumber; +} + +export type UpdateSettings = { + settings?: SettingsBody & { + 'index.number_of_replicas'?: number; + 'index.number_of_shards'?: number; +}; +} + +export type UseRoles = { + follower_cluster_role?: string; + leader_cluster_role?: string; +} + diff --git a/api/cat/aliases.js b/api/cat/aliases.js index 3c3a2c98a..70b435d9f 100644 --- a/api/cat/aliases.js +++ b/api/cat/aliases.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indexes that are open, closed or both. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. @@ -45,7 +45,7 @@ function aliasesFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_cat/aliases/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/aliases', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/allPitSegments.js b/api/cat/allPitSegments.js index f1713e275..8c4ef2e38 100644 --- a/api/cat/allPitSegments.js +++ b/api/cat/allPitSegments.js @@ -26,7 +26,7 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.bytes] - The unit in which to display byte values. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. diff --git a/api/cat/allocation.js b/api/cat/allocation.js index b3c44e5f2..f6ca84172 100644 --- a/api/cat/allocation.js +++ b/api/cat/allocation.js @@ -27,11 +27,11 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {string} [params.bytes] - The unit used to display byte values. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * @param {string} [params.node_id] - Comma-separated list of node identifiers or names used to limit the returned information. @@ -47,7 +47,7 @@ function allocationFunc(params, options, callback) { let { body, node_id, ...querystring } = params; node_id = parsePathParam(node_id); - const path = ['/_cat/allocation/', node_id].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/allocation', node_id].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/clusterManager.js b/api/cat/clusterManager.js index 0be599a76..9973f3000 100644 --- a/api/cat/clusterManager.js +++ b/api/cat/clusterManager.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * diff --git a/api/cat/count.js b/api/cat/count.js index 375b67335..c4b875919 100644 --- a/api/cat/count.js +++ b/api/cat/count.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Cat * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. @@ -43,7 +43,7 @@ function countFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cat/count/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/count', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/fielddata.js b/api/cat/fielddata.js index ac1df734b..43755ab4e 100644 --- a/api/cat/fielddata.js +++ b/api/cat/fielddata.js @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {string} [params.bytes] - The unit used to display byte values. * @param {string} [params.fields] - Comma-separated list of fields used to limit returned information. To retrieve all fields, omit this parameter. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. @@ -44,7 +44,7 @@ function fielddataFunc(params, options, callback) { let { body, fields, ...querystring } = params; fields = parsePathParam(fields); - const path = ['/_cat/fielddata/', fields].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/fielddata', fields].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/health.js b/api/cat/health.js index c932cfe1c..90cd42e6e 100644 --- a/api/cat/health.js +++ b/api/cat/health.js @@ -25,12 +25,12 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Cat * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit used to display time values. - * @param {boolean} [params.ts=true] - If true, returns `HH:MM:SS` and Unix epoch timestamps. + * @param {boolean} [params.ts=true] - If `true`, returns `HH:MM:SS` and Unix epoch timestamps. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/cat/indices.js b/api/cat/indices.js index 582696846..6da93dde8 100644 --- a/api/cat/indices.js +++ b/api/cat/indices.js @@ -28,14 +28,14 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.bytes] - The unit used to display byte values. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - The type of index that wildcard patterns can match. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {string} [params.health] - The health status used to limit returned indexes. By default, the response includes indexes of any health status. * @param {boolean} [params.help=false] - Return help information. - * @param {boolean} [params.include_unloaded_segments=false] - If true, the response includes information from segments that are not loaded into memory. + * @param {boolean} [params.include_unloaded_segments=false] - If `true`, the response includes information from segments that are not loaded into memory. * @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 {boolean} [params.pri=false] - If true, the response only includes information from primary shards. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. + * @param {boolean} [params.pri=false] - If `true`, the response only includes information from primary shards. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit used to display time values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. @@ -52,7 +52,7 @@ function indicesFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cat/indices/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/indices', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/master.js b/api/cat/master.js index 8ae12c44b..b595a5f8b 100644 --- a/api/cat/master.js +++ b/api/cat/master.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * diff --git a/api/cat/nodeattrs.js b/api/cat/nodeattrs.js index 02eecd3c5..1b736abe8 100644 --- a/api/cat/nodeattrs.js +++ b/api/cat/nodeattrs.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * diff --git a/api/cat/nodes.js b/api/cat/nodes.js index 6b3bc9ae3..d0ecd8cd0 100644 --- a/api/cat/nodes.js +++ b/api/cat/nodes.js @@ -27,12 +27,12 @@ const { normalizeArguments } = require('../utils'); * @param {object} [params] * @param {string} [params.bytes] - The unit used to display byte values. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {string} [params.full_id=false] - If `true`, return the full node ID. If `false`, return the shortened node ID. * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] DEPRECATED - 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 {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit in which to display time values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. diff --git a/api/cat/pendingTasks.js b/api/cat/pendingTasks.js index 45cd214d1..9f8e23a01 100644 --- a/api/cat/pendingTasks.js +++ b/api/cat/pendingTasks.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit in which to display time values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. diff --git a/api/cat/pitSegments.js b/api/cat/pitSegments.js index f93aa0739..480821dda 100644 --- a/api/cat/pitSegments.js +++ b/api/cat/pitSegments.js @@ -26,7 +26,7 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.bytes] - The unit in which to display byte values. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. diff --git a/api/cat/plugins.js b/api/cat/plugins.js index 79ce2b2d6..9711d4043 100644 --- a/api/cat/plugins.js +++ b/api/cat/plugins.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * diff --git a/api/cat/recovery.js b/api/cat/recovery.js index 9e1a95e4b..79eb2b76e 100644 --- a/api/cat/recovery.js +++ b/api/cat/recovery.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.active_only=false] - If `true`, the response only includes ongoing shard recoveries. * @param {string} [params.bytes] - The unit used to display byte values. * @param {boolean} [params.detailed=false] - If `true`, the response includes detailed information about shard recoveries. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {string} [params.index] - A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. @@ -47,7 +47,7 @@ function recoveryFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cat/recovery/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/recovery', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/repositories.js b/api/cat/repositories.js index 395d9706a..6089d18fe 100644 --- a/api/cat/repositories.js +++ b/api/cat/repositories.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * diff --git a/api/cat/segmentReplication.js b/api/cat/segmentReplication.js index f79b403bf..c535f2d62 100644 --- a/api/cat/segmentReplication.js +++ b/api/cat/segmentReplication.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.completed_only=false] - If `true`, the response only includes latest completed segment replication events. * @param {boolean} [params.detailed=false] - If `true`, the response includes detailed information about segment replications. * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indexes that are open, closed or both. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indexes should be ignored when throttled. @@ -54,7 +54,7 @@ function segmentReplicationFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cat/segment_replication/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/segment_replication', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/segments.js b/api/cat/segments.js index 7f29e1b90..8bab19c43 100644 --- a/api/cat/segments.js +++ b/api/cat/segments.js @@ -27,10 +27,10 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {string} [params.bytes] - The unit used to display byte values. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * @param {string} [params.index] - A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. @@ -46,7 +46,7 @@ function segmentsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cat/segments/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/segments', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/shards.js b/api/cat/shards.js index 8bf64fd49..5744ad411 100644 --- a/api/cat/shards.js +++ b/api/cat/shards.js @@ -27,11 +27,11 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {string} [params.bytes] - The unit used to display byte values. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit in which to display time values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. @@ -48,7 +48,7 @@ function shardsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cat/shards/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/shards', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/snapshots.js b/api/cat/snapshots.js index c456c63ac..6343bf7c4 100644 --- a/api/cat/snapshots.js +++ b/api/cat/snapshots.js @@ -26,11 +26,11 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.ignore_unavailable=false] - If `true`, the response does not include information from unavailable snapshots. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {string} [params.time] - The unit in which to display time values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. @@ -47,7 +47,7 @@ function snapshotsFunc(params, options, callback) { let { body, repository, ...querystring } = params; repository = parsePathParam(repository); - const path = ['/_cat/snapshots/', repository].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/snapshots', repository].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/tasks.js b/api/cat/tasks.js index b5cdbe8a0..9de431421 100644 --- a/api/cat/tasks.js +++ b/api/cat/tasks.js @@ -27,7 +27,7 @@ const { normalizeArguments } = require('../utils'); * @param {object} [params] * @param {array} [params.actions] - The task action names, which are used to limit the response. * @param {boolean} [params.detailed=false] - If `true`, the response includes detailed information about shard recoveries. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {array} [params.nodes] - 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/cat/templates.js b/api/cat/templates.js index 032eab612..b215a9d19 100644 --- a/api/cat/templates.js +++ b/api/cat/templates.js @@ -26,11 +26,11 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. * @param {string} [params.name] - The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. @@ -46,7 +46,7 @@ function templatesFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_cat/templates/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/templates', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cat/threadPool.js b/api/cat/threadPool.js index 552c2a555..8ba6f1ddd 100644 --- a/api/cat/threadPool.js +++ b/api/cat/threadPool.js @@ -27,11 +27,11 @@ By default the active, queue and rejected statistics are returned for all thread * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {number} [params.size] - The multiplier in which to display values. * @param {boolean} [params.v=false] - Verbose mode. Display column headers. @@ -48,7 +48,7 @@ function threadPoolFunc(params, options, callback) { let { body, thread_pool_patterns, ...querystring } = params; thread_pool_patterns = parsePathParam(thread_pool_patterns); - const path = ['/_cat/thread_pool/', thread_pool_patterns].filter(c => c).join('').replace('//', '/'); + const path = ['/_cat/thread_pool', thread_pool_patterns].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cluster/allocationExplain.js b/api/cluster/allocationExplain.js index 2652de58e..6a9eff3fb 100644 --- a/api/cluster/allocationExplain.js +++ b/api/cluster/allocationExplain.js @@ -25,8 +25,8 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Cluster * * @param {object} [params] - * @param {boolean} [params.include_disk_info=false] - If true, returns information about disk usage and shard sizes. - * @param {boolean} [params.include_yes_decisions=false] - If true, returns YES decisions in explanation. + * @param {boolean} [params.include_disk_info=false] - If `true`, returns information about disk usage and shard sizes. + * @param {boolean} [params.include_yes_decisions=false] - If `true`, returns YES decisions in explanation. * @param {object} [params.body] - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/cluster/deleteComponentTemplate.js b/api/cluster/deleteComponentTemplate.js index 08add382f..0ae0dea33 100644 --- a/api/cluster/deleteComponentTemplate.js +++ b/api/cluster/deleteComponentTemplate.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - Name of the component template to delete. Wildcard (*) expressions are supported. * diff --git a/api/cluster/deleteVotingConfigExclusions.js b/api/cluster/deleteVotingConfigExclusions.js index 27480bd76..4d0fa3bcc 100644 --- a/api/cluster/deleteVotingConfigExclusions.js +++ b/api/cluster/deleteVotingConfigExclusions.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Cluster * * @param {object} [params] - * @param {boolean} [params.wait_for_removal=true] - Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any action. If set to false then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. + * @param {boolean} [params.wait_for_removal=true] - Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any action. If set to `false` then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/cluster/existsComponentTemplate.js b/api/cluster/existsComponentTemplate.js index e42445ccb..f5522892e 100644 --- a/api/cluster/existsComponentTemplate.js +++ b/api/cluster/existsComponentTemplate.js @@ -26,8 +26,8 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.local=false] - If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - Name of the component template to check existence of. Wildcard (*) expressions are supported. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/cluster/getComponentTemplate.js b/api/cluster/getComponentTemplate.js index f318d1f12..74690e4a6 100644 --- a/api/cluster/getComponentTemplate.js +++ b/api/cluster/getComponentTemplate.js @@ -26,8 +26,8 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Name of the component template to retrieve. Wildcard (`*`) expressions are supported. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} @@ -41,7 +41,7 @@ function getComponentTemplateFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_component_template/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_component_template', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cluster/getSettings.js b/api/cluster/getSettings.js index 0c23ccbf5..ef1916640 100644 --- a/api/cluster/getSettings.js +++ b/api/cluster/getSettings.js @@ -28,7 +28,7 @@ const { normalizeArguments } = require('../utils'); * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. * @param {boolean} [params.include_defaults=false] - If `true`, returns default cluster settings from the local node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/cluster/health.js b/api/cluster/health.js index e21260fec..0322e7b9b 100644 --- a/api/cluster/health.js +++ b/api/cluster/health.js @@ -29,8 +29,8 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indexes that are open, closed or both. * @param {string} [params.level] - Can be one of cluster, indexes or shards. Controls the details level of the health information returned. - * @param {boolean} [params.local=false] - If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. * @param {string} [params.wait_for_events] - Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. @@ -51,7 +51,7 @@ function healthFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_cluster/health', index].filter(c => c).join('/'); + const path = ['/_cluster/health', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cluster/pendingTasks.js b/api/cluster/pendingTasks.js index 2bd676206..526d92773 100644 --- a/api/cluster/pendingTasks.js +++ b/api/cluster/pendingTasks.js @@ -27,8 +27,8 @@ allocate or fail shard) which have not yet been executed. * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response diff --git a/api/cluster/putComponentTemplate.js b/api/cluster/putComponentTemplate.js index 9dff9362d..a610e7eae 100644 --- a/api/cluster/putComponentTemplate.js +++ b/api/cluster/putComponentTemplate.js @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.create=false] - If `true`, this request cannot replace or update existing component templates. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Operation timeout. * @param {string} params.name - Name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. OpenSearch Agent uses these templates to configure backing indexes for its data streams. If you use OpenSearch Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version. If you don't use OpenSearch Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API. * @param {object} params.body - The template definition diff --git a/api/cluster/putSettings.js b/api/cluster/putSettings.js index eb3aed375..bb4a28145 100644 --- a/api/cluster/putSettings.js +++ b/api/cluster/putSettings.js @@ -27,7 +27,7 @@ const { normalizeArguments, handleMissingParam } = require('../utils'); * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.flat_settings=false] - Return settings in flat format. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} [params.timeout] - Explicit operation timeout * @param {object} params.body - The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). * diff --git a/api/cluster/reroute.js b/api/cluster/reroute.js index 36b7e8212..76572359b 100644 --- a/api/cluster/reroute.js +++ b/api/cluster/reroute.js @@ -26,11 +26,11 @@ const { normalizeArguments } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.dry_run] - If true, then the request simulates the operation only and returns the resulting state. - * @param {boolean} [params.explain] - If true, then the response contains an explanation of why the commands can or cannot be executed. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.dry_run] - If `true`, then the request simulates the operation only and returns the resulting state. + * @param {boolean} [params.explain] - If `true`, then the response contains an explanation of why the commands can or cannot be executed. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.metric] - Limits the information returned to the specified metrics. - * @param {boolean} [params.retry_failed] - If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures. + * @param {boolean} [params.retry_failed] - If `true`, then retries allocation of shards that are blocked due to too many subsequent allocation failures. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {object} [params.body] - The definition of `commands` to perform (`move`, `cancel`, `allocate`) * diff --git a/api/cluster/state.js b/api/cluster/state.js index db1da87cd..ee8eb7619 100644 --- a/api/cluster/state.js +++ b/api/cluster/state.js @@ -49,7 +49,7 @@ function stateFunc(params, options, callback) { metric = parsePathParam(metric); index = parsePathParam(index); - const path = ['/_cluster/state/', metric, '/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_cluster/state', metric, index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/cluster/stats.js b/api/cluster/stats.js index c37bbaac4..be4480bac 100644 --- a/api/cluster/stats.js +++ b/api/cluster/stats.js @@ -44,7 +44,16 @@ function statsFunc(params, options, callback) { metric = parsePathParam(metric); node_id = parsePathParam(node_id); - const path = ['/_cluster/stats/', metric, '/', index_metric, '/nodes/', node_id].filter(c => c).join('').replace('//', '/'); + let path; + if (metric != null && index_metric != null && node_id != null) { + path = '/_cluster/stats/' + metric + '/' + index_metric + '/nodes/' + node_id; + } else if (metric != null && node_id != null) { + path = '/_cluster/stats/' + metric + '/nodes/' + node_id; + } else if (node_id != null) { + path = '/_cluster/stats/nodes/' + node_id; + } else { + path = '/_cluster/stats'; + } const method = 'GET'; body = body || ''; diff --git a/api/index.d.ts b/api/index.d.ts index ddf97692b..a5e82f4d8 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -320,6 +320,17 @@ import { Sql_Explain_Request, Sql_Explain_Response, Sql_Explain_ResponseBody } f import { Sql_Close_Request, Sql_Close_Response, Sql_Close_ResponseBody } from './sql/close'; import { Sql_GetStats_Request, Sql_GetStats_Response, Sql_GetStats_ResponseBody } from './sql/getStats'; import { Sql_PostStats_Request, Sql_PostStats_Response, Sql_PostStats_ResponseBody } from './sql/postStats'; +import { Replication_DeleteReplicationRule_Request, Replication_DeleteReplicationRule_Response, Replication_DeleteReplicationRule_ResponseBody } from './replication/deleteReplicationRule'; +import { Replication_CreateReplicationRule_Request, Replication_CreateReplicationRule_Response, Replication_CreateReplicationRule_ResponseBody } from './replication/createReplicationRule'; +import { Replication_Pause_Request, Replication_Pause_RequestBody, Replication_Pause_Response, Replication_Pause_ResponseBody } from './replication/pause'; +import { Replication_Resume_Request, Replication_Resume_RequestBody, Replication_Resume_Response, Replication_Resume_ResponseBody } from './replication/resume'; +import { Replication_Start_Request, Replication_Start_Response, Replication_Start_ResponseBody } from './replication/start'; +import { Replication_Status_Request, Replication_Status_Response, Replication_Status_ResponseBody } from './replication/status'; +import { Replication_Stop_Request, Replication_Stop_RequestBody, Replication_Stop_Response, Replication_Stop_ResponseBody } from './replication/stop'; +import { Replication_UpdateSettings_Request, Replication_UpdateSettings_Response, Replication_UpdateSettings_ResponseBody } from './replication/updateSettings'; +import { Replication_AutofollowStats_Request, Replication_AutofollowStats_Response, Replication_AutofollowStats_ResponseBody } from './replication/autofollowStats'; +import { Replication_FollowerStats_Request, Replication_FollowerStats_Response, Replication_FollowerStats_ResponseBody } from './replication/followerStats'; +import { Replication_LeaderStats_Request, Replication_LeaderStats_Response, Replication_LeaderStats_ResponseBody } from './replication/leaderStats'; import { Rollups_Delete_Request, Rollups_Delete_Response, Rollups_Delete_ResponseBody } from './rollups/delete'; import { Rollups_Get_Request, Rollups_Get_Response, Rollups_Get_ResponseBody } from './rollups/get'; import { Rollups_Put_Request, Rollups_Put_Response, Rollups_Put_ResponseBody } from './rollups/put'; @@ -664,6 +675,17 @@ export { Sql_Close_Request, Sql_Close_Response, Sql_Close_ResponseBody, Sql_GetStats_Request, Sql_GetStats_Response, Sql_GetStats_ResponseBody, Sql_PostStats_Request, Sql_PostStats_Response, Sql_PostStats_ResponseBody, + Replication_DeleteReplicationRule_Request, Replication_DeleteReplicationRule_Response, Replication_DeleteReplicationRule_ResponseBody, + Replication_CreateReplicationRule_Request, Replication_CreateReplicationRule_Response, Replication_CreateReplicationRule_ResponseBody, + Replication_Pause_Request, Replication_Pause_RequestBody, Replication_Pause_Response, Replication_Pause_ResponseBody, + Replication_Resume_Request, Replication_Resume_RequestBody, Replication_Resume_Response, Replication_Resume_ResponseBody, + Replication_Start_Request, Replication_Start_Response, Replication_Start_ResponseBody, + Replication_Status_Request, Replication_Status_Response, Replication_Status_ResponseBody, + Replication_Stop_Request, Replication_Stop_RequestBody, Replication_Stop_Response, Replication_Stop_ResponseBody, + Replication_UpdateSettings_Request, Replication_UpdateSettings_Response, Replication_UpdateSettings_ResponseBody, + Replication_AutofollowStats_Request, Replication_AutofollowStats_Response, Replication_AutofollowStats_ResponseBody, + Replication_FollowerStats_Request, Replication_FollowerStats_Response, Replication_FollowerStats_ResponseBody, + Replication_LeaderStats_Request, Replication_LeaderStats_Response, Replication_LeaderStats_ResponseBody, Rollups_Delete_Request, Rollups_Delete_Response, Rollups_Delete_ResponseBody, Rollups_Get_Request, Rollups_Get_Response, Rollups_Get_ResponseBody, Rollups_Put_Request, Rollups_Put_Response, Rollups_Put_ResponseBody, diff --git a/api/indices/analyze.js b/api/indices/analyze.js index df6d959be..fd6a6f7c5 100644 --- a/api/indices/analyze.js +++ b/api/indices/analyze.js @@ -39,7 +39,7 @@ function analyzeFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_analyze'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_analyze'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/indices/clearCache.js b/api/indices/clearCache.js index 60c9eab55..624bec3f0 100644 --- a/api/indices/clearCache.js +++ b/api/indices/clearCache.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. * @param {boolean} [params.fielddata] - If `true`, clears the fields cache. Use the `fields` parameter to clear the cache of specific fields only. * @param {string} [params.fields] - Comma-separated list of field names used to limit the `fielddata` parameter. - * @param {boolean} [params.file=false] - If true, clears the unused entries from the file cache on nodes with the Search role. + * @param {boolean} [params.file=false] - If `true`, clears the unused entries from the file cache on nodes with the Search role. * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. * @param {boolean} [params.query] - If `true`, clears the query cache. @@ -46,7 +46,7 @@ function clearCacheFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_cache/clear'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_cache/clear'].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/indices/clone.js b/api/indices/clone.js index d0bbf5931..b60a40fcf 100644 --- a/api/indices/clone.js +++ b/api/indices/clone.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.task_execution_timeout] - Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/api/indices/close.js b/api/indices/close.js index 23dbc00ac..f2f9a17d2 100644 --- a/api/indices/close.js +++ b/api/indices/close.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). * @param {string} params.index - Comma-separated list or wildcard expression of index names used to limit the request. diff --git a/api/indices/create.js b/api/indices/create.js index 5bb73fbe0..0b31096cb 100644 --- a/api/indices/create.js +++ b/api/indices/create.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). * @param {string} params.index - Name of the index you wish to create. diff --git a/api/indices/dataStreamsStats.js b/api/indices/dataStreamsStats.js index 6c18001c8..a5a1dec15 100644 --- a/api/indices/dataStreamsStats.js +++ b/api/indices/dataStreamsStats.js @@ -38,7 +38,7 @@ function dataStreamsStatsFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_data_stream/', name, '/_stats'].filter(c => c).join('').replace('//', '/'); + const path = ['/_data_stream', name, '_stats'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/delete.js b/api/indices/delete.js index c455e0df8..e8e8c6ae7 100644 --- a/api/indices/delete.js +++ b/api/indices/delete.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. * @param {boolean} [params.ignore_unavailable=false] - If `false`, the request returns an error if it targets a missing or closed index. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.index - Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`. * diff --git a/api/indices/deleteAlias.js b/api/indices/deleteAlias.js index 347c87d83..1c2fb9a68 100644 --- a/api/indices/deleteAlias.js +++ b/api/indices/deleteAlias.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.index - Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). * @param {string} params.name - Comma-separated list of aliases to remove. Supports wildcards (`*`). To remove all aliases, use `*` or `_all`. diff --git a/api/indices/deleteIndexTemplate.js b/api/indices/deleteIndexTemplate.js index 79907074e..b9b8db345 100644 --- a/api/indices/deleteIndexTemplate.js +++ b/api/indices/deleteIndexTemplate.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - Name of the index template to delete. Wildcard (*) expressions are supported. * diff --git a/api/indices/deleteTemplate.js b/api/indices/deleteTemplate.js index 3869ca80e..0812fef46 100644 --- a/api/indices/deleteTemplate.js +++ b/api/indices/deleteTemplate.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - The name of the legacy index template to delete. Wildcard (`*`) expressions are supported. * diff --git a/api/indices/existsAlias.js b/api/indices/existsAlias.js index 82551f1d5..eec6e1130 100644 --- a/api/indices/existsAlias.js +++ b/api/indices/existsAlias.js @@ -45,7 +45,7 @@ function existsAliasFunc(params, options, callback) { name = parsePathParam(name); index = parsePathParam(index); - const path = ['/', index, '/_alias/', name].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_alias', name].filter(c => c != null).join('/'); const method = 'HEAD'; body = body || ''; diff --git a/api/indices/existsIndexTemplate.js b/api/indices/existsIndexTemplate.js index a1fc5b568..7f3eaface 100644 --- a/api/indices/existsIndexTemplate.js +++ b/api/indices/existsIndexTemplate.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.flat_settings=false] - Return settings in flat format. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - Name of the index template to check existence of. Wildcard (*) expressions are supported. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/indices/existsTemplate.js b/api/indices/existsTemplate.js index 32ac90749..c8a543ae4 100644 --- a/api/indices/existsTemplate.js +++ b/api/indices/existsTemplate.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.flat_settings=false] - Return settings in flat format. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} params.name - The comma separated names of the index templates * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/indices/flush.js b/api/indices/flush.js index a3af89591..1968d0e62 100644 --- a/api/indices/flush.js +++ b/api/indices/flush.js @@ -43,7 +43,7 @@ function flushFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_flush'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_flush'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/indices/forcemerge.js b/api/indices/forcemerge.js index 085768b98..7a6429a2b 100644 --- a/api/indices/forcemerge.js +++ b/api/indices/forcemerge.js @@ -46,7 +46,7 @@ function forcemergeFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_forcemerge'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_forcemerge'].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/indices/get.js b/api/indices/get.js index 93ff4a4c7..b42aa6c11 100644 --- a/api/indices/get.js +++ b/api/indices/get.js @@ -25,14 +25,14 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Indices * * @param {object} params - * @param {boolean} [params.allow_no_indices=false] - If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. + * @param {boolean} [params.allow_no_indices=false] - If `false`, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. - * @param {boolean} [params.flat_settings=false] - If true, returns settings in flat format. - * @param {boolean} [params.ignore_unavailable=false] - If false, requests that target a missing index return an error. - * @param {boolean} [params.include_defaults=false] - If true, return all default settings in the response. - * @param {boolean} [params.local=false] - If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. + * @param {boolean} [params.ignore_unavailable=false] - If `false`, requests that target a missing index return an error. + * @param {boolean} [params.include_defaults=false] - If `true`, return all default settings in the response. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.index - Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/indices/getAlias.js b/api/indices/getAlias.js index 9244d55ee..6c0071191 100644 --- a/api/indices/getAlias.js +++ b/api/indices/getAlias.js @@ -44,7 +44,7 @@ function getAliasFunc(params, options, callback) { name = parsePathParam(name); index = parsePathParam(index); - const path = ['/', index, '/_alias/', name].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_alias', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getDataStream.js b/api/indices/getDataStream.js index 06a7350cf..24200b9e6 100644 --- a/api/indices/getDataStream.js +++ b/api/indices/getDataStream.js @@ -38,7 +38,7 @@ function getDataStreamFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_data_stream/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_data_stream', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getFieldMapping.js b/api/indices/getFieldMapping.js index 8fabf98e6..f31424090 100644 --- a/api/indices/getFieldMapping.js +++ b/api/indices/getFieldMapping.js @@ -46,7 +46,7 @@ function getFieldMappingFunc(params, options, callback) { fields = parsePathParam(fields); index = parsePathParam(index); - const path = ['/', index, '/_mapping/field/', fields].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_mapping/field', fields].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getIndexTemplate.js b/api/indices/getIndexTemplate.js index 6847245e9..065785541 100644 --- a/api/indices/getIndexTemplate.js +++ b/api/indices/getIndexTemplate.js @@ -26,9 +26,9 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.flat_settings=false] - If true, returns settings in flat format. - * @param {boolean} [params.local=false] - If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Name of the index template to retrieve. Wildcard (*) expressions are supported. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} @@ -42,7 +42,7 @@ function getIndexTemplateFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_index_template/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_index_template', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getMapping.js b/api/indices/getMapping.js index c48e1a617..e5bbb106a 100644 --- a/api/indices/getMapping.js +++ b/api/indices/getMapping.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response @@ -44,7 +44,7 @@ function getMappingFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_mapping'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_mapping'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getSettings.js b/api/indices/getSettings.js index 8f14780a3..b1333b4b0 100644 --- a/api/indices/getSettings.js +++ b/api/indices/getSettings.js @@ -31,8 +31,8 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. * @param {boolean} [params.include_defaults=false] - If `true`, return all default settings in the response. - * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the master node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Comma-separated list or wildcard expression of settings to retrieve. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. * @@ -48,7 +48,7 @@ function getSettingsFunc(params, options, callback) { name = parsePathParam(name); index = parsePathParam(index); - const path = ['/', index, '/_settings/', name].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_settings', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getTemplate.js b/api/indices/getTemplate.js index f31f55820..752e9d8c2 100644 --- a/api/indices/getTemplate.js +++ b/api/indices/getTemplate.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. * @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Comma-separated list of index template names used to limit the request. Wildcard (`*`) expressions are supported. To return all index templates, omit this parameter or use a value of `_all` or `*`. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} @@ -42,7 +42,7 @@ function getTemplateFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_template/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_template', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/getUpgrade.js b/api/indices/getUpgrade.js index cb6873e0e..a646b3e05 100644 --- a/api/indices/getUpgrade.js +++ b/api/indices/getUpgrade.js @@ -41,7 +41,7 @@ function getUpgradeFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_upgrade'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_upgrade'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/open.js b/api/indices/open.js index 07ed538fd..38589a2f2 100644 --- a/api/indices/open.js +++ b/api/indices/open.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.task_execution_timeout] - Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/api/indices/putAlias.js b/api/indices/putAlias.js index dc255d1f0..92529ac6e 100644 --- a/api/indices/putAlias.js +++ b/api/indices/putAlias.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Alias to update. If the alias doesn't exist, the request creates it. Index alias names support date math. * @param {string} [params.index] - Comma-separated list of data streams or indexes to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indexes return an error. @@ -44,7 +44,7 @@ function putAliasFunc(params, options, callback) { name = parsePathParam(name); index = parsePathParam(index); - const path = ['/', index, '/_alias/', name].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_alias', name].filter(c => c != null).join('/'); const method = name == null ? 'POST' : 'PUT'; body = body || ''; diff --git a/api/indices/putIndexTemplate.js b/api/indices/putIndexTemplate.js index 14b6113e7..3645bf7a0 100644 --- a/api/indices/putIndexTemplate.js +++ b/api/indices/putIndexTemplate.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cause=false] - User defined reason for creating/updating the index template. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.create=false] - If `true`, this request cannot replace or update existing index templates. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to master node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {string} params.name - Index or template name * @param {object} params.body - The template definition * diff --git a/api/indices/putMapping.js b/api/indices/putMapping.js index 9a4e82238..5b814c86f 100644 --- a/api/indices/putMapping.js +++ b/api/indices/putMapping.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {boolean} [params.write_index_only=false] - If `true`, the mappings are applied only to the current write index for the target. * @param {string} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indexes. diff --git a/api/indices/putSettings.js b/api/indices/putSettings.js index a6263f3aa..93168b73d 100644 --- a/api/indices/putSettings.js +++ b/api/indices/putSettings.js @@ -30,7 +30,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indexes should be ignored when unavailable (missing or closed). - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {boolean} [params.preserve_existing=false] - If `true`, existing index settings remain unchanged. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. @@ -48,7 +48,7 @@ function putSettingsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_settings'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_settings'].filter(c => c != null).join('/'); const method = 'PUT'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/indices/putTemplate.js b/api/indices/putTemplate.js index fc7c252b7..021c0f33d 100644 --- a/api/indices/putTemplate.js +++ b/api/indices/putTemplate.js @@ -26,8 +26,8 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.create=false] - If true, this request cannot replace or update existing index templates. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.create=false] - If `true`, this request cannot replace or update existing index templates. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {number} [params.order] - Order in which OpenSearch applies this template if index matches multiple templates. Templates with lower 'order' values are merged first. Templates with higher 'order' values are merged later, overriding templates with lower values. * @param {string} params.name - The name of the template * @param {object} params.body - The template definition diff --git a/api/indices/recovery.js b/api/indices/recovery.js index 7e1285abc..2b6817030 100644 --- a/api/indices/recovery.js +++ b/api/indices/recovery.js @@ -40,7 +40,7 @@ function recoveryFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_recovery'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_recovery'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/refresh.js b/api/indices/refresh.js index f54109c9c..0cc6dc8bf 100644 --- a/api/indices/refresh.js +++ b/api/indices/refresh.js @@ -41,7 +41,7 @@ function refreshFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_refresh'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_refresh'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/indices/rollover.js b/api/indices/rollover.js index abc7a87ad..be4603d21 100644 --- a/api/indices/rollover.js +++ b/api/indices/rollover.js @@ -28,7 +28,7 @@ is considered to be too large or too old. * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.dry_run=false] - If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). * @param {string} params.alias - Name of the data stream or index alias to roll over. @@ -48,7 +48,7 @@ function rolloverFunc(params, options, callback) { alias = parsePathParam(alias); new_index = parsePathParam(new_index); - const path = ['/', alias, '/_rollover/', new_index].filter(c => c).join('').replace('//', '/'); + const path = ['', alias, '_rollover', new_index].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/indices/segments.js b/api/indices/segments.js index f448610e2..466ed7823 100644 --- a/api/indices/segments.js +++ b/api/indices/segments.js @@ -42,7 +42,7 @@ function segmentsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_segments'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_segments'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/shardStores.js b/api/indices/shardStores.js index c441b1d5b..7b233b957 100644 --- a/api/indices/shardStores.js +++ b/api/indices/shardStores.js @@ -25,9 +25,9 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Indices * * @param {object} [params] - * @param {boolean} [params.allow_no_indices] - If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. + * @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. - * @param {boolean} [params.ignore_unavailable] - If true, missing or closed indexes are not included in the response. + * @param {boolean} [params.ignore_unavailable] - If `true`, missing or closed indexes are not included in the response. * @param {string} [params.status] - List of shard health statuses used to limit the request. * @param {string} [params.index] - List of data streams, indexes, and aliases used to limit the request. * @@ -42,7 +42,7 @@ function shardStoresFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_shard_stores'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_shard_stores'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/shrink.js b/api/indices/shrink.js index 4c6081410..f1b0c1938 100644 --- a/api/indices/shrink.js +++ b/api/indices/shrink.js @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.copy_settings=false] - whether or not to copy settings from the source index. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.task_execution_timeout] - Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/api/indices/simulateIndexTemplate.js b/api/indices/simulateIndexTemplate.js index 9e10547cf..6433f5e9f 100644 --- a/api/indices/simulateIndexTemplate.js +++ b/api/indices/simulateIndexTemplate.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {string} [params.cause=false] - User defined reason for dry-run creating the new template for simulation purposes. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.create=false] - If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - Index or template name to simulate * @param {object} [params.body] - New index template definition, which will be included in the simulation, as if it already exists in the system * diff --git a/api/indices/simulateTemplate.js b/api/indices/simulateTemplate.js index c85869a68..f4009ff93 100644 --- a/api/indices/simulateTemplate.js +++ b/api/indices/simulateTemplate.js @@ -27,8 +27,8 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {string} [params.cause=false] - User defined reason for dry-run creating the new template for simulation purposes. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.create=false] - If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.create=false] - If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.name] - Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. * @param {object} [params.body] - New index template definition to be simulated, if no index template name is specified. * @@ -43,7 +43,7 @@ function simulateTemplateFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_index_template/_simulate/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_index_template/_simulate', name].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/indices/split.js b/api/indices/split.js index 82d86d373..3944c92c1 100644 --- a/api/indices/split.js +++ b/api/indices/split.js @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.copy_settings=false] - whether or not to copy settings from the source index. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.task_execution_timeout] - Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). diff --git a/api/indices/stats.js b/api/indices/stats.js index cc3ed7d0d..aa93e9b80 100644 --- a/api/indices/stats.js +++ b/api/indices/stats.js @@ -29,10 +29,10 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.expand_wildcards] - Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. * @param {string} [params.fielddata_fields] - Comma-separated list or wildcard expressions of fields to include in fielddata statistics. * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. - * @param {boolean} [params.forbid_closed_indices=true] - If true, statistics are not collected from closed indexes. + * @param {boolean} [params.forbid_closed_indices=true] - If `true`, statistics are not collected from closed indexes. * @param {string} [params.groups] - Comma-separated list of search groups to include in the search statistics. - * @param {boolean} [params.include_segment_file_sizes=false] - If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). - * @param {boolean} [params.include_unloaded_segments=false] - If true, the response includes information from segments that are not loaded into memory. + * @param {boolean} [params.include_segment_file_sizes=false] - If `true`, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + * @param {boolean} [params.include_unloaded_segments=false] - If `true`, the response includes information from segments that are not loaded into memory. * @param {string} [params.level] - Indicates whether statistics are aggregated at the cluster, index, or shard level. * @param {string} [params.metric] - Limit the information returned the specific metrics. * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes @@ -49,7 +49,7 @@ function statsFunc(params, options, callback) { metric = parsePathParam(metric); index = parsePathParam(index); - const path = ['/', index, '/_stats/', metric].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_stats', metric].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/indices/updateAliases.js b/api/indices/updateAliases.js index 71c5a026c..83d4a07a1 100644 --- a/api/indices/updateAliases.js +++ b/api/indices/updateAliases.js @@ -26,7 +26,7 @@ const { normalizeArguments, handleMissingParam } = require('../utils'); * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {object} params.body - The definition of `actions` to perform * diff --git a/api/indices/upgrade.js b/api/indices/upgrade.js index 6080974d9..8382cbd8b 100644 --- a/api/indices/upgrade.js +++ b/api/indices/upgrade.js @@ -28,7 +28,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indexes that are open, closed or both. * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indexes should be ignored when unavailable (missing or closed). - * @param {boolean} [params.only_ancient_segments] - If true, only ancient (an older Lucene major release) segments will be upgraded. + * @param {boolean} [params.only_ancient_segments] - If `true`, only ancient (an older Lucene major release) segments will be upgraded. * @param {boolean} [params.wait_for_completion=false] - Should this request wait until the operation has completed before returning. * @param {array} [params.index] - Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. * @@ -43,7 +43,7 @@ function upgradeFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_upgrade'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_upgrade'].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/indices/validateQuery.js b/api/indices/validateQuery.js index 8861274e9..46406a24d 100644 --- a/api/indices/validateQuery.js +++ b/api/indices/validateQuery.js @@ -51,7 +51,7 @@ function validateQueryFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/', index, '/_validate/query'].filter(c => c).join('').replace('//', '/'); + const path = ['', index, '_validate/query'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/ingest/deletePipeline.js b/api/ingest/deletePipeline.js index 28abc345c..c9bc59c8c 100644 --- a/api/ingest/deletePipeline.js +++ b/api/ingest/deletePipeline.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.id - Pipeline ID or wildcard expression of pipeline IDs used to limit the request. To delete all ingest pipelines in a cluster, use a value of `*`. * diff --git a/api/ingest/getPipeline.js b/api/ingest/getPipeline.js index 1a1298286..9bbd6a294 100644 --- a/api/ingest/getPipeline.js +++ b/api/ingest/getPipeline.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.id] - Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions are supported. To get all ingest pipelines, omit this parameter or use `*`. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} @@ -40,7 +40,7 @@ function getPipelineFunc(params, options, callback) { let { body, id, ...querystring } = params; id = parsePathParam(id); - const path = ['/_ingest/pipeline/', id].filter(c => c).join('').replace('//', '/'); + const path = ['/_ingest/pipeline', id].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/ingest/putPipeline.js b/api/ingest/putPipeline.js index ab20d94e1..e40b171a6 100644 --- a/api/ingest/putPipeline.js +++ b/api/ingest/putPipeline.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.id - ID of the ingest pipeline to create or update. * @param {object} params.body - The ingest definition diff --git a/api/ingest/simulate.js b/api/ingest/simulate.js index b6de086e2..4964d8d0f 100644 --- a/api/ingest/simulate.js +++ b/api/ingest/simulate.js @@ -41,7 +41,7 @@ function simulateFunc(params, options, callback) { let { body, id, ...querystring } = params; id = parsePathParam(id); - const path = ['/_ingest/pipeline/', id, '/_simulate'].filter(c => c).join('').replace('//', '/'); + const path = ['/_ingest/pipeline', id, '_simulate'].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/ism/addPolicy.js b/api/ism/addPolicy.js index e42f401b2..d7aa0f6cd 100644 --- a/api/ism/addPolicy.js +++ b/api/ism/addPolicy.js @@ -39,7 +39,7 @@ function addPolicyFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_plugins/_ism/add/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_ism/add', index].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/ism/changePolicy.js b/api/ism/changePolicy.js index c0224aa4f..e3c962067 100644 --- a/api/ism/changePolicy.js +++ b/api/ism/changePolicy.js @@ -39,7 +39,7 @@ function changePolicyFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_plugins/_ism/change_policy/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_ism/change_policy', index].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/ism/explainPolicy.js b/api/ism/explainPolicy.js index 7ad25874e..0e124fcc8 100644 --- a/api/ism/explainPolicy.js +++ b/api/ism/explainPolicy.js @@ -39,7 +39,7 @@ function explainPolicyFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_plugins/_ism/explain/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_ism/explain', index].filter(c => c != null).join('/'); const method = body ? 'POST' : 'GET'; body = body || ''; diff --git a/api/ism/removePolicy.js b/api/ism/removePolicy.js index 87390b9cf..f49658878 100644 --- a/api/ism/removePolicy.js +++ b/api/ism/removePolicy.js @@ -38,7 +38,7 @@ function removePolicyFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_plugins/_ism/remove/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_ism/remove', index].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/ism/retryIndex.js b/api/ism/retryIndex.js index bdd6eade3..c7c8c72bb 100644 --- a/api/ism/retryIndex.js +++ b/api/ism/retryIndex.js @@ -39,7 +39,7 @@ function retryIndexFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_plugins/_ism/retry/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_ism/retry', index].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/knn/searchModels.js b/api/knn/searchModels.js index a3bba5d90..8a98a3f20 100644 --- a/api/knn/searchModels.js +++ b/api/knn/searchModels.js @@ -25,9 +25,9 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Knn * * @param {object} [params] - * @param {array} [params._source] - True or false to return the _source field or not, or a list of fields to return. - * @param {array} [params._source_excludes] - List of fields to exclude from the returned _source field. - * @param {array} [params._source_includes] - List of fields to extract and return from the _source field. + * @param {array} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. + * @param {array} [params._source_excludes] - List of fields to exclude from the returned `_source` field. + * @param {array} [params._source_includes] - List of fields to extract and return from the `_source` field. * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). * @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. @@ -44,7 +44,7 @@ const { normalizeArguments } = require('../utils'); * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indexes 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 {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 {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, that is 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. diff --git a/api/knn/stats.js b/api/knn/stats.js index b80f15da3..1c47936a2 100644 --- a/api/knn/stats.js +++ b/api/knn/stats.js @@ -41,7 +41,7 @@ function statsFunc(params, options, callback) { node_id = parsePathParam(node_id); stat = parsePathParam(stat); - const path = ['/_plugins/_knn/', node_id, '/stats/', stat].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_knn', node_id, 'stats', stat].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/knn/trainModel.js b/api/knn/trainModel.js index 9e6709e44..6ab3df677 100644 --- a/api/knn/trainModel.js +++ b/api/knn/trainModel.js @@ -41,7 +41,7 @@ function trainModelFunc(params, options, callback) { let { body, model_id, ...querystring } = params; model_id = parsePathParam(model_id); - const path = ['/_plugins/_knn/models/', model_id, '/_train'].filter(c => c).join('').replace('//', '/'); + const path = ['/_plugins/_knn/models', model_id, '_train'].filter(c => c != null).join('/'); const method = 'POST'; return this.transport.request({ method, path, querystring, body }, options, callback); diff --git a/api/list/indices.js b/api/list/indices.js index 19fa6ffae..7e4671c62 100644 --- a/api/list/indices.js +++ b/api/list/indices.js @@ -32,11 +32,11 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {array} [params.h] - Comma-separated list of column names to display. * @param {string} [params.health] - The health status used to limit returned indexes. By default, the response includes indexes of any health status. * @param {boolean} [params.help=false] - Return help information. - * @param {boolean} [params.include_unloaded_segments=false] - If true, the response includes information from segments that are not loaded into memory. + * @param {boolean} [params.include_unloaded_segments=false] - If `true`, the response includes information from segments that are not loaded into memory. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster manager node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {null | string} [params.next_token] - Token to retrieve next page of indexes. - * @param {boolean} [params.pri=false] - If true, the response only includes information from primary shards. + * @param {boolean} [params.pri=false] - If `true`, the response only includes information from primary shards. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {number} [params.size] - Maximum number of indexes to be displayed in a page. * @param {string} [params.sort] - Defines order in which indexes will be displayed. Accepted values are `asc` and `desc`. If `desc`, most recently created indexes would be displayed first. @@ -55,7 +55,7 @@ function indicesFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_list/indices/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_list/indices', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/list/shards.js b/api/list/shards.js index ba43382d6..635504c3c 100644 --- a/api/list/shards.js +++ b/api/list/shards.js @@ -31,7 +31,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {array} [params.h] - Comma-separated list of column names to display. * @param {boolean} [params.help=false] - Return help information. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster manager node. + * @param {string} [params.master_timeout] DEPRECATED - Operation timeout for connection to cluster-manager node. * @param {null | string} [params.next_token] - Token to retrieve next page of shards. * @param {array} [params.s] - Comma-separated list of column names or column aliases to sort by. * @param {number} [params.size] - Maximum number of shards to be displayed in a page. @@ -51,7 +51,7 @@ function shardsFunc(params, options, callback) { let { body, index, ...querystring } = params; index = parsePathParam(index); - const path = ['/_list/shards/', index].filter(c => c).join('').replace('//', '/'); + const path = ['/_list/shards', index].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/nodes/hotThreads.js b/api/nodes/hotThreads.js index da8f0ff5f..5aa38e853 100644 --- a/api/nodes/hotThreads.js +++ b/api/nodes/hotThreads.js @@ -44,7 +44,7 @@ function hotThreadsFunc(params, options, callback) { let { body, node_id, ...querystring } = params; node_id = parsePathParam(node_id); - const path = ['/_nodes/', node_id, '/hot_threads'].filter(c => c).join('').replace('//', '/'); + const path = ['/_nodes', node_id, 'hot_threads'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/nodes/info.js b/api/nodes/info.js index 8097990f1..852d6282f 100644 --- a/api/nodes/info.js +++ b/api/nodes/info.js @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @memberOf API-Nodes * * @param {object} [params] - * @param {boolean} [params.flat_settings=false] - If true, returns settings in flat format. + * @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {array} [params.metric] - Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. * @param {string} [params.node_id] - Comma-separated list of node IDs or names used to limit returned information. @@ -42,7 +42,7 @@ function infoFunc(params, options, callback) { metric = parsePathParam(metric); node_id = parsePathParam(node_id); - const path = ['/_nodes/', node_id, '/', metric].filter(c => c).join('').replace('//', '/'); + const path = ['/_nodes', node_id, metric].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/nodes/reloadSecureSettings.js b/api/nodes/reloadSecureSettings.js index 50b61ec00..58f8c7743 100644 --- a/api/nodes/reloadSecureSettings.js +++ b/api/nodes/reloadSecureSettings.js @@ -40,7 +40,7 @@ function reloadSecureSettingsFunc(params, options, callback) { let { body, node_id, ...querystring } = params; node_id = parsePathParam(node_id); - const path = ['/_nodes/', node_id, '/reload_secure_settings'].filter(c => c).join('').replace('//', '/'); + const path = ['/_nodes', node_id, 'reload_secure_settings'].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/nodes/stats.js b/api/nodes/stats.js index 9e08d7834..00463a13b 100644 --- a/api/nodes/stats.js +++ b/api/nodes/stats.js @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {string} [params.fielddata_fields] - Comma-separated list or wildcard expressions of fields to include in fielddata statistics. * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. * @param {array} [params.groups] - Comma-separated list of search groups to include in the search statistics. - * @param {boolean} [params.include_segment_file_sizes=false] - If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + * @param {boolean} [params.include_segment_file_sizes=false] - If `true`, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). * @param {string} [params.level] - Indicates whether statistics are aggregated at the cluster, index, or shard level. * @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. * @param {array} [params.types] - A comma-separated list of document types for the indexing index metric. @@ -50,7 +50,7 @@ function statsFunc(params, options, callback) { metric = parsePathParam(metric); index_metric = parsePathParam(index_metric); - const path = ['/_nodes/', node_id, '/stats/', metric, '/', index_metric].filter(c => c).join('').replace('//', '/'); + const path = ['/_nodes', node_id, 'stats', metric, index_metric].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/nodes/usage.js b/api/nodes/usage.js index 034af8acf..a353a27b1 100644 --- a/api/nodes/usage.js +++ b/api/nodes/usage.js @@ -41,7 +41,7 @@ function usageFunc(params, options, callback) { node_id = parsePathParam(node_id); metric = parsePathParam(metric); - const path = ['/_nodes/', node_id, '/usage/', metric].filter(c => c).join('').replace('//', '/'); + const path = ['/_nodes', node_id, 'usage', metric].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/ppl/explain.js b/api/ppl/explain.js index 6989ecce6..20c047da7 100644 --- a/api/ppl/explain.js +++ b/api/ppl/explain.js @@ -25,7 +25,7 @@ const { normalizeArguments, handleMissingParam } = require('../utils'); * @memberOf API-Ppl * * @param {object} params - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results. * @param {object} params.body * diff --git a/api/ppl/getStats.js b/api/ppl/getStats.js index 5e2cab34b..b2da5272c 100644 --- a/api/ppl/getStats.js +++ b/api/ppl/getStats.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Ppl * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/ppl/postStats.js b/api/ppl/postStats.js index 2d769d3c2..317570685 100644 --- a/api/ppl/postStats.js +++ b/api/ppl/postStats.js @@ -25,7 +25,7 @@ const { normalizeArguments, handleMissingParam } = require('../utils'); * @memberOf API-Ppl * * @param {object} params - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results. * @param {object} params.body * diff --git a/api/ppl/query.js b/api/ppl/query.js index 749e90e2c..943554cfc 100644 --- a/api/ppl/query.js +++ b/api/ppl/query.js @@ -25,7 +25,7 @@ const { normalizeArguments, handleMissingParam } = require('../utils'); * @memberOf API-Ppl * * @param {object} params - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results. * @param {object} params.body * diff --git a/api/replication/_api.js b/api/replication/_api.js new file mode 100644 index 000000000..df8074cf4 --- /dev/null +++ b/api/replication/_api.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'; + +/** @namespace API-Replication */ + +function ReplicationApi(bindObj) { + this.autofollowStats = require('./autofollowStats').bind(bindObj); + this.createReplicationRule = require('./createReplicationRule').bind(bindObj); + this.deleteReplicationRule = require('./deleteReplicationRule').bind(bindObj); + this.followerStats = require('./followerStats').bind(bindObj); + this.leaderStats = require('./leaderStats').bind(bindObj); + this.pause = require('./pause').bind(bindObj); + this.resume = require('./resume').bind(bindObj); + this.start = require('./start').bind(bindObj); + this.status = require('./status').bind(bindObj); + this.stop = require('./stop').bind(bindObj); + this.updateSettings = require('./updateSettings').bind(bindObj); + + // Deprecated: Use autofollowStats instead. + this.autofollow_stats = require('./autofollowStats').bind(bindObj); + // Deprecated: Use createReplicationRule instead. + this.create_replication_rule = require('./createReplicationRule').bind(bindObj); + // Deprecated: Use deleteReplicationRule instead. + this.delete_replication_rule = require('./deleteReplicationRule').bind(bindObj); + // Deprecated: Use followerStats instead. + this.follower_stats = require('./followerStats').bind(bindObj); + // Deprecated: Use leaderStats instead. + this.leader_stats = require('./leaderStats').bind(bindObj); + // Deprecated: Use updateSettings instead. + this.update_settings = require('./updateSettings').bind(bindObj); +} + +module.exports = ReplicationApi; diff --git a/api/replication/autofollowStats.d.ts b/api/replication/autofollowStats.d.ts new file mode 100644 index 000000000..f710b12c8 --- /dev/null +++ b/api/replication/autofollowStats.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 Replication_Common from '../_types/replication._common' + +export type Replication_AutofollowStats_Request = Global.Params & Record + +export type Replication_AutofollowStats_Response = ApiResponse & { + body: Replication_AutofollowStats_ResponseBody; +} + +export type Replication_AutofollowStats_ResponseBody = Replication_Common.AutoFollowStatus + diff --git a/api/replication/autofollowStats.js b/api/replication/autofollowStats.js new file mode 100644 index 000000000..1ad992607 --- /dev/null +++ b/api/replication/autofollowStats.js @@ -0,0 +1,45 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Gets information about auto-follow activity and any replication rules configured on the specified cluster. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-auto-follow-stats - replication.autofollow_stats} + * + * @memberOf API-Replication + * + * @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 autofollowStatsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_replication/autofollow_stats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = autofollowStatsFunc; diff --git a/api/replication/createReplicationRule.d.ts b/api/replication/createReplicationRule.d.ts new file mode 100644 index 000000000..8c94edb02 --- /dev/null +++ b/api/replication/createReplicationRule.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Replication_Common from '../_types/replication._common' + +export type Replication_CreateReplicationRule_Request = Global.Params & { + body: Replication_Common.CreateReplicationRule; +} + +export type Replication_CreateReplicationRule_Response = ApiResponse & { + body: Replication_CreateReplicationRule_ResponseBody; +} + +export type Replication_CreateReplicationRule_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/createReplicationRule.js b/api/replication/createReplicationRule.js new file mode 100644 index 000000000..339cd58ce --- /dev/null +++ b/api/replication/createReplicationRule.js @@ -0,0 +1,47 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, handleMissingParam } = require('../utils'); + +/** + * Automatically starts replication on indexes matching a specified pattern. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#create-replication-rule - replication.create_replication_rule} + * + * @memberOf API-Replication + * + * @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 createReplicationRuleFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_replication/_autofollow'; + const method = 'POST'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = createReplicationRuleFunc; diff --git a/api/replication/deleteReplicationRule.d.ts b/api/replication/deleteReplicationRule.d.ts new file mode 100644 index 000000000..8cdcd438f --- /dev/null +++ b/api/replication/deleteReplicationRule.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Replication_Common from '../_types/replication._common' + +export type Replication_DeleteReplicationRule_Request = Global.Params & { + body: Replication_Common.DeleteReplicationRule; +} + +export type Replication_DeleteReplicationRule_Response = ApiResponse & { + body: Replication_DeleteReplicationRule_ResponseBody; +} + +export type Replication_DeleteReplicationRule_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/deleteReplicationRule.js b/api/replication/deleteReplicationRule.js new file mode 100644 index 000000000..85b05c510 --- /dev/null +++ b/api/replication/deleteReplicationRule.js @@ -0,0 +1,47 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, handleMissingParam } = require('../utils'); + +/** + * Deletes the specified replication rule. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#delete-replication-rule - replication.delete_replication_rule} + * + * @memberOf API-Replication + * + * @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 deleteReplicationRuleFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_replication/_autofollow'; + const method = 'DELETE'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = deleteReplicationRuleFunc; diff --git a/api/replication/followerStats.d.ts b/api/replication/followerStats.d.ts new file mode 100644 index 000000000..e36b3058e --- /dev/null +++ b/api/replication/followerStats.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 Replication_Common from '../_types/replication._common' + +export type Replication_FollowerStats_Request = Global.Params & Record + +export type Replication_FollowerStats_Response = ApiResponse & { + body: Replication_FollowerStats_ResponseBody; +} + +export type Replication_FollowerStats_ResponseBody = Replication_Common.FollowerStatus + diff --git a/api/replication/followerStats.js b/api/replication/followerStats.js new file mode 100644 index 000000000..322640718 --- /dev/null +++ b/api/replication/followerStats.js @@ -0,0 +1,45 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Gets information about follower (syncing) indexes on a specified cluster. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-follower-cluster-stats - replication.follower_stats} + * + * @memberOf API-Replication + * + * @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 followerStatsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_replication/follower_stats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = followerStatsFunc; diff --git a/api/replication/leaderStats.d.ts b/api/replication/leaderStats.d.ts new file mode 100644 index 000000000..d717e7285 --- /dev/null +++ b/api/replication/leaderStats.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 Replication_Common from '../_types/replication._common' + +export type Replication_LeaderStats_Request = Global.Params & Record + +export type Replication_LeaderStats_Response = ApiResponse & { + body: Replication_LeaderStats_ResponseBody; +} + +export type Replication_LeaderStats_ResponseBody = Replication_Common.LeaderStatus + diff --git a/api/replication/leaderStats.js b/api/replication/leaderStats.js new file mode 100644 index 000000000..f022c066d --- /dev/null +++ b/api/replication/leaderStats.js @@ -0,0 +1,45 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments } = require('../utils'); + +/** + * Gets information about replicated leader indexes on a specified cluster. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-leader-cluster-stats - replication.leader_stats} + * + * @memberOf API-Replication + * + * @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 leaderStatsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { body, ...querystring } = params; + + const path = '/_plugins/_replication/leader_stats'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = leaderStatsFunc; diff --git a/api/replication/pause.d.ts b/api/replication/pause.d.ts new file mode 100644 index 000000000..7e694d39b --- /dev/null +++ b/api/replication/pause.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 Common from '../_types/_common' +import * as Global from '../_types/_global' + +export type Replication_Pause_Request = Global.Params & { + body: Replication_Pause_RequestBody; + index: Common.IndexName; +} + +export type Replication_Pause_RequestBody = Record + +export type Replication_Pause_Response = ApiResponse & { + body: Replication_Pause_ResponseBody; +} + +export type Replication_Pause_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/pause.js b/api/replication/pause.js new file mode 100644 index 000000000..996c3869d --- /dev/null +++ b/api/replication/pause.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'); + +/** + * Pauses replication of the leader index. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#pause-replication - replication.pause} + * + * @memberOf API-Replication + * + * @param {object} params + * @param {string} params.index - Name of the data stream, index, or index alias to perform bulk actions on. + * @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 pauseFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_replication/' + index + '/_pause'; + const method = 'POST'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = pauseFunc; diff --git a/api/replication/resume.d.ts b/api/replication/resume.d.ts new file mode 100644 index 000000000..ad01d1321 --- /dev/null +++ b/api/replication/resume.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 Common from '../_types/_common' +import * as Global from '../_types/_global' + +export type Replication_Resume_Request = Global.Params & { + body: Replication_Resume_RequestBody; + index: Common.IndexName; +} + +export type Replication_Resume_RequestBody = Record + +export type Replication_Resume_Response = ApiResponse & { + body: Replication_Resume_ResponseBody; +} + +export type Replication_Resume_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/resume.js b/api/replication/resume.js new file mode 100644 index 000000000..b9437b97c --- /dev/null +++ b/api/replication/resume.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'); + +/** + * Resumes replication of the leader index. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#resume-replication - replication.resume} + * + * @memberOf API-Replication + * + * @param {object} params + * @param {string} params.index - Name of the data stream, index, or index alias to perform bulk actions on. + * @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 resumeFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_replication/' + index + '/_resume'; + const method = 'POST'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = resumeFunc; diff --git a/api/replication/start.d.ts b/api/replication/start.d.ts new file mode 100644 index 000000000..2d32070e3 --- /dev/null +++ b/api/replication/start.d.ts @@ -0,0 +1,32 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Replication_Common from '../_types/replication._common' + +export type Replication_Start_Request = Global.Params & { + body: Replication_Common.Replication; + index: Common.IndexName; +} + +export type Replication_Start_Response = ApiResponse & { + body: Replication_Start_ResponseBody; +} + +export type Replication_Start_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/start.js b/api/replication/start.js new file mode 100644 index 000000000..a43d19a43 --- /dev/null +++ b/api/replication/start.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'); + +/** + * Initiate replication of an index from the leader cluster to the follower cluster. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#start-replication - replication.start} + * + * @memberOf API-Replication + * + * @param {object} params + * @param {string} params.index - Name of the data stream, index, or index alias to perform bulk actions on. + * @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 startFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_replication/' + index + '/_start'; + const method = 'PUT'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = startFunc; diff --git a/api/replication/status.d.ts b/api/replication/status.d.ts new file mode 100644 index 000000000..7e6d2ba5f --- /dev/null +++ b/api/replication/status.d.ts @@ -0,0 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Replication_Common from '../_types/replication._common' + +export type Replication_Status_Request = Global.Params & { + index: Common.IndexName; +} + +export type Replication_Status_Response = ApiResponse & { + body: Replication_Status_ResponseBody; +} + +export type Replication_Status_ResponseBody = Replication_Common.Status + diff --git a/api/replication/status.js b/api/replication/status.js new file mode 100644 index 000000000..787a88d21 --- /dev/null +++ b/api/replication/status.js @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +'use strict'; + +const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils'); + +/** + * Gets the status of index replication. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-replication-status - replication.status} + * + * @memberOf API-Replication + * + * @param {object} params + * @param {string} params.index - Name of the data stream, index, or index alias to perform bulk actions on. + * + * @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 statusFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_replication/' + index + '/_status'; + const method = 'GET'; + body = body || ''; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = statusFunc; diff --git a/api/replication/stop.d.ts b/api/replication/stop.d.ts new file mode 100644 index 000000000..2e9425d33 --- /dev/null +++ b/api/replication/stop.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 Common from '../_types/_common' +import * as Global from '../_types/_global' + +export type Replication_Stop_Request = Global.Params & { + body: Replication_Stop_RequestBody; + index: Common.IndexName; +} + +export type Replication_Stop_RequestBody = Record + +export type Replication_Stop_Response = ApiResponse & { + body: Replication_Stop_ResponseBody; +} + +export type Replication_Stop_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/stop.js b/api/replication/stop.js new file mode 100644 index 000000000..ad8e3a6d7 --- /dev/null +++ b/api/replication/stop.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'); + +/** + * Terminates replication and converts the follower index to a standard index. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#stop-replication - replication.stop} + * + * @memberOf API-Replication + * + * @param {object} params + * @param {string} params.index - Name of the data stream, index, or index alias to perform bulk actions on. + * @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 stopFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_replication/' + index + '/_stop'; + const method = 'POST'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = stopFunc; diff --git a/api/replication/updateSettings.d.ts b/api/replication/updateSettings.d.ts new file mode 100644 index 000000000..7de5fca20 --- /dev/null +++ b/api/replication/updateSettings.d.ts @@ -0,0 +1,32 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * This file was generated from the OpenSearch API Spec. Do NOT edit it + * manually. If you want to make changes, either update the spec or + * modify the API generator. + */ + +import { ApiResponse } from '../../lib/Transport' +import * as Common from '../_types/_common' +import * as Global from '../_types/_global' +import * as Replication_Common from '../_types/replication._common' + +export type Replication_UpdateSettings_Request = Global.Params & { + body: Replication_Common.UpdateSettings; + index: Common.IndexName; +} + +export type Replication_UpdateSettings_Response = ApiResponse & { + body: Replication_UpdateSettings_ResponseBody; +} + +export type Replication_UpdateSettings_ResponseBody = Common.AcknowledgedResponseBase + diff --git a/api/replication/updateSettings.js b/api/replication/updateSettings.js new file mode 100644 index 000000000..6c83113f3 --- /dev/null +++ b/api/replication/updateSettings.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 settings on the follower index. + *
See Also: {@link https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#update-settings - replication.update_settings} + * + * @memberOf API-Replication + * + * @param {object} params + * @param {string} params.index - Name of the data stream, index, or index alias to perform bulk actions on. + * @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 updateSettingsFunc(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + if (params.index == null) return handleMissingParam('index', this, callback); + if (params.body == null) return handleMissingParam('body', this, callback); + + let { body, index, ...querystring } = params; + index = parsePathParam(index); + + const path = '/_plugins/_replication/' + index + '/_update'; + const method = 'PUT'; + + return this.transport.request({ method, path, querystring, body }, options, callback); +} + +module.exports = updateSettingsFunc; diff --git a/api/searchPipeline/get.js b/api/searchPipeline/get.js index ba88f2924..e8469eaf6 100644 --- a/api/searchPipeline/get.js +++ b/api/searchPipeline/get.js @@ -39,7 +39,7 @@ function getFunc(params, options, callback) { let { body, id, ...querystring } = params; id = parsePathParam(id); - const path = ['/_search/pipeline/', id].filter(c => c).join('').replace('//', '/'); + const path = ['/_search/pipeline', id].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/snapshot/cleanupRepository.js b/api/snapshot/cleanupRepository.js index 699aafcf6..4c33f1f68 100644 --- a/api/snapshot/cleanupRepository.js +++ b/api/snapshot/cleanupRepository.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. * @param {string} [params.timeout] - Period to wait for a response. * @param {string} params.repository - Snapshot repository to clean up. * diff --git a/api/snapshot/clone.js b/api/snapshot/clone.js index 88eace928..cebd29980 100644 --- a/api/snapshot/clone.js +++ b/api/snapshot/clone.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} params.repository - A repository name * @param {string} params.snapshot - The name of the snapshot to clone from * @param {string} params.target_snapshot - The name of the cloned snapshot to create diff --git a/api/snapshot/create.js b/api/snapshot/create.js index 645dd8414..c9f9e46a6 100644 --- a/api/snapshot/create.js +++ b/api/snapshot/create.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {boolean} [params.wait_for_completion=false] - If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. * @param {string} params.repository - Repository for the snapshot. * @param {string} params.snapshot - Name of the snapshot. Must be unique in the repository. diff --git a/api/snapshot/createRepository.js b/api/snapshot/createRepository.js index 1ea4a8a55..b2f129743 100644 --- a/api/snapshot/createRepository.js +++ b/api/snapshot/createRepository.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} [params.timeout] - Explicit operation timeout * @param {boolean} [params.verify] - Whether to verify the repository after creation * @param {string} params.repository - A repository name diff --git a/api/snapshot/delete.js b/api/snapshot/delete.js index 984170992..47baa069b 100644 --- a/api/snapshot/delete.js +++ b/api/snapshot/delete.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} params.repository - A repository name * @param {string} params.snapshot - A comma-separated list of snapshot names * diff --git a/api/snapshot/deleteRepository.js b/api/snapshot/deleteRepository.js index 9778b2d9f..1b50074e4 100644 --- a/api/snapshot/deleteRepository.js +++ b/api/snapshot/deleteRepository.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} [params.timeout] - Explicit operation timeout * @param {string} params.repository - Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. * diff --git a/api/snapshot/get.js b/api/snapshot/get.js index 7c7e43f0e..8bab11a33 100644 --- a/api/snapshot/get.js +++ b/api/snapshot/get.js @@ -26,9 +26,9 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.ignore_unavailable=false] - If false, the request returns an error for any snapshots that are unavailable. - * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. - * @param {boolean} [params.verbose] - If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + * @param {boolean} [params.ignore_unavailable=false] - If `false`, the request returns an error for any snapshots that are unavailable. + * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. + * @param {boolean} [params.verbose] - If `true`, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. * @param {string} params.repository - Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. * @param {string} params.snapshot - Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - To get information about any snapshots that are currently running, use _current. * diff --git a/api/snapshot/getRepository.js b/api/snapshot/getRepository.js index 61cfa9f43..2dbfbb81c 100644 --- a/api/snapshot/getRepository.js +++ b/api/snapshot/getRepository.js @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} [params.repository] - A comma-separated list of repository names * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} @@ -41,7 +41,7 @@ function getRepositoryFunc(params, options, callback) { let { body, repository, ...querystring } = params; repository = parsePathParam(repository); - const path = ['/_snapshot/', repository].filter(c => c).join('').replace('//', '/'); + const path = ['/_snapshot', repository].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/snapshot/restore.js b/api/snapshot/restore.js index 9c2172bd9..92239cbea 100644 --- a/api/snapshot/restore.js +++ b/api/snapshot/restore.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {boolean} [params.wait_for_completion=false] - Should this request wait until the operation has completed before returning * @param {string} params.repository - A repository name * @param {string} params.snapshot - A snapshot name diff --git a/api/snapshot/status.js b/api/snapshot/status.js index 416e9fbf7..a07a2e84a 100644 --- a/api/snapshot/status.js +++ b/api/snapshot/status.js @@ -26,8 +26,8 @@ const { normalizeArguments, parsePathParam } = require('../utils'); * * @param {object} [params] * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.ignore_unavailable=false] - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {boolean} [params.ignore_unavailable=false] - Whether to ignore unavailable snapshots, defaults to `false` which means a SnapshotMissingException is thrown + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} [params.repository] - A repository name * @param {string} [params.snapshot] - A comma-separated list of snapshot names * @@ -43,7 +43,7 @@ function statusFunc(params, options, callback) { repository = parsePathParam(repository); snapshot = parsePathParam(snapshot); - const path = ['/_snapshot/', repository, '/', snapshot, '/_status'].filter(c => c).join('').replace('//', '/'); + const path = ['/_snapshot', repository, snapshot, '_status'].filter(c => c != null).join('/'); const method = 'GET'; body = body || ''; diff --git a/api/snapshot/verifyRepository.js b/api/snapshot/verifyRepository.js index ff5c6abef..3cbbe5f3b 100644 --- a/api/snapshot/verifyRepository.js +++ b/api/snapshot/verifyRepository.js @@ -26,7 +26,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * * @param {object} params * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to master node + * @param {string} [params.master_timeout] DEPRECATED - Explicit operation timeout for connection to cluster-manager node * @param {string} [params.timeout] - Explicit operation timeout * @param {string} params.repository - A repository name * diff --git a/api/sql/close.js b/api/sql/close.js index 4c814e266..1b69e79eb 100644 --- a/api/sql/close.js +++ b/api/sql/close.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Sql * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results * @param {object} [params.body] * diff --git a/api/sql/explain.js b/api/sql/explain.js index c24e00b87..c5da72ea6 100644 --- a/api/sql/explain.js +++ b/api/sql/explain.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Sql * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results * @param {object} [params.body] * diff --git a/api/sql/getStats.js b/api/sql/getStats.js index 3211a88fb..ecdbbf5b8 100644 --- a/api/sql/getStats.js +++ b/api/sql/getStats.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Sql * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/sql/postStats.js b/api/sql/postStats.js index 9f5b23624..08a77dca4 100644 --- a/api/sql/postStats.js +++ b/api/sql/postStats.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Sql * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results * @param {object} [params.body] * diff --git a/api/sql/query.js b/api/sql/query.js index cd0fded90..7ec0d416d 100644 --- a/api/sql/query.js +++ b/api/sql/query.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Sql * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {boolean} [params.sanitize=true] - Specifies whether to escape special characters in the results * @param {object} [params.body] * diff --git a/api/sql/settings.js b/api/sql/settings.js index b627be1fb..43d1c6093 100644 --- a/api/sql/settings.js +++ b/api/sql/settings.js @@ -25,7 +25,7 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Sql * * @param {object} [params] - * @param {string} [params.format] - A short version of the Accept header, e.g. json, yaml. + * @param {string} [params.format] - A short version of the Accept header (for example, `json`, `yaml`). * @param {string} [params.body] * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/tasks/cancel.js b/api/tasks/cancel.js index 544ec6b3c..3a3b51b2f 100644 --- a/api/tasks/cancel.js +++ b/api/tasks/cancel.js @@ -42,7 +42,7 @@ function cancelFunc(params, options, callback) { let { body, task_id, ...querystring } = params; task_id = parsePathParam(task_id); - const path = ['/_tasks/', task_id, '/_cancel'].filter(c => c).join('').replace('//', '/'); + const path = ['/_tasks', task_id, '_cancel'].filter(c => c != null).join('/'); const method = 'POST'; body = body || ''; diff --git a/api/wlm/getQueryGroup.js b/api/wlm/getQueryGroup.js index 219610ba4..23ef424f2 100644 --- a/api/wlm/getQueryGroup.js +++ b/api/wlm/getQueryGroup.js @@ -38,7 +38,7 @@ function getQueryGroupFunc(params, options, callback) { let { body, name, ...querystring } = params; name = parsePathParam(name); - const path = ['/_wlm/query_group/', name].filter(c => c).join('').replace('//', '/'); + const path = ['/_wlm/query_group', name].filter(c => c != null).join('/'); const method = 'GET'; body = body || '';