diff --git a/.github/workflows/bundler.yml b/.github/workflows/bundler.yml
index d40f16884..9d02f3fd7 100644
--- a/.github/workflows/bundler.yml
+++ b/.github/workflows/bundler.yml
@@ -33,7 +33,7 @@ jobs:
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
- node-version: 14.x
+ node-version: 18.x
# NPM started understanding yarn.lock file starting from v7
- name: Update NPM
diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml
index 8a86df0e9..7f190fd6a 100644
--- a/.github/workflows/compatibility.yml
+++ b/.github/workflows/compatibility.yml
@@ -53,7 +53,7 @@ jobs:
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
- node-version: 16.x
+ node-version: 18.x
- name: Install
run: |
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index c27468d97..9534eef52 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
- node-version: [12.x]
+ node-version: [18.x]
steps:
- uses: actions/checkout@v2
diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml
index 99f89b0cc..00da11109 100644
--- a/.github/workflows/gh_pages.yml
+++ b/.github/workflows/gh_pages.yml
@@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
- ruby-version: 16.x
+ node-version: 18.x
- name: Install Tools
run: |
sudo apt install -y jq
diff --git a/.github/workflows/integration-unreleased.yml b/.github/workflows/integration-unreleased.yml
index b06f7d576..9747b69c0 100644
--- a/.github/workflows/integration-unreleased.yml
+++ b/.github/workflows/integration-unreleased.yml
@@ -19,10 +19,10 @@ jobs:
fail-fast: false
matrix:
entry:
- - { node_version: '16.x', opensearch_ref: '1.x' }
- - { node_version: '16.x', opensearch_ref: '2.0' }
- - { node_version: '16.x', opensearch_ref: '2.x' }
- - { node_version: '16.x', opensearch_ref: 'main' }
+ - { node_version: '18.x', opensearch_ref: '1.x' }
+ - { node_version: '18.x', opensearch_ref: '2.0' }
+ - { node_version: '18.x', opensearch_ref: '2.x' }
+ - { node_version: '18.x', opensearch_ref: 'main' }
steps:
- name: Checkout OpenSearch
uses: actions/checkout@v3
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 86163836f..6568cfe48 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
- node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
+ node-version: [18.x, 20.x, 22.x]
env:
SECURE_INTEGRATION: false
@@ -69,7 +69,7 @@ jobs:
strategy:
matrix:
- node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
+ node-version: [18.x, 20.x, 22.x]
env:
SECURE_INTEGRATION: true
diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml
index c9774ad67..b23437917 100644
--- a/.github/workflows/license.yml
+++ b/.github/workflows/license.yml
@@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
- node-version: [12.x]
+ node-version: [18.x]
steps:
- uses: actions/checkout@v2
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index e4330aca7..2dbccf976 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
- node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
+ node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest, macOS-13]
steps:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7526b646a..dac60138f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,22 @@
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+## [3.0.0]
+### Added
+### Dependencies
+### Changed
+- All API functions are now generated from the OpenSearch API specification.
+- API request and response types are now generated from the OpenSearch API specification.
+- Overhauled API codebase and break it into smaller, more manageable files for better readability and maintainability.
+- API modules and functions are now lazily loaded to improve performance.
+### Deprecated
+### Removed
+- *BREAKING* Removed support for API param aliases. That is, the API functions now only accept params with the exact names specified in the OpenSearch API specification.
+- *BREAKING* Removed support for snake_cased API function names. All API functions are now camelCased only to conform to JavaScript naming conventions.
+- *BREAKING* Removed support for Node.js 10 through 16. The minimum supported Node.js version is now 18.
+### Fixed
+### Security
+
## [Unreleased]
### Added
### Dependencies
diff --git a/api/_core/bulk.js b/api/_core/bulk.js
new file mode 100644
index 000000000..fa2630d6e
--- /dev/null
+++ b/api/_core/bulk.js
@@ -0,0 +1,58 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to perform multiple index/update/delete operations in a single request.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/ - bulk}
+ *
+ * @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_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 {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
+ * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.
+ * @param {boolean} [params.require_alias=false] - If `true`, the request's actions must target an index alias.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.timeout] - Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
+ * @param {string} [params.type] - Default document type for items which don't provide one.
+ * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
+ * @param {string} [params.index] - Name of the data stream, index, or index alias to perform bulk actions on.
+ * @param {array} params.body - The operation definition and data (action-data pairs), separated by newlines
+ *
+ * @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 bulkFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_bulk'].filter(c => c).join('').replace('//', '/');
+ const method = index == null ? 'POST' : 'PUT';
+
+ return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback);
+}
+
+module.exports = bulkFunc;
diff --git a/api/_core/clear_scroll.js b/api/_core/clear_scroll.js
new file mode 100644
index 000000000..169c5148b
--- /dev/null
+++ b/api/_core/clear_scroll.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Explicitly clears the search context for a scroll.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ - clear_scroll}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} [params]
+ * @param {string} [params.scroll_id] DEPRECATED - Comma-separated list of scroll IDs to clear. To clear all scroll IDs, use `_all`.
+ * @param {object} [params.body] - Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
+ *
+ * @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 clearScrollFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(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 method = 'DELETE';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = clearScrollFunc;
diff --git a/api/_core/count.js b/api/_core/count.js
new file mode 100644
index 000000000..f3540f035
--- /dev/null
+++ b/api/_core/count.js
@@ -0,0 +1,62 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Returns number of documents matching a query.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/count/ - count}
+ *
+ * @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 indices. This behavior applies even if the request targets other open indices.
+ * @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 {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.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.ignore_throttled] - If `true`, concrete, expanded or aliased indices are 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.lenient] - If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
+ * @param {number} [params.min_score] - Sets the minimum `_score` value that documents must have to be included in the result.
+ * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default.
+ * @param {string} [params.q] - Query in the Lucene query string syntax.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {number} [params.terminate_after] - Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting.
+ * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`.
+ * @param {object} [params.body] - Query to restrict the results specified with the Query DSL (optional)
+ *
+ * @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 countFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_count'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = countFunc;
diff --git a/api/_core/create.js b/api/_core/create.js
new file mode 100644
index 000000000..0b445119b
--- /dev/null
+++ b/api/_core/create.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Creates a new document in the index.
+
+Returns a 409 response when a document with a same ID already exists in the index.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ - create}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
+ * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.timeout] - Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
+ * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
+ * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`.
+ * @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.id - Unique identifier for the document.
+ * @param {string} params.index - Name of the data stream or index to target. If the target doesn't exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. If the target doesn't exist and doesn't match a data stream template, this request creates the index.
+ * @param {object} params.body - The document
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function createFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_create/' + id;
+ const method = 'POST';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = createFunc;
diff --git a/api/_core/create_pit.js b/api/_core/create_pit.js
new file mode 100644
index 000000000..9fba66c31
--- /dev/null
+++ b/api/_core/create_pit.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Creates point in time context.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#create-a-pit - create_pit}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {boolean} [params.allow_partial_pit_creation] - Allow if point in time can be created with partial failures.
+ * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
+ * @param {string} [params.keep_alive] - Specify the keep alive for point in time.
+ * @param {string} [params.preference=random] - Specify the node or shard the operation should be performed on.
+ * @param {array} [params.routing] - Comma-separated list of specific routing values.
+ * @param {array} params.index - Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function createPitFunc(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 = '/' + index + '/_search/point_in_time';
+ const method = 'POST';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = createPitFunc;
diff --git a/api/_core/delete.js b/api/_core/delete.js
new file mode 100644
index 000000000..20e6fe3c2
--- /dev/null
+++ b/api/_core/delete.js
@@ -0,0 +1,59 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Removes a document from the index.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/ - delete}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term.
+ * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number.
+ * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.timeout] - Period to wait for active shards.
+ * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
+ * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`.
+ * @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.id - Unique identifier for the document.
+ * @param {string} params.index - Name of the target index.
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function deleteFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_doc/' + id;
+ const method = 'DELETE';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = deleteFunc;
diff --git a/api/_core/delete_all_pits.js b/api/_core/delete_all_pits.js
new file mode 100644
index 000000000..569bd81fe
--- /dev/null
+++ b/api/_core/delete_all_pits.js
@@ -0,0 +1,44 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Deletes all active point in time searches.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits - delete_all_pits}
+ *
+ * @memberOf API-Core
+ *
+ * @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 deleteAllPitsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/_search/point_in_time/_all';
+ const method = 'DELETE';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = deleteAllPitsFunc;
diff --git a/api/_core/delete_by_query.js b/api/_core/delete_by_query.js
new file mode 100644
index 000000000..0b064603e
--- /dev/null
+++ b/api/_core/delete_by_query.js
@@ -0,0 +1,82 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Deletes documents matching the provided query.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/delete-by-query/ - delete_by_query}
+ *
+ * @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 {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 indices. This behavior applies even if the request targets other open indices. 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.
+ * @param {string} [params.conflicts] - What to do if delete by query hits version conflicts: `abort` or `proceed`.
+ * @param {string} [params.default_operator] - The default operator for query string query: `AND` or `OR`.
+ * @param {string} [params.df] - Field to use as default where no field prefix is given in the query string.
+ * @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 {number} [params.from=0] - Starting offset.
+ * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index.
+ * @param {boolean} [params.lenient] - If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
+ * @param {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 {boolean} [params.request_cache] - If `true`, the request cache is used for this request. Defaults to the index-level setting.
+ * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.scroll] - Period to retain the search context for scrolling.
+ * @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation.
+ * @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout.
+ * @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.
+ * @param {integer} [params.size] - Deprecated, please use `max_docs` instead.
+ * @param {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.
+ * @param {number} [params.terminate_after] - Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
+ * @param {string} [params.timeout] - Period each deletion request waits for active shards.
+ * @param {boolean} [params.version] - If `true`, returns the document version as part of a hit.
+ * @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 {boolean} [params.wait_for_completion=true] - If `true`, the request blocks until the operation is complete.
+ * @param {string} params.index - Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this parameter or use `*` or `_all`.
+ * @param {object} params.body - The search definition using the Query DSL
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function deleteByQueryFunc(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 = '/' + index + '/_delete_by_query';
+ const method = 'POST';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = deleteByQueryFunc;
diff --git a/api/_core/delete_by_query_rethrottle.js b/api/_core/delete_by_query_rethrottle.js
new file mode 100644
index 000000000..403730260
--- /dev/null
+++ b/api/_core/delete_by_query_rethrottle.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Changes the number of requests per second for a particular Delete By Query operation.
+ *
See Also: {@link https://opensearch.org/docs/latest - delete_by_query_rethrottle}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {number} [params.requests_per_second] - The throttle for this request in sub-requests per second.
+ * @param {string} params.task_id - The ID for the task.
+ *
+ * @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 deleteByQueryRethrottleFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.task_id == null) return handleMissingParam('task_id', this, callback);
+
+ let { body, task_id, ...querystring } = params;
+ task_id = parsePathParam(task_id);
+
+ const path = '/_delete_by_query/' + task_id + '/_rethrottle';
+ const method = 'POST';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = deleteByQueryRethrottleFunc;
diff --git a/api/_core/delete_pit.js b/api/_core/delete_pit.js
new file mode 100644
index 000000000..e5aa0d42a
--- /dev/null
+++ b/api/_core/delete_pit.js
@@ -0,0 +1,46 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Deletes one or more point in time searches based on the IDs passed.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits - delete_pit}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} [params]
+ * @param {object} [params.body] - The point-in-time ids to be deleted
+ *
+ * @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 deletePitFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/_search/point_in_time';
+ const method = 'DELETE';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = deletePitFunc;
diff --git a/api/_core/delete_script.js b/api/_core/delete_script.js
new file mode 100644
index 000000000..18dfc4234
--- /dev/null
+++ b/api/_core/delete_script.js
@@ -0,0 +1,51 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Deletes a script.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/delete-script/ - delete_script}
+ *
+ * @memberOf API-Core
+ *
+ * @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.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.
+ *
+ * @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 deleteScriptFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+
+ let { body, id, ...querystring } = params;
+ id = parsePathParam(id);
+
+ const path = '/_scripts/' + id;
+ const method = 'DELETE';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = deleteScriptFunc;
diff --git a/api/_core/exists.js b/api/_core/exists.js
new file mode 100644
index 000000000..774b4aabf
--- /dev/null
+++ b/api/_core/exists.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns information about whether a document exists in an index.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ - exists}
+ *
+ * @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_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 {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: `external`, `external_gte`.
+ * @param {string} params.id - Identifier of the document.
+ * @param {string} params.index - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`).
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function existsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_doc/' + id;
+ const method = 'HEAD';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = existsFunc;
diff --git a/api/_core/exists_source.js b/api/_core/exists_source.js
new file mode 100644
index 000000000..c1360e036
--- /dev/null
+++ b/api/_core/exists_source.js
@@ -0,0 +1,60 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns information about whether a document source exists in an index.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ - exists_source}
+ *
+ * @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_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 {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`.
+ * @param {string} params.id - Identifier of the document.
+ * @param {string} params.index - Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`).
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function existsSourceFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_source/' + id;
+ const method = 'HEAD';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = existsSourceFunc;
diff --git a/api/_core/explain.js b/api/_core/explain.js
new file mode 100644
index 000000000..0f1394b06
--- /dev/null
+++ b/api/_core/explain.js
@@ -0,0 +1,64 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns information about why a specific matches (or doesn't match) a query.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/explain/ - explain}
+ *
+ * @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_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.
+ * @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 {string} [params.default_operator] - The default operator for query string query: `AND` or `OR`.
+ * @param {string} [params.df=_all] - Field to use as default where no field prefix is given in the query string.
+ * @param {boolean} [params.lenient] - If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
+ * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default.
+ * @param {string} [params.q] - Query in the Lucene query string syntax.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return in the response.
+ * @param {string} params.id - Defines the document ID.
+ * @param {string} params.index - Index names used to limit the request. Only a single index name can be provided to this parameter.
+ * @param {object} [params.body] - The query definition using the Query DSL
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function explainFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_explain/' + id;
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = explainFunc;
diff --git a/api/_core/field_caps.js b/api/_core/field_caps.js
new file mode 100644
index 000000000..90f313f2e
--- /dev/null
+++ b/api/_core/field_caps.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Returns the information about the capabilities of fields among multiple indices.
+ *
See Also: {@link https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations - field_caps}
+ *
+ * @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 indices. This behavior applies even if the request targets other open indices. 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 indices 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, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, 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}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function fieldCapsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_field_caps'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = fieldCapsFunc;
diff --git a/api/_core/get.js b/api/_core/get.js
new file mode 100644
index 000000000..c2df26391
--- /dev/null
+++ b/api/_core/get.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns a document.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ - get}
+ *
+ * @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_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.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.id - Unique identifier of the document.
+ * @param {string} params.index - Name of the index that contains the document.
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function getFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_doc/' + id;
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = getFunc;
diff --git a/api/_core/get_all_pits.js b/api/_core/get_all_pits.js
new file mode 100644
index 000000000..9732719bb
--- /dev/null
+++ b/api/_core/get_all_pits.js
@@ -0,0 +1,44 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Lists all active point in time searches.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#list-all-pits - get_all_pits}
+ *
+ * @memberOf API-Core
+ *
+ * @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 getAllPitsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/_search/point_in_time/_all';
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = getAllPitsFunc;
diff --git a/api/_core/get_script.js b/api/_core/get_script.js
new file mode 100644
index 000000000..9354218a1
--- /dev/null
+++ b/api/_core/get_script.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns a script.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-stored-script/ - get_script}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
+ * @param {string} [params.master_timeout] DEPRECATED - Specify timeout for connection to master
+ * @param {string} params.id - Identifier for the stored script or search template.
+ *
+ * @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 getScriptFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+
+ let { body, id, ...querystring } = params;
+ id = parsePathParam(id);
+
+ const path = '/_scripts/' + id;
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = getScriptFunc;
diff --git a/api/_core/get_script_context.js b/api/_core/get_script_context.js
new file mode 100644
index 000000000..a9a72eaa0
--- /dev/null
+++ b/api/_core/get_script_context.js
@@ -0,0 +1,44 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Returns all script contexts.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-contexts/ - get_script_context}
+ *
+ * @memberOf API-Core
+ *
+ * @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 getScriptContextFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/_script_context';
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = getScriptContextFunc;
diff --git a/api/_core/get_script_languages.js b/api/_core/get_script_languages.js
new file mode 100644
index 000000000..4838822a2
--- /dev/null
+++ b/api/_core/get_script_languages.js
@@ -0,0 +1,44 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Returns available script types, languages and contexts.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-language/ - get_script_languages}
+ *
+ * @memberOf API-Core
+ *
+ * @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 getScriptLanguagesFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/_script_language';
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = getScriptLanguagesFunc;
diff --git a/api/_core/get_source.js b/api/_core/get_source.js
new file mode 100644
index 000000000..06b628894
--- /dev/null
+++ b/api/_core/get_source.js
@@ -0,0 +1,60 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns the source of a document.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ - get_source}
+ *
+ * @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_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 {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.id - Unique identifier of the document.
+ * @param {string} params.index - Name of the index that contains the document.
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function getSourceFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_source/' + id;
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = getSourceFunc;
diff --git a/api/_core/index.js b/api/_core/index.js
new file mode 100644
index 000000000..f4384ea2b
--- /dev/null
+++ b/api/_core/index.js
@@ -0,0 +1,62 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Creates or updates a document in an index.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ - index}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term.
+ * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number.
+ * @param {string} [params.op_type] - Set to create to only index the document if it does not already exist (put if absent). If a document with the specified `_id` already exists, the indexing operation will fail. Same as using the `/_create` endpoint. Valid values: `index`, `create`. If document id is specified, it defaults to `index`. Otherwise, it defaults to `create`.
+ * @param {string} [params.pipeline] - ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
+ * @param {string} [params.refresh] - If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.
+ * @param {boolean} [params.require_alias=false] - If `true`, the destination must be an index alias.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.timeout] - Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
+ * @param {number} [params.version] - Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
+ * @param {string} [params.version_type] - Specific version type: `external`, `external_gte`.
+ * @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 data stream or index to target.
+ * @param {string} [params.id] - Unique identifier for the document.
+ * @param {object} params.body - The document
+ *
+ * @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 indexFunc(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, id, ...querystring } = params;
+ index = parsePathParam(index);
+ id = parsePathParam(id);
+
+ const path = ['/', index, '/_doc/', id].filter(c => c).join('').replace('//', '/');
+ const method = id == null ? 'POST' : 'PUT';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = indexFunc;
diff --git a/api/_core/info.js b/api/_core/info.js
new file mode 100644
index 000000000..c7e487755
--- /dev/null
+++ b/api/_core/info.js
@@ -0,0 +1,44 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Returns basic information about the cluster.
+ *
See Also: {@link https://opensearch.org/docs/latest - info}
+ *
+ * @memberOf API-Core
+ *
+ * @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 infoFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/';
+ const method = 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = infoFunc;
diff --git a/api/_core/mget.js b/api/_core/mget.js
new file mode 100644
index 000000000..87a250e03
--- /dev/null
+++ b/api/_core/mget.js
@@ -0,0 +1,56 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to get multiple documents in one request.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/ - mget}
+ *
+ * @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_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.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.
+ * @param {object} params.body - Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL.
+ *
+ * @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 mgetFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_mget'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = mgetFunc;
diff --git a/api/_core/msearch.js b/api/_core/msearch.js
new file mode 100644
index 000000000..1ac584524
--- /dev/null
+++ b/api/_core/msearch.js
@@ -0,0 +1,55 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to execute several search operations in one request.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/multi-search/ - msearch}
+ *
+ * @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 {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 {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, indices, and index aliases to search.
+ * @param {array} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
+ *
+ * @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 msearchFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_msearch'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+
+ return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback);
+}
+
+module.exports = msearchFunc;
diff --git a/api/_core/msearch_template.js b/api/_core/msearch_template.js
new file mode 100644
index 000000000..aa64fc17a
--- /dev/null
+++ b/api/_core/msearch_template.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to execute several search template operations in one request.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/search-template/ - msearch_template}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {boolean} [params.ccs_minimize_roundtrips=true] - If `true`, network round-trips are minimized for cross-cluster search requests.
+ * @param {number} [params.max_concurrent_searches] - Maximum number of concurrent searches the API can run.
+ * @param {boolean} [params.rest_total_hits_as_int=false] - If `true`, the response returns `hits.total` as an integer. If `false`, it returns `hits.total` as an object.
+ * @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.
+ * @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, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*`.
+ * @param {array} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
+ *
+ * @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 msearchTemplateFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_msearch/template'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+
+ return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback);
+}
+
+module.exports = msearchTemplateFunc;
diff --git a/api/_core/mtermvectors.js b/api/_core/mtermvectors.js
new file mode 100644
index 000000000..866460e4f
--- /dev/null
+++ b/api/_core/mtermvectors.js
@@ -0,0 +1,60 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Returns multiple termvectors in one request.
+ *
See Also: {@link https://opensearch.org/docs/latest - mtermvectors}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} [params]
+ * @param {boolean} [params.field_statistics=true] - If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.
+ * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.
+ * @param {array} [params.ids] - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
+ * @param {boolean} [params.offsets=true] - If `true`, the response includes term offsets.
+ * @param {boolean} [params.payloads=true] - If `true`, the response includes term payloads.
+ * @param {boolean} [params.positions=true] - If `true`, the response includes term positions.
+ * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default.
+ * @param {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.
+ * @param {string} [params.version_type] - Specific version type.
+ * @param {string} [params.index] - Name of the index that contains the documents.
+ * @param {object} [params.body] - Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function mtermvectorsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_mtermvectors'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = mtermvectorsFunc;
diff --git a/api/_core/ping.js b/api/_core/ping.js
new file mode 100644
index 000000000..8fd44778f
--- /dev/null
+++ b/api/_core/ping.js
@@ -0,0 +1,44 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Returns whether the cluster is running.
+ *
See Also: {@link https://opensearch.org/docs/latest - ping}
+ *
+ * @memberOf API-Core
+ *
+ * @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 pingFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/';
+ const method = 'HEAD';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = pingFunc;
diff --git a/api/_core/put_script.js b/api/_core/put_script.js
new file mode 100644
index 000000000..68334e3a8
--- /dev/null
+++ b/api/_core/put_script.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Creates or updates a script.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ - put_script}
+ *
+ * @memberOf API-Core
+ *
+ * @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.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
+ * @param {string} params.id - Identifier for the stored script or search template. Must be unique within the cluster.
+ * @param {string} [params.context] - Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context.
+ * @param {object} params.body - The document
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function putScriptFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, id, context, ...querystring } = params;
+ id = parsePathParam(id);
+ context = parsePathParam(context);
+
+ const path = ['/_scripts/', id, '/', context].filter(c => c).join('').replace('//', '/');
+ const method = context == null ? 'POST' : 'PUT';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = putScriptFunc;
diff --git a/api/_core/rank_eval.js b/api/_core/rank_eval.js
new file mode 100644
index 000000000..7b54501d0
--- /dev/null
+++ b/api/_core/rank_eval.js
@@ -0,0 +1,52 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to evaluate the quality of ranked search results over a set of typical search queries.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/rank-eval/ - rank_eval}
+ *
+ * @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 indices. This behavior applies even if the request targets other open indices. 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] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
+ * @param {boolean} [params.ignore_unavailable] - If `true`, missing or closed indices are not included in the response.
+ * @param {string} [params.search_type] - Search operation type
+ * @param {string} [params.index] - Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`.
+ * @param {object} params.body - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.
+ *
+ * @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 rankEvalFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_rank_eval'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = rankEvalFunc;
diff --git a/api/_core/reindex.js b/api/_core/reindex.js
new file mode 100644
index 000000000..a084639d1
--- /dev/null
+++ b/api/_core/reindex.js
@@ -0,0 +1,56 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to copy documents from one index to another, optionally filtering the source
+documents by a query, changing the destination index settings, or fetching the
+documents from a remote cluster.
+ *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/reindex-data/ - reindex}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {integer} [params.max_docs] - Maximum number of documents to process. By default, all documents.
+ * @param {boolean} [params.refresh] - If `true`, the request refreshes affected shards to make this operation visible to search.
+ * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. Defaults to no throttle.
+ * @param {string} [params.scroll] - Specifies how long a consistent view of the index should be maintained for scrolled search.
+ * @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.
+ * @param {string} [params.timeout] - Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards.
+ * @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 {boolean} [params.wait_for_completion=true] - If `true`, the request blocks until the operation is complete.
+ * @param {object} params.body - The search definition using the Query DSL and the prototype for the index request.
+ *
+ * @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 reindexFunc(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 = '/_reindex';
+ const method = 'POST';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = reindexFunc;
diff --git a/api/_core/reindex_rethrottle.js b/api/_core/reindex_rethrottle.js
new file mode 100644
index 000000000..fafc58ffd
--- /dev/null
+++ b/api/_core/reindex_rethrottle.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Changes the number of requests per second for a particular Reindex operation.
+ *
See Also: {@link https://opensearch.org/docs/latest - reindex_rethrottle}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {number} [params.requests_per_second] - The throttle for this request in sub-requests per second.
+ * @param {string} params.task_id - Identifier for the task.
+ *
+ * @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 reindexRethrottleFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.task_id == null) return handleMissingParam('task_id', this, callback);
+
+ let { body, task_id, ...querystring } = params;
+ task_id = parsePathParam(task_id);
+
+ const path = '/_reindex/' + task_id + '/_rethrottle';
+ const method = 'POST';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = reindexRethrottleFunc;
diff --git a/api/_core/render_search_template.js b/api/_core/render_search_template.js
new file mode 100644
index 000000000..d4c745683
--- /dev/null
+++ b/api/_core/render_search_template.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Allows to use the Mustache language to pre-render a search definition.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/search-template/ - render_search_template}
+ *
+ * @memberOf API-Core
+ *
+ * @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 {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 renderSearchTemplateFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, id, ...querystring } = params;
+ id = parsePathParam(id);
+
+ const path = ['/_render/template/', id].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = renderSearchTemplateFunc;
diff --git a/api/_core/scripts_painless_execute.js b/api/_core/scripts_painless_execute.js
new file mode 100644
index 000000000..762dbdc41
--- /dev/null
+++ b/api/_core/scripts_painless_execute.js
@@ -0,0 +1,46 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments } = require('../utils');
+
+/**
+ * Allows an arbitrary script to be executed and a result to be returned.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ - scripts_painless_execute}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} [params]
+ * @param {object} [params.body] - The script to execute
+ *
+ * @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 scriptsPainlessExecuteFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, ...querystring } = params;
+
+ const path = '/_scripts/painless/_execute';
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = scriptsPainlessExecuteFunc;
diff --git a/api/_core/scroll.js b/api/_core/scroll.js
new file mode 100644
index 000000000..09f18e127
--- /dev/null
+++ b/api/_core/scroll.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Allows to retrieve a large numbers of results from a single search request.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/#path-and-http-methods - scroll}
+ *
+ * @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 {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.
+ *
+ * @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 scrollFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(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 method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = scrollFunc;
diff --git a/api/_core/search.js b/api/_core/search.js
new file mode 100644
index 000000000..c22dd6a3f
--- /dev/null
+++ b/api/_core/search.js
@@ -0,0 +1,94 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Returns results matching a query.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/search/ - search}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} [params]
+ * @param {string} [params._source] - Indicates which source fields are returned for matching documents. These fields are returned in the `hits._source` property of the search response. Valid values are: `true` to return the entire document source; `false` to not return the document source; `` to return the source fields that are specified as a comma-separated list (supports wildcard (`*`) patterns).
+ * @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 indices. This behavior applies even if the request targets other open indices. 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 {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 {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.
+ * @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.explain] - If `true`, returns detailed information about score computation as part of a hit.
+ * @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 indices 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.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.
+ * @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 (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.
+ * @param {string} [params.preference=random] - Nodes and shards used for the search. By default, OpenSearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: `_only_local` to run the search only on shards on the local node; `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method; `_only_nodes:,` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; `_shards:,` to run the search only on the specified shards; `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order.
+ * @param {string} [params.q] - Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing.
+ * @param {boolean} [params.request_cache] - If `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings.
+ * @param {boolean} [params.rest_total_hits_as_int=false] - Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.scroll] - Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed `1d` (24 hours). You can change this limit using the `search.max_keep_alive` cluster-level setting.
+ * @param {string} [params.search_pipeline] - Customizable sequence of processing stages applied to search queries.
+ * @param {string} [params.search_type] - How distributed term frequencies are calculated for relevance scoring.
+ * @param {boolean} [params.seq_no_primary_term] - If `true`, returns sequence number and primary term of the last modification of each hit.
+ * @param {number} [params.size=10] - Defines the number of hits to return. 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 {string} [params.sort] - A comma-separated list of : pairs.
+ * @param {array} [params.stats] - Specific `tag` of the request for logging and statistical purposes.
+ * @param {string} [params.stored_fields] - A comma-separated 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`. You can pass `_source: true` to return both source fields and stored fields in the search response.
+ * @param {string} [params.suggest_field] - Specifies which field to use for suggestions.
+ * @param {string} [params.suggest_mode] - Specifies the suggest mode. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ * @param {number} [params.suggest_size] - Number of suggestions to return. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ * @param {string} [params.suggest_text] - The source text for which the suggestions should be returned. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified.
+ * @param {number} [params.terminate_after] - Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to `0` (default), the query does not terminate early.
+ * @param {string} [params.timeout] - Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error.
+ * @param {boolean} [params.track_scores] - If `true`, calculate and return document scores, even if the scores are not used for sorting.
+ * @param {string} [params.track_total_hits] - Number of hits matching the query to count accurately. If `true`, the exact number of hits is returned at the cost of some performance. If `false`, the response does not include the total number of hits matching the query.
+ * @param {boolean} [params.typed_keys] - If `true`, aggregation and suggester names are be prefixed by their respective types in the response.
+ * @param {boolean} [params.version] - If `true`, returns document version as part of a hit.
+ * @param {string} [params.index] - Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`.
+ * @param {object} [params.body] - The search definition using the Query DSL
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function searchFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_search'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = searchFunc;
diff --git a/api/_core/search_shards.js b/api/_core/search_shards.js
new file mode 100644
index 000000000..baa7a13a9
--- /dev/null
+++ b/api/_core/search_shards.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam } = require('../utils');
+
+/**
+ * Returns information about the indices and shards that a search request would be executed against.
+ *
See Also: {@link https://opensearch.org/docs/latest - search_shards}
+ *
+ * @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 indices. This behavior applies even if the request targets other open indices. 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`. 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 {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only.
+ * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.index] - Returns the indices and shards that a search request would be executed against.
+ *
+ * @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 searchShardsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_search_shards'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = searchShardsFunc;
diff --git a/api/_core/search_template.js b/api/_core/search_template.js
new file mode 100644
index 000000000..0bef4442c
--- /dev/null
+++ b/api/_core/search_template.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Allows to use the Mustache language to pre-render a search definition.
+ *
See Also: {@link https://opensearch.org/docs/latest/search-plugins/search-template/ - search_template}
+ *
+ * @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 indices. This behavior applies even if the request targets other open indices. 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.ccs_minimize_roundtrips=true] - If `true`, network round-trips are minimized for cross-cluster search requests.
+ * @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.explain] - If `true`, the response includes additional details about score computation as part of a hit.
+ * @param {boolean} [params.ignore_throttled] - If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.
+ * @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 {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, indices, and aliases to search. Supports wildcards (*).
+ * @param {object} params.body - The search definition template and its params
+ *
+ * @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 searchTemplateFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, index, ...querystring } = params;
+ index = parsePathParam(index);
+
+ const path = ['/', index, '/_search/template'].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = searchTemplateFunc;
diff --git a/api/_core/termvectors.js b/api/_core/termvectors.js
new file mode 100644
index 000000000..b953b6e9b
--- /dev/null
+++ b/api/_core/termvectors.js
@@ -0,0 +1,62 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Returns information and statistics about terms in the fields of a particular document.
+ *
See Also: {@link https://opensearch.org/docs/latest - termvectors}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {boolean} [params.field_statistics=true] - If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.
+ * @param {string} [params.fields] - Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.
+ * @param {boolean} [params.offsets=true] - If `true`, the response includes term offsets.
+ * @param {boolean} [params.payloads=true] - If `true`, the response includes term payloads.
+ * @param {boolean} [params.positions=true] - If `true`, the response includes term positions.
+ * @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default.
+ * @param {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.
+ * @param {string} [params.version_type] - Specific version type.
+ * @param {string} params.index - Name of the index that contains the document.
+ * @param {string} [params.id] - Unique identifier of the document.
+ * @param {object} [params.body] - Define parameters and or supply a document to get termvectors for. See documentation.
+ *
+ * @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 termvectorsFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+
+ let { body, index, id, ...querystring } = params;
+ index = parsePathParam(index);
+ id = parsePathParam(id);
+
+ const path = ['/', index, '/_termvectors/', id].filter(c => c).join('').replace('//', '/');
+ const method = body ? 'POST' : 'GET';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = termvectorsFunc;
diff --git a/api/_core/update.js b/api/_core/update.js
new file mode 100644
index 000000000..d283fc1b5
--- /dev/null
+++ b/api/_core/update.js
@@ -0,0 +1,64 @@
+/*
+ * Copyright OpenSearch Contributors
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/*
+ * This file was generated from OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Updates a document with a script or partial document.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/update-document/ - update}
+ *
+ * @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_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 {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.
+ * @param {string} [params.wait_for_active_shards] - The number of shard copies that must be active before proceeding with the operations. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard.
+ * @param {string} params.id - Document ID
+ * @param {string} params.index - The name of the index
+ * @param {object} params.body - The request definition requires either `script` or partial `doc`
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function updateFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.id == null) return handleMissingParam('id', this, callback);
+ if (params.index == null) return handleMissingParam('index', this, callback);
+ if (params.body == null) return handleMissingParam('body', this, callback);
+
+ let { body, id, index, ...querystring } = params;
+ id = parsePathParam(id);
+ index = parsePathParam(index);
+
+ const path = '/' + index + '/_update/' + id;
+ const method = 'POST';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = updateFunc;
diff --git a/api/_core/update_by_query.js b/api/_core/update_by_query.js
new file mode 100644
index 000000000..4056441fb
--- /dev/null
+++ b/api/_core/update_by_query.js
@@ -0,0 +1,84 @@
+/*
+ * 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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Performs an update on every document in the index without changing the source,
+for example to pick up a mapping change.
+ *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/update-by-query/ - update_by_query}
+ *
+ * @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 {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 indices. This behavior applies even if the request targets other open indices. 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.
+ * @param {string} [params.conflicts] - What to do if update by query hits version conflicts: `abort` or `proceed`.
+ * @param {string} [params.default_operator] - The default operator for query string query: `AND` or `OR`.
+ * @param {string} [params.df] - Field to use as default where no field prefix is given in the query string.
+ * @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 {number} [params.from=0] - Starting offset.
+ * @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index.
+ * @param {boolean} [params.lenient] - If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
+ * @param {number} [params.max_docs] - Maximum number of documents to process. Defaults to all documents.
+ * @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 {boolean} [params.request_cache] - If `true`, the request cache is used for this request.
+ * @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second.
+ * @param {string} [params.routing] - Custom value used to route operations to a specific shard.
+ * @param {string} [params.scroll] - Period to retain the search context for scrolling.
+ * @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation.
+ * @param {string} [params.search_timeout] - Explicit timeout for each search request.
+ * @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.
+ * @param {integer} [params.size] - Deprecated, please use `max_docs` instead.
+ * @param {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.
+ * @param {number} [params.terminate_after] - Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
+ * @param {string} [params.timeout] - Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards.
+ * @param {boolean} [params.version] - If `true`, returns the document version as part of a hit.
+ * @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 {boolean} [params.wait_for_completion=true] - If `true`, the request blocks until the operation is complete.
+ * @param {string} params.index - Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this parameter or use `*` or `_all`.
+ * @param {object} [params.body] - The search definition using the Query DSL
+ *
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
+ * @param {function} [callback] - Callback that handles errors and response
+ *
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
+ */
+function updateByQueryFunc(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 = '/' + index + '/_update_by_query';
+ const method = 'POST';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = updateByQueryFunc;
diff --git a/api/_core/update_by_query_rethrottle.js b/api/_core/update_by_query_rethrottle.js
new file mode 100644
index 000000000..336cab84e
--- /dev/null
+++ b/api/_core/update_by_query_rethrottle.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 OpenSearch API Spec. Do not edit it
+ * manually. If you want to make changes, either update the spec or
+ * the API generator.
+ */
+
+'use strict'
+
+const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
+
+/**
+ * Changes the number of requests per second for a particular Update By Query operation.
+ *
See Also: {@link https://opensearch.org/docs/latest - update_by_query_rethrottle}
+ *
+ * @memberOf API-Core
+ *
+ * @param {object} params
+ * @param {number} [params.requests_per_second] - The throttle for this request in sub-requests per second.
+ * @param {string} params.task_id - The ID for the task.
+ *
+ * @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 updateByQueryRethrottleFunc(params, options, callback) {
+ [params, options, callback] = normalizeArguments(params, options, callback);
+ if (params.task_id == null) return handleMissingParam('task_id', this, callback);
+
+ let { body, task_id, ...querystring } = params;
+ task_id = parsePathParam(task_id);
+
+ const path = '/_update_by_query/' + task_id + '/_rethrottle';
+ const method = 'POST';
+ body = body || '';
+
+ return this.transport.request({ method, path, querystring, body }, options, callback);
+}
+
+module.exports = updateByQueryRethrottleFunc;
diff --git a/api/api/bulk.js b/api/api/bulk.js
deleted file mode 100644
index 3fb5a1401..000000000
--- a/api/api/bulk.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'wait_for_active_shards',
- 'refresh',
- 'routing',
- 'timeout',
- 'type',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'pipeline',
- 'require_alias',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- waitForActiveShards: 'wait_for_active_shards',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- requireAlias: 'require_alias',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * The bulk operation lets you add, update, or delete many documents in a single request.
- * Compared to individual OpenSearch indexing requests, the bulk operation has significant performance benefits.
- * Whenever practical, we recommend batching indexing operations into bulk requests.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/|OpenSearch - Bulk}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {Object[]} params.body - {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/#request-body|Request Body}
- * @param {string} [params.index] - Specifying the index means you don’t need to include it in the request body.
- * @param {string} [params.pipeline] - The pipeline ID for preprocessing documents.
- * @param {string} [params.routing] - Routes the request to the specified shard.
- * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster.
- * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed.
- * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/#response|Bulk Response}
- */
-function bulkApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk';
- } else if (index != null) {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_bulk';
- } else {
- if (method == null) method = 'POST';
- path = '/' + '_bulk';
- }
-
- // build request object
- const request = {
- method,
- path,
- bulkBody: body,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = bulkApi;
diff --git a/api/api/cat.js b/api/api/cat.js
deleted file mode 100644
index 84e2c3d7e..000000000
--- a/api/api/cat.js
+++ /dev/null
@@ -1,933 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-CAT */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'format',
- 'local',
- 'h',
- 'help',
- 's',
- 'v',
- 'expand_wildcards',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
- 'bytes',
- 'cluster_manager_timeout',
- 'master_timeout',
- 'fields',
- 'time',
- 'ts',
- 'health',
- 'pri',
- 'include_unloaded_segments',
- 'allow_no_match',
- 'allow_no_datafeeds',
- 'allow_no_jobs',
- 'from',
- 'size',
- 'full_id',
- 'include_bootstrap',
- 'active_only',
- 'detailed',
- 'index',
- 'ignore_unavailable',
- 'nodes',
- 'actions',
- 'parent_task_id',
- 'pri',
-];
-const snakeCase = {
- expandWildcards: 'expand_wildcards',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- includeUnloadedSegments: 'include_unloaded_segments',
- allowNoMatch: 'allow_no_match',
- allowNoDatafeeds: 'allow_no_datafeeds',
- allowNoJobs: 'allow_no_jobs',
- fullId: 'full_id',
- includeBootstrap: 'include_bootstrap',
- activeOnly: 'active_only',
- ignoreUnavailable: 'ignore_unavailable',
- parentTaskId: 'parent_task_id',
-};
-
-function CatApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * The CAT aliases operation lists the mapping of aliases to indices, plus routing and filtering information.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/ OpenSearch - CAT aliases}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.name] - To limit the information to specific aliases, provide the alias names seperated by commas.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. Default is 'open'.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/#response CAT aliases Response}
- */
-CatApi.prototype.aliases = function catAliasesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'aliases';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT allocation operation lists the allocation of disk space for indices and the number of shards on each node.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/ OpenSearch - CAT allocation}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.node_id] - To limit the information to specific nodes, provide the node names seperated by commas.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/#response CAT allocation Response}
- */
-CatApi.prototype.allocation = function catAllocationApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'allocation';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT count operation lists the number of documents in your cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-count/ OpenSearch - CAT count}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.index] - To see the number of documents in specific indices or aliases, provide the index/alias names seperated by commas.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-count/#response CAT count Response}
- */
-CatApi.prototype.count = function catCountApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'count';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT fielddata operation lists the memory size used by each field per node.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/ OpenSearch - CAT fielddata}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.fields] - To limit the information to specific fields, provide the field names seperated by commas.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/#response CAT fielddata Response}
- */
-CatApi.prototype.fielddata = function catFielddataApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, fields, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (fields != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'fielddata';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT health operation lists the status of the cluster, how long the cluster has been up, the number of nodes,
- * and other useful information that helps you analyze the health of your cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-health/ OpenSearch - CAT health}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- * @param {boolean} [params.ts=true] - If true, returns HH:MM:SS and Unix epoch timestamps.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-health/#response CAT health Response}
- */
-CatApi.prototype.health = function catHealthApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'health';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * See the available operations in the CAT API
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/index OpenSearch - CAT}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - (ignored)
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-CatApi.prototype.help = function catHelpApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT indices operation lists information related to indices—how much disk space they are using, how many shards they have, their health status, and so on.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ OpenSearch - CAT indices}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.index] - To limit the information to specific indices, provide the index names seperated by commas.
- * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'.
- * @param {string} [params.health] - Limit indices based on their health status. Supported values are 'green', 'yellow', and 'red'.
- * @param {boolean} [params.include_unloaded_segments=false] - Whether to include information from segments not loaded into memory.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {boolean} [params.pri=false] - Whether to return information only from the primary shards.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-indices/#response CAT indices Response}
- */
-CatApi.prototype.indices = function catIndicesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'indices';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT cluster manager operation lists information that helps identify the elected cluster manager node.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/ OpenSearch - CAT cluster manager}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters}
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/#response CAT cluster manager Response}
- */
-CatApi.prototype.cluster_manager = function catClusterManagerApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'cluster_manager';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * // TODO: delete CatApi.prototype.master when it is removed from OpenSearch
- * @deprecated use CatApi.prototype.cluster_manager instead
- */
-CatApi.prototype.master = function catMasterApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'master';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT nodeattrs operation lists the attributes of custom nodes.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/ OpenSearch - CAT aliases}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/#response CAT nodeattrs Response}
- */
-CatApi.prototype.nodeattrs = function catNodeattrsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'nodeattrs';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT nodes operation lists node-level information, including node roles and load metrics.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodes/ OpenSearch - CAT nodes}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'.
- * @param {boolean} [params.full_id=false] - If true, return the full node ID. If false, return the shortened node ID.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- * @param {boolean} [params.include_unloaded_segments=false] - Whether to include information from segments not loaded into memory.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodes/#response CAT nodes Response}
- */
-CatApi.prototype.nodes = function catNodesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'nodes';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT pending tasks operation lists the progress of all pending tasks, including task priority and time in queue.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/ OpenSearch - CAT pending tasks}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/#response CAT pending tasks Response}
- */
-CatApi.prototype.pendingTasks = function catPendingTasksApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'pending_tasks';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT plugins operation lists the names, components, and versions of the installed plugins.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ OpenSearch - CAT plugins}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/#response CAT plugins Response}
- */
-CatApi.prototype.plugins = function catPluginsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'plugins';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT recovery operation lists all completed and ongoing index and shard recoveries.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-recovery/ OpenSearch - CAT recovery}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- * @param {boolean} [params.active_only=false] - Whether to only include ongoing shard recoveries.
- * @param {boolean} [params.detailed=false] - Whether to only include ongoing shard recoveries.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-recovery/#response CAT recovery Response}
- */
-CatApi.prototype.recovery = function catRecoveryApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'recovery';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT repositories operation lists all completed and ongoing index and shard recoveries.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/ OpenSearch - CAT repositories}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/#response CAT repositories Response}
- */
-CatApi.prototype.repositories = function catRepositoriesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'repositories';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The cat segments operation lists Lucene segment-level information for each index.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ OpenSearch - CAT segments}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.index] - To see only the information about segments of specific indices, provide the index names seperated by commas.
- * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-segments/#response CAT segments Response}
- */
-CatApi.prototype.segments = function catSegmentsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'segments';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT shards operation lists the state of all primary and replica shards and how they are distributed.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ OpenSearch - CAT shards}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.index] - To see only the information about shards of specific indices, provide the index names seperated by commas.
- * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-shards/#response CAT shards Response}
- */
-CatApi.prototype.shards = function catShardsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'shards';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT snapshots operation lists all snapshots for a repository.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ OpenSearch - CAT snapshots}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/#response CAT snapshots Response}
- */
-CatApi.prototype.snapshots = function catSnapshotsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, repository, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (repository != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'snapshots';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT tasks operation lists the progress of all tasks currently running on your cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ OpenSearch - CAT tasks}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {string} [params.nodes] - A comma-separated list of node IDs or names to limit the returned information. Use '_local' to return information from the node you’re connecting to, specify the node name to get information from specific nodes, or keep the parameter empty to get information from all nodes.
- * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'.
- * @param {boolean} [params.detailed=false] - Returns detailed task information.
- * @param {string} [params.parent_task_id] - Returns tasks with a specified parent task ID (node_id:task_number). Keep empty or set to -1 to return all.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/#response CAT tasks Response}
- */
-CatApi.prototype.tasks = function catTasksApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'tasks';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT templates operation lists the names, patterns, order numbers, and version numbers of index templates.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ OpenSearch - CAT templates}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {boolean} [params.name] - If you want to limit it to a specific template or pattern, provide the template name or pattern.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-templates/#response CAT templates Response}
- */
-CatApi.prototype.templates = function catTemplatesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'templates';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT thread pool operation lists the active, queued, and rejected threads of different thread pools on each node.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/ OpenSearch - CAT thread pool}
- *
- * @memberOf API-CAT
- *
- * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters:
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/#response CAT thread pool Response}
- */
-CatApi.prototype.threadPool = function catThreadPoolApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((thread_pool_patterns || threadPoolPatterns) != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_cat' +
- '/' +
- 'thread_pool' +
- '/' +
- encodeURIComponent(thread_pool_patterns || threadPoolPatterns);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cat' + '/' + 'thread_pool';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(CatApi.prototype, {
- pending_tasks: {
- get() {
- return this.pendingTasks;
- },
- },
- thread_pool: {
- get() {
- return this.threadPool;
- },
- },
-});
-
-module.exports = CatApi;
diff --git a/api/api/clear_scroll.js b/api/api/clear_scroll.js
deleted file mode 100644
index 07128d4d0..000000000
--- a/api/api/clear_scroll.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Close the search context when you’re done scrolling, because the scroll operation continues to consume computing resources until the timeout.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll }
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} [params.scroll_id] The ID of the scroll to be terminated. Use `_all` to close all open scroll contexts.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function clearScrollApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, scrollId, scroll_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((scroll_id || scrollId) != null) {
- if (method == null) method = 'DELETE';
- path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId);
- } else {
- if (method == null) method = 'DELETE';
- path = '/' + '_search' + '/' + 'scroll';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = clearScrollApi;
diff --git a/api/api/cluster.js b/api/api/cluster.js
deleted file mode 100644
index 89379796f..000000000
--- a/api/api/cluster.js
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Cluster */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'include_yes_decisions',
- 'include_disk_info',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
- 'timeout',
- 'cluster_manager_timeout',
- 'master_timeout',
- 'wait_for_removal',
- 'local',
- 'flat_settings',
- 'include_defaults',
- 'expand_wildcards',
- 'level',
- 'wait_for_active_shards',
- 'wait_for_nodes',
- 'wait_for_events',
- 'wait_for_no_relocating_shards',
- 'wait_for_no_initializing_shards',
- 'wait_for_status',
- 'node_ids',
- 'node_names',
- 'create',
- 'dry_run',
- 'explain',
- 'retry_failed',
- 'metric',
- 'wait_for_metadata_version',
- 'wait_for_timeout',
- 'ignore_unavailable',
- 'allow_no_indices',
-];
-const snakeCase = {
- includeYesDecisions: 'include_yes_decisions',
- includeDiskInfo: 'include_disk_info',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- waitForRemoval: 'wait_for_removal',
- flatSettings: 'flat_settings',
- includeDefaults: 'include_defaults',
- expandWildcards: 'expand_wildcards',
- waitForActiveShards: 'wait_for_active_shards',
- waitForNodes: 'wait_for_nodes',
- waitForEvents: 'wait_for_events',
- waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
- waitForNoInitializingShards: 'wait_for_no_initializing_shards',
- waitForStatus: 'wait_for_status',
- nodeIds: 'node_ids',
- nodeNames: 'node_names',
- dryRun: 'dry_run',
- retryFailed: 'retry_failed',
- waitForMetadataVersion: 'wait_for_metadata_version',
- waitForTimeout: 'wait_for_timeout',
- ignoreUnavailable: 'ignore_unavailable',
- allowNoIndices: 'allow_no_indices',
-};
-
-function ClusterApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * The most basic cluster allocation explain request finds an unassigned shard and explains why it can’t be allocated to a node. If you add some options, you can instead get information on a specific shard, including why OpenSearch assigned it to its current node.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-allocation/ OpenSearch - Cluster allocation explain}
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {boolean} [params.include_yes_decisions=false] - OpenSearch makes a series of yes or no decisions when trying to allocate a shard to a node. If this parameter is true, OpenSearch includes the (generally more numerous) “yes” decisions in its response.
- * @param {boolean} [params.include_disk_info=false] - Whether to include information about disk usage in the response.
- * @param {Object} [params.body]
- * @param {string} [params.body.current_node] - If you only want an explanation if the shard happens to be on a particular node, specify that node name here.
- * @param {string} [params.body.index] - The name of the shard’s index.
- * @param {boolean} [params.body.primary] - Whether to provide an explanation for the primary shard (true) or its first replica (false), which share the same shard ID.
- * @param {number} [params.body.shard] - The shard ID that you want an explanation for.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cluster-allocation/#response Cluster allocation explain Response}
- */
-ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Delete Component Template(s)
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {string} [params.name] The name of the component template to be deleted.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_component_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Clears cluster voting config exclusions.
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {boolean} [params.wait_for_removal] Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_cluster' + '/' + 'voting_config_exclusions';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Information about whether a particular component template exist
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {boolean} [params.name] Name of the template
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'HEAD';
- path = '/' + '_component_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns one or more component templates
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {string | string[]} [params.name] Name(s) of the template(s)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_component_template' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_component_template';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Get Cluster Settings
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-settings/ OpenSearch - Cluster Settings}
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * ç
- * @param {boolean} [params.include_defaults] Whether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.getSettings = function clusterGetSettingsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'settings';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The most basic cluster health request returns a simple status of the health of your cluster. OpenSearch expresses cluster health in three colors: green, yellow, and red. A green status means all primary shards and their replicas are allocated to nodes. A yellow status means all primary shards are allocated to nodes, but some replicas aren’t. A red status means at least one primary shard is not allocated to any node.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-health/ OpenSearch - Cluster Health}
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {} [params.index] - To get the status of a specific index, provide the index name.
- * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'.
- * @param {string} [params.level=cluster] - The level of detail for returned health information. Supported values are 'cluster', 'indices', and 'shards'.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.timeout=30s] - The amount of time to wait for a response from the cluster.
- * @param {string} [params.wait_for_active_shards=0] - Wait until the specified number of shards is active before returning a response. 'all' for all shards
- * @param {string} [params.wait_for_nodes] - Wait for N number of nodes. Use 12 for exact match, >12 and <12 for range.
- * @param {string} [params.wait_for_events] - Wait until all currently queued events with the given priority are processed. Supported values are 'immediate', 'urgent', 'high', 'normal', 'low', and 'languid'.
- * @param {boolean} [params.wait_for_no_relocating_shards=false] - Whether to wait until there are no relocating shards in the cluster.
- * @param {boolean} [params.wait_for_no_initializing_shards=false] - Whether to wait until there are no initializing shards in the cluster.
- * @param {string} [params.wait_for_status] - Wait until the cluster health reaches the specified status or better. Supported values are 'green', 'yellow', and 'red'.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cluster-health/#response Cluster Health Response}
- */
-ClusterApi.prototype.health = function clusterHealthApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'health';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Get a list of any cluster-level changes
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'pending_tasks';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Updates the cluster voting config exclusions by node ids or node names.
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {string} [params.node_names] - A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify node_names.
- * @param {string} [params.node_ids] - A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify node_ids.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_cluster' + '/' + 'voting_config_exclusions';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Creates or updates a component template
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {string} params.name - The name of the component template.
- * @param {object} params.body - The template definition.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {boolean} [params.create=false] - Whether the index template should only be added if new or can also replace an existing one.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + '_component_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Updates the cluster settings.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-settings/ OpenSearch - Cluster Settings}
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {boolean} [params.flat_settings] Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {string} [params.timeout=30s] - The amount of time to wait for a response from the cluster.
- * @param {object} params.body - The settings to be updated. Can be either 'transient' or 'persistent' (survives cluster restart).
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.putSettings = function clusterPutSettingsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + '_cluster' + '/' + 'settings';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * This operation provides connection information for any remote OpenSearch clusters that you’ve configured for the local cluster, such as the remote cluster alias, connection mode (sniff or proxy), IP addresses for seed nodes, and timeout settings.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/remote-info/ OpenSearch - Remote cluster information}
- * @memberOf API-Cluster
- *
- * @param {Object} params - (Unused)
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/remote-info/#response Remote cluster information }
- */
-ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_remote' + '/' + 'info';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Allows to manually change the allocation of individual shards in the cluster.
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {object} [params.body] - The definition of 'commands' to perform ('move', 'cancel', 'allocate')
- * @param {boolean} [params.dry_run] - Simulate the operation only and return the resulting state
- * @param {boolean} [params.explain] - Return an explanation of why the commands can or cannot be executed
- * @param {boolean} [params.retry_failed] - Retries allocation of shards that are blocked due to too many subsequent allocation failures
- * @param {string | string[]} [params.metric] - Limit the information returned to the specified metrics. Defaults to all but metadata (options: _all, blocks, metadata, nodes, routing_table, cluster_manager_node, version)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.reroute = function clusterRerouteApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_cluster' + '/' + 'reroute';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Get comprehensive information about the state of the cluster.
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {string | string[]} [params.metric] - Limit the information returned to the specified metrics. Defaults to all but metadata (options: _all, blocks, metadata, nodes, routing_table, cluster_manager_node, version).
- * @param {string | string[]} [params.index] - List of index names; use '_all' or empty string to perform the operation on all indices.
- * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node.
- * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node.
- * @param {boolean} [params.flat_settings=false] - Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings.
- * @param {number} [params.wait_for_metadata_version] - Wait for the metadata version to be equal or greater than the specified metadata version.
- * @param {string} [params.wait_for_timeout=30s] - The maximum time to wait for wait_for_metadata_version before timing out
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. Default is 'open'.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-ClusterApi.prototype.state = function clusterStateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required url components
- if (params.index != null && params.metric == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: metric');
- return handleError(err, callback);
- }
-
- let { method, body, metric, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (metric != null && index != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_cluster' +
- '/' +
- 'state' +
- '/' +
- encodeURIComponent(metric) +
- '/' +
- encodeURIComponent(index);
- } else if (metric != null) {
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'state';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * The CAT aliases operation lists the mapping of aliases to indices, plus routing and filtering information.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-stats/ OpenSearch - Cluster stats}
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params
- * @param {string | string[]} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use '_local' to return information from the node you're connecting to, leave empty to get information from all nodes.
- *
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cluster-stats/#response Cluster stats Response}
- */
-
-ClusterApi.prototype.stats = function clusterStatsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_cluster' +
- '/' +
- 'stats' +
- '/' +
- 'nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_cluster' + '/' + 'stats';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(ClusterApi.prototype, {
- allocation_explain: {
- get() {
- return this.allocationExplain;
- },
- },
- delete_component_template: {
- get() {
- return this.deleteComponentTemplate;
- },
- },
- delete_voting_config_exclusions: {
- get() {
- return this.deleteVotingConfigExclusions;
- },
- },
- exists_component_template: {
- get() {
- return this.existsComponentTemplate;
- },
- },
- get_component_template: {
- get() {
- return this.getComponentTemplate;
- },
- },
- get_settings: {
- get() {
- return this.getSettings;
- },
- },
- pending_tasks: {
- get() {
- return this.pendingTasks;
- },
- },
- post_voting_config_exclusions: {
- get() {
- return this.postVotingConfigExclusions;
- },
- },
- put_component_template: {
- get() {
- return this.putComponentTemplate;
- },
- },
- put_settings: {
- get() {
- return this.putSettings;
- },
- },
- remote_info: {
- get() {
- return this.remoteInfo;
- },
- },
-});
-
-module.exports = ClusterApi;
diff --git a/api/api/count.js b/api/api/count.js
deleted file mode 100644
index c436297b4..000000000
--- a/api/api/count.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Count */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'ignore_unavailable',
- 'ignore_throttled',
- 'allow_no_indices',
- 'expand_wildcards',
- 'min_score',
- 'preference',
- 'routing',
- 'q',
- 'analyzer',
- 'analyze_wildcard',
- 'default_operator',
- 'df',
- 'lenient',
- 'terminate_after',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- ignoreUnavailable: 'ignore_unavailable',
- ignoreThrottled: 'ignore_throttled',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- minScore: 'min_score',
- analyzeWildcard: 'analyze_wildcard',
- defaultOperator: 'default_operator',
- terminateAfter: 'terminate_after',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * The count API gives you quick access to the number of documents that match a query. You can also use it to check the document count of an index, data stream, or cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/count/ OpenSearch - Bulk}
- *
- * @memberOf API-Count
- *
- * @param {Object} params
- * @param {boolean} [params.allow_no_indices=false] - If false, the request returns an error if any wildcard expression or index alias targets any closed or missing indices.
- * @param {string} [params.analyzer] - The analyzer to use in the query string.
- * @param {boolean} [params.analyze_wildcard=false] - Specifies whether to analyze wildcard and prefix queries.
- * @param {string} [params.default_operator='OR'] - Indicates whether the default operator for a string query should be 'AND' or 'OR'.
- * @param {string} [params.df] - The default field in case a field prefix is not provided in the query string.
- * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'.
- * @param {boolean} [params.ignore_unavailable=false] - Specifies whether to include missing or closed indices in the response.
- * @param {boolean} [params.lenient=false] - Specifies whether OpenSearch should accept requests if queries have format errors (for example, querying a text field for an integer).
- * @param {number} [params.min_score] - Include only documents with a minimum '_score' value in the result.
- * @param {string} [params.routing] - Value used to route the operation to a specific shard.
- * @param {string} [params.preference] - Specifies which shard or node OpenSearch should perform the count operation on.
- * @param {number} [params.terminate_after] - The maximum number of documents OpenSearch should process before terminating the request.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/count/#response Count Response}
- */
-
-function countApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_count';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_count';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = countApi;
diff --git a/api/api/create.js b/api/api/create.js
deleted file mode 100644
index 32d234466..000000000
--- a/api/api/create.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'wait_for_active_shards',
- 'refresh',
- 'routing',
- 'timeout',
- 'version',
- 'version_type',
- 'pipeline',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- waitForActiveShards: 'wait_for_active_shards',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Adds a document with a predefined ID to an index.
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/ OpenSearch - Index Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - A unique identifier to attach to the document.
- * @param {Object} params.body - The content of the document.
- * @param {number} [params.if_seq_no] - Only perform the index operation if the document has the specified sequence number.
- * @param {number} [params.if_primary_term] - Only perform the index operation if the document has the specified primary term.
- * @param {string} [params.pipeline] - Route the index operation to a certain pipeline.
- * @param {string} [params.routing] - value used to assign the index operation to a specific shard.
- * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed.
- * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/#response Index Response}
- */
-function createApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'PUT';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id) +
- '/' +
- '_create';
- } else {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = createApi;
diff --git a/api/api/create_pit.js b/api/api/create_pit.js
deleted file mode 100644
index 9665fc44b..000000000
--- a/api/api/create_pit.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- *
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-PIT */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'allow_partial_pit_creation',
- 'keep_alive',
- 'preference',
- 'routing',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- allowPartialPitCreation: 'allow_partial_pit_creation',
- keepAlive: 'keep_alive',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Creates a point in time.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#create-a-pit|Opensearch - Create a PIT}
- * @memberOf API-PIT
- *
- * @param {Object} params
- * @param {string} params.index - The name(s) of the target index(es) for the PIT. May contain a comma-separated list or a wildcard index pattern.
- * @param {string} params.keep_alive - The amount of time to keep the PIT
- * @param {string} [params.preference=random] - The node or the shard used to perform the search.
- * @param {string} [params.routing] - Specifies to route search requests to a specific shard.
- * @param {string} [params.expand_wildcards=open] - The type of index that can match the wildcard pattern. Supports comma-separated values.
- * @param {string} [params.allow_partial_pit_creation=false] - Specifies whether to create a PIT with partial failures.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response|Create PIT Response}
- */
-
-function createPitApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params['index'] == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- if (params['keep_alive'] == null) {
- const err = new this[kConfigurationError]('Missing required parameter: keep_alive');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'point_in_time';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = createPitApi;
diff --git a/api/api/dangling_indices.js b/api/api/dangling_indices.js
deleted file mode 100644
index 4647a8400..000000000
--- a/api/api/dangling_indices.js
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Dangling-Indices */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'accept_data_loss',
- 'timeout',
- 'cluster_manager_timeout',
- 'master_timeout',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- acceptDataLoss: 'accept_data_loss',
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-function DanglingIndicesApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * Deletes the specified dangling index
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ OpenSearch - Dangling Indexes}
- * @memberOf API-Dangling-Indices
- *
- * @param {Object} params
- * @param {string} params.index_uuid - The UUID of the dangling index
- * @param {boolean} [params.accept_data_loss] - Must be set to true in order to delete the dangling index
- * @param {string} [params.timeout=30s] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDeleteDanglingIndexApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index_uuid == null && params.indexUuid == null) {
- const err = new this[kConfigurationError](
- 'Missing required parameter: index_uuid or indexUuid'
- );
- return handleError(err, callback);
- }
-
- let { method, body, indexUuid, index_uuid, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Imports the specified dangling index
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ OpenSearch - Dangling Indexes}
- * @memberOf API-Dangling-Indices
- *
- * @param {Object} params
- * @param {string} params.index_uuid - The UUID of the dangling index
- * @param {boolean} [params.accept_data_loss] - Must be set to true in order to delete the dangling index
- * @param {string} [params.timeout=30s] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImportDanglingIndexApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index_uuid == null && params.indexUuid == null) {
- const err = new this[kConfigurationError](
- 'Missing required parameter: index_uuid or indexUuid'
- );
- return handleError(err, callback);
- }
-
- let { method, body, indexUuid, index_uuid, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Retrieve all dangling indices.
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ OpenSearch - Dangling Indexes}
- * @memberOf API-Dangling-Indices
- *
- * @param {Object} params - (Unused)
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-DanglingIndicesApi.prototype.listDanglingIndices = function danglingIndicesListDanglingIndicesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_dangling';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(DanglingIndicesApi.prototype, {
- delete_dangling_index: {
- get() {
- return this.deleteDanglingIndex;
- },
- },
- import_dangling_index: {
- get() {
- return this.importDanglingIndex;
- },
- },
- list_dangling_indices: {
- get() {
- return this.listDanglingIndices;
- },
- },
-});
-
-module.exports = DanglingIndicesApi;
diff --git a/api/api/delete.js b/api/api/delete.js
deleted file mode 100644
index dbdfde11d..000000000
--- a/api/api/delete.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'wait_for_active_shards',
- 'refresh',
- 'routing',
- 'timeout',
- 'if_seq_no',
- 'if_primary_term',
- 'version',
- 'version_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- waitForActiveShards: 'wait_for_active_shards',
- ifSeqNo: 'if_seq_no',
- ifPrimaryTerm: 'if_primary_term',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Delete a document
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-document/ OpenSearch - Update Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - A unique identifier to attach to the document.
- * @param {number} [params.if_seq_no] - Only perform the delete operation if the document has the specified sequence number.
- * @param {number} [params.if_primary_term] - Only perform the delete operation if the document has the specified primary term.
- * @param {string} [params.routing] - Value used to assign the index operation to a specific shard.
- * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster.
- * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-document/#response Update Response}
- */
-function deleteApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'DELETE';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id);
- } else {
- if (method == null) method = 'DELETE';
- path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = deleteApi;
diff --git a/api/api/delete_all_pits.js b/api/api/delete_all_pits.js
deleted file mode 100644
index dcb582f48..000000000
--- a/api/api/delete_all_pits.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- *
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Deletes all PITs in the OpenSearch cluster. The Delete All PITs API deletes only local PITs or mixed PITs (PITs created in both local and remote clusters). It does not delete fully remote PITs.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#delete-pits|Opensearch - Delete PITs}
- * @memberOf API-PIT
- *
- * @param {Object} params
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response-2|Delete all PITs Response}
- */
-function deleteAllPitsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_search' + '/' + 'point_in_time' + '/' + '_all';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = deleteAllPitsApi;
diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js
deleted file mode 100644
index 17f46adc5..000000000
--- a/api/api/delete_by_query.js
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'analyzer',
- 'analyze_wildcard',
- 'default_operator',
- 'df',
- 'from',
- 'ignore_unavailable',
- 'allow_no_indices',
- 'conflicts',
- 'expand_wildcards',
- 'lenient',
- 'preference',
- 'q',
- 'routing',
- 'scroll',
- 'search_type',
- 'search_timeout',
- 'size',
- 'max_docs',
- 'sort',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'terminate_after',
- 'stats',
- 'version',
- 'request_cache',
- 'refresh',
- 'timeout',
- 'wait_for_active_shards',
- 'scroll_size',
- 'wait_for_completion',
- 'requests_per_second',
- 'slices',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- analyzeWildcard: 'analyze_wildcard',
- defaultOperator: 'default_operator',
- ignoreUnavailable: 'ignore_unavailable',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- searchType: 'search_type',
- searchTimeout: 'search_timeout',
- maxDocs: 'max_docs',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- terminateAfter: 'terminate_after',
- requestCache: 'request_cache',
- waitForActiveShards: 'wait_for_active_shards',
- scrollSize: 'scroll_size',
- waitForCompletion: 'wait_for_completion',
- requestsPerSecond: 'requests_per_second',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Deletes documents matching the provided query.
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/delete-by-query/ OpenSearch - Delete by query}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names to search; use '_all' or empty string to perform the operation on all indices
- * @param {Object} params.body - The search definition using the Query DSL
- * @param {string} [params.analyzer] - The analyzer to use for the query string
- * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed
- * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR)
- * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
- * @param {number} [params.from=0] - Starting offset
- * @param {boolean} [params.ignore_unavailable=false] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices=true] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes '_all' string or when no indices have been specified)
- * @param {string} [params.conflicts] - What to do when the delete-by-query hits version conflicts? (options: abort, proceed)
- * @param {string} [params.expand_wildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.lenient=false] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
- * @param {string} [params.q] - Query in the Lucene query string syntax
- * @param {string} [params.routing] - A comma-separated list of specific routing values
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
- * @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout.
- * @param {number} [params.size] - Deprecated, please use 'max_docs' instead
- * @param {number} [params.max_docs] - Maximum number of documents to process (default: all documents)
- * @param {string} [params.sort] - A comma-separated list of : pairs
- * @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_excludes] - A list of fields to exclude from the returned _source field
- * @param {string} [params._source_includes] - A list of fields to extract and return from the _source field
- * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
- * @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes
- * @param {boolean} [params.version] - Specify whether to return document version as part of a hit
- * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting
- * @param {boolean} [params.refresh=false] - Should the effected indexes be refreshed?
- * @param {string} [params.timeout=1m] - time each individual bulk request should wait for shards that are unavailable.
- * @param {string} [params.wait_for_active_shards=1] - Sets the number of shard copies that must be active before proceeding with the delete-by-query operation. 1 means the primary shard only. Set to 'all' for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
- * @param {number} [params.scroll_size=1000] - Size on the scroll request powering the delete-by-query
- * @param {boolean} [params.wait_for_completion] - Should the request should block until the delete-by-query is complete.
- * @param {number} [params.requests_per_second=-1] - The throttle for this request in sub-requests per second. -1 means no throttle.
- * @param {string} [params.slices=1] - The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to 'auto'.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/delete-by-query/#response Delete by query Response}
- */
-function deleteByQueryApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = 'POST';
- path =
- '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query';
- } else {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = deleteByQueryApi;
diff --git a/api/api/delete_by_query_rethrottle.js b/api/api/delete_by_query_rethrottle.js
deleted file mode 100644
index 654f8b526..000000000
--- a/api/api/delete_by_query_rethrottle.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'requests_per_second',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- requestsPerSecond: 'requests_per_second',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Changes the number of requests per second for a particular Delete By Query operation.
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.task_id - The task id to rethrottle
- * @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function deleteByQueryRethrottleApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.task_id == null && params.taskId == null) {
- const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId');
- return handleError(err, callback);
- }
- if (params.requests_per_second == null && params.requestsPerSecond == null) {
- const err = new this[kConfigurationError](
- 'Missing required parameter: requests_per_second or requestsPerSecond'
- );
- return handleError(err, callback);
- }
-
- let { method, body, taskId, task_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path =
- '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = deleteByQueryRethrottleApi;
diff --git a/api/api/delete_pit.js b/api/api/delete_pit.js
deleted file mode 100644
index 52e3e8ff1..000000000
--- a/api/api/delete_pit.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- *
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Deletes one or several PITs. PITs are automatically deleted when the keep_alive time period elapses. However, to deallocate resources, you can delete a PIT using the Delete PIT API.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#delete-pits|Opensearch - Delete PITs}
- * @memberOf API-PIT
- *
- * @param {Object} params
- * @param {Object} params.body
- * @param {string[]} params.body.pit_id - The PIT IDs of the PITs to be deleted.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response-2|Delete PIT Response}
- */
-function deletePitApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params['body'] == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_search' + '/' + 'point_in_time';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = deletePitApi;
diff --git a/api/api/delete_script.js b/api/api/delete_script.js
deleted file mode 100644
index ac0c89314..000000000
--- a/api/api/delete_script.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'timeout',
- 'cluster_manager_timeout',
- 'master_timeout',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Delete a stored script.
- * @memberOf API-Script
- *
- * @param {Object} params
- * @param {string} params.id - Stored script or search template name
- * @param {string} [params.timeout=30s] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function deleteScriptApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_scripts' + '/' + encodeURIComponent(id);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = deleteScriptApi;
diff --git a/api/api/exists.js b/api/api/exists.js
deleted file mode 100644
index 224ad591f..000000000
--- a/api/api/exists.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'stored_fields',
- 'preference',
- 'realtime',
- 'refresh',
- 'routing',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'version',
- 'version_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- storedFields: 'stored_fields',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Check whether a document exists
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - Document ID.
- * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
- * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
- * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.routing] - A value used to route the operation to a specific shard.
- * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
- * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
- * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
- * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response}
- */
-function existsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'HEAD';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id);
- } else {
- if (method == null) method = 'HEAD';
- path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = existsApi;
diff --git a/api/api/exists_source.js b/api/api/exists_source.js
deleted file mode 100644
index 41999e7be..000000000
--- a/api/api/exists_source.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/**
- * Check whether a document source exists
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - Document ID.
- * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
- * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
- * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.routing] - A value used to route the operation to a specific shard.
- * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
- * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
- * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
- * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response}
- */
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'preference',
- 'realtime',
- 'refresh',
- 'routing',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'version',
- 'version_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-function existsSourceApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.id != null && (params.type == null || params.index == null)) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: type, index');
- return handleError(err, callback);
- } else if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'HEAD';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id) +
- '/' +
- '_source';
- } else {
- if (method == null) method = 'HEAD';
- path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = existsSourceApi;
diff --git a/api/api/explain.js b/api/api/explain.js
deleted file mode 100644
index 656b8fb41..000000000
--- a/api/api/explain.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'analyze_wildcard',
- 'analyzer',
- 'default_operator',
- 'df',
- 'stored_fields',
- 'lenient',
- 'preference',
- 'q',
- 'routing',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- analyzeWildcard: 'analyze_wildcard',
- defaultOperator: 'default_operator',
- storedFields: 'stored_fields',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Returns information about why a specific matches (or doesn't match) a query.
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/explain/ OpenSearch - Explain}
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} [params.id] - The document ID
- * @param {string} [params.index] - The name of the index
- * @param {Object} [params.body] - The query definition using the Query DSL
- * @param {string} [params.analyzer] - The analyzer to use for the query string
- * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed
- * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR)
- * @param {string} [params.df] - The default field for query string query (default: _all)
- * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return in the response
- * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
- * @param {string} [params.q] - Query in the Lucene query string syntax
- * @param {string} [params.routing] - Specific routing value
- * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
- * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
- * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function explainApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id) +
- '/' +
- '_explain';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = explainApi;
diff --git a/api/api/features.js b/api/api/features.js
deleted file mode 100644
index 155ea1eb3..000000000
--- a/api/api/features.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Features */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'cluster_manager_timeout',
- 'master_timeout',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-function FeaturesApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * Gets a list of features
- * @memberOf API-Features
- *
- * @param {Object} params
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_features';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Resets the internal state of features, usually by deleting system indices
- * @memberOf API-Features
- *
- * @param {Object} params - (Unused)
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-FeaturesApi.prototype.resetFeatures = function featuresResetFeaturesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_features' + '/' + '_reset';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(FeaturesApi.prototype, {
- get_features: {
- get() {
- return this.getFeatures;
- },
- },
- reset_features: {
- get() {
- return this.resetFeatures;
- },
- },
-});
-
-module.exports = FeaturesApi;
diff --git a/api/api/field_caps.js b/api/api/field_caps.js
deleted file mode 100644
index 5c6ff0137..000000000
--- a/api/api/field_caps.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'fields',
- 'ignore_unavailable',
- 'allow_no_indices',
- 'expand_wildcards',
- 'include_unmapped',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- ignoreUnavailable: 'ignore_unavailable',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- includeUnmapped: 'include_unmapped',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Returns the information about the capabilities of fields among multiple indices.
- *
See also: {@link https://opensearch.org/docs/latest/opensearch/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations OpenSearch - Alias}
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.fields] - A comma-separated list of field names
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.include_unmapped] - Indicates whether unmapped fields should be included in the response.
- * @param {Object} [params.body] - An index filter specified with the Query DSL
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function fieldCapsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_field_caps';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_field_caps';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = fieldCapsApi;
diff --git a/api/api/get.js b/api/api/get.js
deleted file mode 100644
index 20ff721f6..000000000
--- a/api/api/get.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'stored_fields',
- 'preference',
- 'realtime',
- 'refresh',
- 'routing',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'version',
- 'version_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- storedFields: 'stored_fields',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Retrieve a document
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - Document ID.
- * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
- * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
- * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.routing] - A value used to route the operation to a specific shard.
- * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
- * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
- * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
- * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response}
- */
-function getApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id);
- } else {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = getApi;
diff --git a/api/api/get_all_pits.js b/api/api/get_all_pits.js
deleted file mode 100644
index 4819c4c4a..000000000
--- a/api/api/get_all_pits.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- *
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Returns all PITs in the OpenSearch cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#list-all-pits|Opensearch - List all PITs}
- * @memberOf API-PIT
- *
- * @param {Object} params
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response-1|List all PITs Response}
- */
-function getAllPitsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_search' + '/' + 'point_in_time' + '/' + '_all';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = getAllPitsApi;
diff --git a/api/api/get_script.js b/api/api/get_script.js
deleted file mode 100644
index 454fa3564..000000000
--- a/api/api/get_script.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Script */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'cluster_manager_timeout',
- 'master_timeout',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Retrieves a stored script.
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-stored-script/ OpenSearch - Get Stored Script}
- * @memberOf API-Script
- *
- * @param {Object} params
- * @param {string} params.id - Stored script or search template name
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function getScriptApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_scripts' + '/' + encodeURIComponent(id);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = getScriptApi;
diff --git a/api/api/get_script_context.js b/api/api/get_script_context.js
deleted file mode 100644
index 6958aca28..000000000
--- a/api/api/get_script_context.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Retrieves all contexts for stored scripts.
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-contexts/ OpenSearch - Get stored script contexts}
- * @memberOf API-Script
- *
- * @param {Object} params - (Unused)
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function getScriptContextApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_script_context';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = getScriptContextApi;
diff --git a/api/api/get_script_languages.js b/api/api/get_script_languages.js
deleted file mode 100644
index 923c6dd52..000000000
--- a/api/api/get_script_languages.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * The get script language API operation retrieves all supported script languages and their contexts.
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-language/ OpenSearch - Get script language}
- * @memberOf API-Script
- *
- * @param {Object} params - (Unused)
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function getScriptLanguagesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_script_language';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = getScriptLanguagesApi;
diff --git a/api/api/get_source.js b/api/api/get_source.js
deleted file mode 100644
index 2084b1f26..000000000
--- a/api/api/get_source.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'preference',
- 'realtime',
- 'refresh',
- 'routing',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'version',
- 'version_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Retrieve the source of a document
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - Document ID.
- * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
- * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
- * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.routing] - A value used to route the operation to a specific shard.
- * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
- * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
- * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
- * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response}
- */
-function getSourceApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id) +
- '/' +
- '_source';
- } else {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = getSourceApi;
diff --git a/api/api/http.js b/api/api/http.js
deleted file mode 100644
index 4ed677761..000000000
--- a/api/api/http.js
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * 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.
- *
- */
-
-'use strict';
-
-/** @namespace API-HTTP */
-
-const { normalizeArguments, kConfigurationError } = require('../utils');
-
-function HttpApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-HttpApi.prototype.request = function (method, params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
- if (Array.isArray(params.body)) {
- const { path, querystring, headers, body } = params;
- params = { path, querystring, headers, bulkBody: body };
- }
- options = options || {};
- options.headers = params.headers || options.headers;
- return this.transport.request({ ...params, method }, options, callback);
-};
-
-/**
- * Make a customized CONNECT request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.connect = function (params, options, callback) {
- return this.request('CONNECT', params, options, callback);
-};
-
-/**
- * Make a customized DELETE request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.delete = function (params, options, callback) {
- return this.request('DELETE', params, options, callback);
-};
-
-/**
- * Make a customized GET request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.get = function (params, options, callback) {
- return this.request('GET', params, options, callback);
-};
-
-/**
- * Make a customized HEAD request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.head = function (params, options, callback) {
- return this.request('HEAD', params, options, callback);
-};
-
-/**
- * Make a customized OPTIONS request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.options = function (params, options, callback) {
- return this.request('OPTIONS', params, options, callback);
-};
-
-/**
- * Make a customized PATCH request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.patch = function (params, options, callback) {
- return this.request('PATCH', params, options, callback);
-};
-
-/**
- * Make a customized POST request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.post = function (params, options, callback) {
- return this.request('POST', params, options, callback);
-};
-
-/**
- * Make a customized PUT request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.put = function (params, options, callback) {
- return this.request('PUT', params, options, callback);
-};
-
-/**
- * Make a customized TRACE request.
- *
- * @memberOf API-HTTP
- *
- * @param {Object} params
- * @param {Object} params.path - The URL of the request
- * @param {Object} [params.querystring] - The querystring parameters
- * @param {Object} [params.headers] - The request headers
- * @param {Object} [params.body] - The request body
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-HttpApi.prototype.trace = function (params, options, callback) {
- return this.request('TRACE', params, options, callback);
-};
-
-module.exports = HttpApi;
diff --git a/api/api/index.js b/api/api/index.js
deleted file mode 100644
index 03bcab2b7..000000000
--- a/api/api/index.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Document */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'wait_for_active_shards',
- 'op_type',
- 'refresh',
- 'routing',
- 'timeout',
- 'version',
- 'version_type',
- 'if_seq_no',
- 'if_primary_term',
- 'pipeline',
- 'require_alias',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- waitForActiveShards: 'wait_for_active_shards',
- opType: 'op_type',
- versionType: 'version_type',
- ifSeqNo: 'if_seq_no',
- ifPrimaryTerm: 'if_primary_term',
- requireAlias: 'require_alias',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Adds a document to an index.
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/ OpenSearch - Index Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {Object} params.body - The content of the document.
- * @param {string} [params.id] - A unique identifier to attach to the document.
- * @param {number} [params.if_seq_no] - Only perform the index operation if the document has the specified sequence number.
- * @param {number} [params.if_primary_term] - Only perform the index operation if the document has the specified primary term.
- * @param {string} [params.pipeline] - Route the index operation to a certain pipeline.
- * @param {string} [params.routing] - value used to assign the index operation to a specific shard.
- * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster.
- * @param {number} [params.version] - The document’s version number.
- * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
- * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed.
- * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/#response Index Response}
- */
-
-function indexApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, id, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && id != null) {
- if (method == null) method = 'PUT';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- encodeURIComponent(id);
- } else if (index != null && id != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id);
- } else if (index != null && type != null) {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type);
- } else {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_doc';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = indexApi;
diff --git a/api/api/indices.js b/api/api/indices.js
deleted file mode 100644
index eff491db9..000000000
--- a/api/api/indices.js
+++ /dev/null
@@ -1,2541 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/** @namespace API-Index */
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'cluster_manager_timeout',
- 'timeout',
- 'master_timeout',
- 'ignore_unavailable',
- 'allow_no_indices',
- 'expand_wildcards',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
- 'index',
- 'fielddata',
- 'fields',
- 'query',
- 'request',
- 'wait_for_active_shards',
- 'run_expensive_tasks',
- 'flush',
- 'local',
- 'flat_settings',
- 'include_defaults',
- 'force',
- 'wait_if_ongoing',
- 'max_num_segments',
- 'only_expunge_deletes',
- 'create',
- 'cause',
- 'write_index_only',
- 'preserve_existing',
- 'order',
- 'detailed',
- 'active_only',
- 'dry_run',
- 'verbose',
- 'status',
- 'copy_settings',
- 'completion_fields',
- 'fielddata_fields',
- 'groups',
- 'level',
- 'types',
- 'include_segment_file_sizes',
- 'include_unloaded_segments',
- 'forbid_closed_indices',
- 'wait_for_completion',
- 'only_ancient_segments',
- 'explain',
- 'q',
- 'analyzer',
- 'analyze_wildcard',
- 'default_operator',
- 'df',
- 'lenient',
- 'rewrite',
- 'all_shards',
-];
-const snakeCase = {
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- ignoreUnavailable: 'ignore_unavailable',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
- waitForActiveShards: 'wait_for_active_shards',
- runExpensiveTasks: 'run_expensive_tasks',
- flatSettings: 'flat_settings',
- includeDefaults: 'include_defaults',
- waitIfOngoing: 'wait_if_ongoing',
- maxNumSegments: 'max_num_segments',
- onlyExpungeDeletes: 'only_expunge_deletes',
- writeIndexOnly: 'write_index_only',
- preserveExisting: 'preserve_existing',
- activeOnly: 'active_only',
- dryRun: 'dry_run',
- copySettings: 'copy_settings',
- completionFields: 'completion_fields',
- fielddataFields: 'fielddata_fields',
- includeSegmentFileSizes: 'include_segment_file_sizes',
- includeUnloadedSegments: 'include_unloaded_segments',
- forbidClosedIndices: 'forbid_closed_indices',
- waitForCompletion: 'wait_for_completion',
- onlyAncientSegments: 'only_ancient_segments',
- analyzeWildcard: 'analyze_wildcard',
- defaultOperator: 'default_operator',
- allShards: 'all_shards',
-};
-
-function IndicesApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * Adds a block to an index.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma separated list of indices to add a block to
- * @param {string} params.block - The block to add (one of read, write, read_only or metadata)
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.addBlock = function indicesAddBlockApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.block == null) {
- const err = new this[kConfigurationError]('Missing required parameter: block');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.block != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, block, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Performs the analysis process on a text and return the tokens breakdown of the text.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ OpenSearch - Perform text analysis}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - The name of the index to scope the operation
- * @param {Object} [params.body] - Define analyzer/tokenizer parameters and the text on which the analysis should be performed
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.analyze = function indicesAnalyzeApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_analyze';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_analyze';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Clears all or specific caches for one or more indices.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ OpenSearch - Clear index or data stream cache}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index name to limit the operation
- * @param {boolean} [params.fielddata] - Clear field data
- * @param {string} [params.fields] - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
- * @param {boolean} [params.query] - Clear query caches
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.request] - Clear request cache
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.clearCache = function indicesClearCacheApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear';
- } else {
- if (method == null) method = 'POST';
- path = '/' + '_cache' + '/' + 'clear';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Clones an index
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/clone/ OpenSearch - Clone Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - The name of the source index to clone
- * @param {string} params.target - The name of the target index to clone into
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the cloned index before the operation returns.
- * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.clone = function indicesCloneApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.target == null) {
- const err = new this[kConfigurationError]('Missing required parameter: target');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.target != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, target, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Closes an index.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ OpenSearch - Close Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma separated list of indices to close
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {string} [params.wait_for_active_shards] - Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.close = function indicesCloseApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_close';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Creates an index
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ OpenSearch - Create Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {Object} [params.body] - The configuration for the index (`settings` and `mappings`)
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for before the operation returns.
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.create = function indicesCreateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Deletes an index.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ OpenSearch - Delete Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes
- * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.delete = function indicesDeleteApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + encodeURIComponent(index);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Deletes an alias.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices
- * @param {string} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.
- * @param {string} [params.timeout] - Explicit timestamp for the document
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.name != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && name != null) {
- if (method == null) method = 'DELETE';
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'DELETE';
- path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Deletes an index template.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The name of the template
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Deletes an index template (Deprecated. Use IndicesApi#deleteIndexTemplate instead)
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The name of the template
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-// TODO: Remove. Experimental feature added in ES 7.15
-IndicesApi.prototype.diskUsage = function indicesDiskUsageApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_disk_usage';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about whether a particular index exists.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/exists/ OpenSearch - Index Exists}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
- * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes
- * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
- * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.exists = function indicesExistsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'HEAD';
- path = '/' + encodeURIComponent(index);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about whether a particular alias exists.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - A comma-separated list of alias names to return
- * @param {string} [params.index] - A comma-separated list of index names to filter aliases
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.existsAlias = function indicesExistsAliasApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && name != null) {
- if (method == null) method = 'HEAD';
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'HEAD';
- path = '/' + '_alias' + '/' + encodeURIComponent(name);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about whether a particular index template exists.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The name of the template
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
- * @param {string} [params.cluster_manager_timeout] - Explicit 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 {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'HEAD';
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about whether a particular index template exists. (Deprecated. Use IndicesApi#existsIndexTemplate instead)
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The comma separated names of the index templates
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
- * @param {string} [params.cluster_manager_timeout] - Explicit 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 {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'HEAD';
- path = '/' + '_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-// TODO: Remove. Experimental feature added in ES 7.15
-IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Performs the flush operation on one or more indices.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string for all indices
- * @param {boolean} [params.force] - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
- * @param {boolean} [params.wait_if_ongoing=true] - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running.
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.flush = function indicesFlushApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_flush';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_flush';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Performs the force merge operation on one or more indices.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.flush=true] - Specify whether the index should be flushed after performing the operation
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {number} [params.max_num_segments] - The number of segments the index should be merged into (default: dynamic)
- * @param {boolean} [params.only_expunge_deletes] - Specify whether the operation should only expunge deleted documents
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.forcemerge = function indicesForcemergeApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_forcemerge';
- } else {
- if (method == null) method = 'POST';
- path = '/' + '_forcemerge';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about one or more indices.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ OpenSearch - Get Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
- * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes
- * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
- * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices.
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.get = function indicesGetApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns an alias.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.name] - A comma-separated list of alias names to return
- * @param {string} [params.index] - A comma-separated list of index names to filter aliases
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getAlias = function indicesGetAliasApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && name != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
- } else if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_alias' + '/' + encodeURIComponent(name);
- } else if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_alias';
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_alias';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns mapping for one or more fields.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/mappings/ OpenSearch - Mapping}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.fields - A comma-separated list of fields
- * @param {string} [params.index] - A comma-separated list of index names
- * @param {boolean} [params.include_defaults] - Whether the default mapping values should be returned as well
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.fields == null) {
- const err = new this[kConfigurationError]('Missing required parameter: fields');
- return handleError(err, callback);
- }
-
- let { method, body, fields, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null && fields != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- '_mapping' +
- '/' +
- encodeURIComponent(type) +
- '/' +
- 'field' +
- '/' +
- encodeURIComponent(fields);
- } else if (index != null && fields != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- '_mapping' +
- '/' +
- 'field' +
- '/' +
- encodeURIComponent(fields);
- } else if (type != null && fields != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_mapping' +
- '/' +
- encodeURIComponent(type) +
- '/' +
- 'field' +
- '/' +
- encodeURIComponent(fields);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns an index template.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.name] - The comma separated names of the index templates
- * @param {boolean} [params.flat_setting=false] - Return settings in flat format
- * @param {string} [params.cluster_manager_timeout] - Explicit 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 {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_index_template';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns mappings for one or more indices.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/mappings/ OpenSearch - Mapping}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node (Deprecated)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getMapping = function indicesGetMappingApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type);
- } else if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_mapping';
- } else if (type != null) {
- if (method == null) method = 'GET';
- path = '/' + '_mapping' + '/' + encodeURIComponent(type);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_mapping';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns settings for one or more indices.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ OpenSearch - Get Settings}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.name] - The name of the settings that should be included
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @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 {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getSettings = function indicesGetSettingsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && name != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name);
- } else if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_settings';
- } else if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_settings' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_settings';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns an index template. (Deprecated. Use IndicesApi#getIndexTemplate instead)
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.name] - The comma separated names of the index templates
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
- * @param {string} [params.cluster_manager_timeout] - Explicit 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 {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getTemplate = function indicesGetTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (name != null) {
- if (method == null) method = 'GET';
- path = '/' + '_template' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_template';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns a progress status of current upgrade.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_upgrade';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * ROpens an index.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ OpenSearch - Open Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma separated list of indices to open
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {string} [params.wait_for_active_shards] - Sets the number of active shards to wait for before the operation returns.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.open = function indicesOpenApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_open';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Creates or updates an alias.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices.
- * @param {string} params.name - The name of the alias to be created or updated
- * @param {string} [params.timeout] - Explicit timestamp for the document
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {Object} [params.body] - The settings for the alias, such as `routing` or `filter`
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.putAlias = function indicesPutAliasApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.name != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && name != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Creates or updates an index template.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The name of the template
- * @param {Object} params.body - The template definition
- * @param {boolean} [params.create] - Whether the index template should only be added if new or can also replace an existing one
- * @param {string} [params.cause] - User defined reason for creating/updating the index template
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + '_index_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Updates index mappings.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ OpenSearch - Create or Update Mapping}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @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 indices.
- * @param {Object} params.body - The mapping definition
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.write_index_only] - When true, applies mappings only to the write index of an alias or data stream
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.putMapping = function indicesPutMappingApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping';
- } else if (index != null && type != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type);
- } else if (index != null && type != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings';
- } else if (index != null && type != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type);
- } else if (index != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_mapping';
- } else if (type != null) {
- if (method == null) method = 'PUT';
- path = '/' + '_mappings' + '/' + encodeURIComponent(type);
- } else if (index != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_mappings';
- } else {
- if (method == null) method = 'PUT';
- path = '/' + '_mapping' + '/' + encodeURIComponent(type);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Updates the index settings.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ OpenSearch - Update Settings}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {Object} params.body - The index settings to be updated
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {boolean} [params.preserve_existing=false] - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.flat_settings=false] - Return settings in flat format
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.putSettings = function indicesPutSettingsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_settings';
- } else {
- if (method == null) method = 'PUT';
- path = '/' + '_settings';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Creates or updates an index template. (Deprecated. Use IndicesApi#putIndexTemplate instead)
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The name of the template
- * @param {Object} params.body - The template definition
- * @param {number} [params.order] - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
- * @param {boolean} [params.create] - Whether the index template should only be added if new or can also replace an existing one
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.putTemplate = function indicesPutTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + '_template' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about ongoing index shard recoveries.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.detailed] - Whether to display detailed information about shard recovery
- * @param {boolean} [params.active_only] - Display only those recoveries that are currently on-going
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.recovery = function indicesRecoveryApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_recovery';
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_recovery';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Performs the refresh operation in one or more indices.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.refresh = function indicesRefreshApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_refresh';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_refresh';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about any matching indices, aliases, and data streams
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.name] - A comma-separated list of names or wildcard expressions
- * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Updates an alias to point to a new index when the existing index is considered to be too large or too old.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream OpenSearch - Rollover a data stream}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.alias - The name of the alias to rollover
- * @param {string} [params.new_index] - The name of the rollover index
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {boolean} [params.dry_run=false] - If set to true the rollover action will only be validated but not actually performed even if a condition matches.
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the newly created rollover index before the operation returns.
- * @param {Object} [params.body] - The conditions that needs to be met for executing rollover
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.rollover = function indicesRolloverApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.alias == null) {
- const err = new this[kConfigurationError]('Missing required parameter: alias');
- return handleError(err, callback);
- }
-
- // check required url components
- if ((params.new_index != null || params.newIndex != null) && params.alias == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: alias');
- return handleError(err, callback);
- }
-
- let { method, body, alias, newIndex, new_index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (alias != null && (new_index || newIndex) != null) {
- if (method == null) method = 'POST';
- path =
- '/' +
- encodeURIComponent(alias) +
- '/' +
- '_rollover' +
- '/' +
- encodeURIComponent(new_index || newIndex);
- } else {
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(alias) + '/' + '_rollover';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Provides low-level information about segments in a Lucene index.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.verbose] - Includes detailed memory usage by Lucene.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.segments = function indicesSegmentsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_segments';
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_segments';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Provides store information for shard copies of indices.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.status] - A comma-separated list of statuses used to filter on shards to get store information for (options: green, yellow, red, all)
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.shardStores = function indicesShardStoresApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_shard_stores';
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_shard_stores';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Allow to shrink an existing index into a new index with fewer primary shards.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ OpenSearch - Shrink Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - The name of the source index to shrink
- * @param {string} params.target - The name of the target index to shrink into
- * @param {boolean} [params.copy_settings] - whether or not to copy settings from the source index (defaults to false)
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the shrunken index before the operation returns.
- * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.shrink = function indicesShrinkApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.target == null) {
- const err = new this[kConfigurationError]('Missing required parameter: target');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.target != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, target, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Simulate matching the given index name against the index templates in the system
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.name - The name of the index (it must be a concrete index name)
- * @param {Object} [params.body] - New index template definition, which will be included in the simulation, as if it already exists in the system
- * @param {boolean} [params.create] - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
- * @param {string} [params.cause] - User defined reason for dry-run creating the new template for simulation purposes
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: name');
- return handleError(err, callback);
- }
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Simulate resolving the given template name or body (Deprecated. Use IndicesApi#simulateIndexTemplate instead)
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.name] - The name of the index template
- * @param {boolean} [params.create] - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
- * @param {string} [params.cause] - User defined reason for dry-run creating the new template for simulation purposes
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {Object} [params.body] - New index template definition to be simulated, if no index template name is specified
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, name, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (name != null) {
- if (method == null) method = 'POST';
- path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name);
- } else {
- if (method == null) method = 'POST';
- path = '/' + '_index_template' + '/' + '_simulate';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Allows you to split an existing index into a new index with more primary shards.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/split/ OpenSearch - Split Index}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - The name of the source index to split
- * @param {string} params.target - The name of the target index to split into
- * @param {boolean} [params.copy_settings] - whether or not to copy settings from the source index (defaults to false)
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the shrunken index before the operation returns.
- * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.split = function indicesSplitApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter: index');
- return handleError(err, callback);
- }
- if (params.target == null) {
- const err = new this[kConfigurationError]('Missing required parameter: target');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.target != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, target, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Provides statistics on operations happening in an index.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.metric] - Limit the information returned the specific metrics. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest)
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
- * @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
- * @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
- * @param {string} [params.groups] - A comma-separated list of search groups for `search` index metric
- * @param {string} [params.level] - Return stats aggregated at cluster, index or shard level (options: cluster, indices, shards)
- * @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric
- * @param {boolean} [params.include_segment_file_sizes] - Whether to report 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] - If set to true segment stats will include stats for segments that are not currently loaded into memory
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.forbid_closed_indices] - If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.stats = function indicesStatsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, metric, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && metric != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric);
- } else if (metric != null) {
- if (method == null) method = 'GET';
- path = '/' + '_stats' + '/' + encodeURIComponent(metric);
- } else if (index != null) {
- if (method == null) method = 'GET';
- path = '/' + encodeURIComponent(index) + '/' + '_stats';
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_stats';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Update an alias.
- *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases}
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {Object} params.body - The definition of `actions` to perform
- * @param {string} [params.timeout] - Request timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_aliases';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Upgrades to the current version of Lucene.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.wait_for_completion=false] - Specify whether the request should block until the all segments are upgraded
- * @param {boolean} [params.only_ancient_segments] - If true, only ancient (an older Lucene major release) segments will be upgraded
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.upgrade = function indicesUpgradeApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_upgrade';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Allows a user to validate a potentially expensive query without executing it.
- *
- * @memberOf API-Index
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
- * @param {boolean} [params.explain] - Return detailed information about the error
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {string} [params.q] - Query in the Lucene query string syntax
- * @param {string} [params.analyzer] - The analyzer to use for the query string
- * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed
- * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR)
- * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
- * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
- * @param {boolean} [params.rewrite] - Provide a more detailed explanation showing the actual Lucene query that will be executed.
- * @param {boolean} [params.all_shards] - Execute validation on all shards instead of one random shard per index
- * @param {Object} [params.body] - The query definition specified with the Query DSL
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IndicesApi.prototype.validateQuery = function indicesValidateQueryApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- '_validate' +
- '/' +
- 'query';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_validate' + '/' + 'query';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(IndicesApi.prototype, {
- add_block: {
- get() {
- return this.addBlock;
- },
- },
- clear_cache: {
- get() {
- return this.clearCache;
- },
- },
- delete_alias: {
- get() {
- return this.deleteAlias;
- },
- },
- delete_index_template: {
- get() {
- return this.deleteIndexTemplate;
- },
- },
- delete_template: {
- get() {
- return this.deleteTemplate;
- },
- },
- disk_usage: {
- get() {
- return this.diskUsage;
- },
- },
- exists_alias: {
- get() {
- return this.existsAlias;
- },
- },
- exists_index_template: {
- get() {
- return this.existsIndexTemplate;
- },
- },
- exists_template: {
- get() {
- return this.existsTemplate;
- },
- },
- field_usage_stats: {
- get() {
- return this.fieldUsageStats;
- },
- },
- get_alias: {
- get() {
- return this.getAlias;
- },
- },
- get_field_mapping: {
- get() {
- return this.getFieldMapping;
- },
- },
- get_index_template: {
- get() {
- return this.getIndexTemplate;
- },
- },
- get_mapping: {
- get() {
- return this.getMapping;
- },
- },
- get_settings: {
- get() {
- return this.getSettings;
- },
- },
- get_template: {
- get() {
- return this.getTemplate;
- },
- },
- get_upgrade: {
- get() {
- return this.getUpgrade;
- },
- },
- put_alias: {
- get() {
- return this.putAlias;
- },
- },
- put_index_template: {
- get() {
- return this.putIndexTemplate;
- },
- },
- put_mapping: {
- get() {
- return this.putMapping;
- },
- },
- put_settings: {
- get() {
- return this.putSettings;
- },
- },
- put_template: {
- get() {
- return this.putTemplate;
- },
- },
- resolve_index: {
- get() {
- return this.resolveIndex;
- },
- },
- shard_stores: {
- get() {
- return this.shardStores;
- },
- },
- simulate_index_template: {
- get() {
- return this.simulateIndexTemplate;
- },
- },
- simulate_template: {
- get() {
- return this.simulateTemplate;
- },
- },
- update_aliases: {
- get() {
- return this.updateAliases;
- },
- },
- validate_query: {
- get() {
- return this.validateQuery;
- },
- },
-});
-
-module.exports = IndicesApi;
diff --git a/api/api/info.js b/api/api/info.js
deleted file mode 100644
index 1eec14383..000000000
--- a/api/api/info.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Returns basic information about the cluster.
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params - (Unused)
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function infoApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = infoApi;
diff --git a/api/api/ingest.js b/api/api/ingest.js
deleted file mode 100644
index 70c303c3b..000000000
--- a/api/api/ingest.js
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Ingest */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'cluster_manager_timeout',
- 'master_timeout',
- 'timeout',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
- 'summary',
- 'verbose',
-];
-const snakeCase = {
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-function IngestApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * Deletes a pipeline.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/ OpenSearch - Delete a pipeline}
- *
- * @memberOf API-Ingest
- *
- * @param {Object} params
- * @param {string} params.id - Pipeline ID
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
- * @param {string} [params.timeout] - Explicit operation timeout
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/#response Delete Pipeline Response}
- */
-IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns statistical information about geoip databases
- *
- * @memberOf API-Ingest
- *
- * @param {Object} params - (Unused)
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_ingest' + '/' + 'geoip' + '/' + 'stats';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns a pipeline.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/ OpenSearch - Get pipeline}
- *
- * @memberOf API-Ingest
- *
- * @param {Object} params
- * @param {string} [params.id] - Comma separated list of pipeline ids. Wildcards supported
- * @param {boolean} [params.summary=false] - Return pipelines without their definitions
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/#response Get Pipeline Response}
- */
-IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (id != null) {
- if (method == null) method = 'GET';
- path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_ingest' + '/' + 'pipeline';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns a list of the built-in patterns.
- *
- * @memberOf API-Ingest
- *
- * @param {Object} params - (Unused)
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Creates or updates a pipeline.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/ OpenSearch - Create/Update pipeline}
- *
- * @memberOf API-Ingest
- *
- * @param {Object} params
- * @param {string} params.id - Pipeline ID
- * @param {Object} params.body - Ingest definition
- * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
- * @param {string} [params.timeout] - Explicit operation timeout
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/#response Create/Update Pipeline Response}
- */
-IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'PUT';
- path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Allows to simulate a pipeline with example documents.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ OpenSearch - Simulate Pipeline}
- *
- * @memberOf API-Ingest
- *
- * @param {Object} params
- * @param {string} [params.id] - Pipeline ID
- * @param {boolean} [params.verbose] - Verbose mode. Display data output for each processor in executed pipeline
- * @param {Object} params.body - Simulate definition
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-IngestApi.prototype.simulate = function ingestSimulateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (id != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_ingest' + '/' + 'pipeline' + '/' + '_simulate';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(IngestApi.prototype, {
- delete_pipeline: {
- get() {
- return this.deletePipeline;
- },
- },
- geo_ip_stats: {
- get() {
- return this.geoIpStats;
- },
- },
- get_pipeline: {
- get() {
- return this.getPipeline;
- },
- },
- processor_grok: {
- get() {
- return this.processorGrok;
- },
- },
- put_pipeline: {
- get() {
- return this.putPipeline;
- },
- },
-});
-
-module.exports = IngestApi;
diff --git a/api/api/mget.js b/api/api/mget.js
deleted file mode 100644
index 344ffd655..000000000
--- a/api/api/mget.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'stored_fields',
- 'preference',
- 'realtime',
- 'refresh',
- 'routing',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- storedFields: 'stored_fields',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Retrieve multiple documents
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/ OpenSearch - Multi-get Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.index - Name of the index.
- * @param {string} params.id - Document ID.
- * @param {string} params.body - {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#request-body Multi-get Request Body}
- * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
- * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
- * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
- * @param {string} [params.routing] - A value used to route the operation to a specific shard.
- * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
- * @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
- * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
- * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#response Multi-get Response}
- */
-function mgetApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_mget';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_mget';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = mgetApi;
diff --git a/api/api/msearch.js b/api/api/msearch.js
deleted file mode 100644
index 06e3e4c75..000000000
--- a/api/api/msearch.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'search_type',
- 'max_concurrent_searches',
- 'typed_keys',
- 'pre_filter_shard_size',
- 'max_concurrent_shard_requests',
- 'rest_total_hits_as_int',
- 'ccs_minimize_roundtrips',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- searchType: 'search_type',
- maxConcurrentSearches: 'max_concurrent_searches',
- typedKeys: 'typed_keys',
- preFilterShardSize: 'pre_filter_shard_size',
- maxConcurrentShardRequests: 'max_concurrent_shard_requests',
- restTotalHitsAsInt: 'rest_total_hits_as_int',
- ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Allows to execute several search operations in one request.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/multi-search/ OpenSearch - Multi-Search}
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names to use as default
- * @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
- * @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute
- * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
- * @param {number} [params.pre_filter_shard_size] - 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 ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
- * @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests each sub search executes concurrently per node. 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.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
- * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/multi-search/#response Multi-search Response}
- */
-function msearchApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_msearch';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_msearch';
- }
-
- // build request object
- const request = {
- method,
- path,
- bulkBody: body,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = msearchApi;
diff --git a/api/api/msearch_template.js b/api/api/msearch_template.js
deleted file mode 100644
index 89313e660..000000000
--- a/api/api/msearch_template.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'search_type',
- 'typed_keys',
- 'max_concurrent_searches',
- 'rest_total_hits_as_int',
- 'ccs_minimize_roundtrips',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- searchType: 'search_type',
- typedKeys: 'typed_keys',
- maxConcurrentSearches: 'max_concurrent_searches',
- restTotalHitsAsInt: 'rest_total_hits_as_int',
- ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Allows to execute several search template operations in one request.
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names to use as default
- * @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
- * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
- * @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
- * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function msearchTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- '_msearch' +
- '/' +
- 'template';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_msearch' + '/' + 'template';
- }
-
- // build request object
- const request = {
- method,
- path,
- bulkBody: body,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = msearchTemplateApi;
diff --git a/api/api/mtermvectors.js b/api/api/mtermvectors.js
deleted file mode 100644
index 134b0c424..000000000
--- a/api/api/mtermvectors.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'ids',
- 'term_statistics',
- 'field_statistics',
- 'fields',
- 'offsets',
- 'positions',
- 'payloads',
- 'preference',
- 'routing',
- 'realtime',
- 'version',
- 'version_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- termStatistics: 'term_statistics',
- fieldStatistics: 'field_statistics',
- versionType: 'version_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-function mtermvectorsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_mtermvectors';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = mtermvectorsApi;
diff --git a/api/api/nodes.js b/api/api/nodes.js
deleted file mode 100644
index c6cb83a9c..000000000
--- a/api/api/nodes.js
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Nodes */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
- 'interval',
- 'snapshots',
- 'threads',
- 'ignore_idle_threads',
- 'type',
- 'timeout',
- 'flat_settings',
- 'completion_fields',
- 'fielddata_fields',
- 'fields',
- 'groups',
- 'level',
- 'types',
- 'include_segment_file_sizes',
- 'include_unloaded_segments',
-];
-const snakeCase = {
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
- ignoreIdleThreads: 'ignore_idle_threads',
- flatSettings: 'flat_settings',
- completionFields: 'completion_fields',
- fielddataFields: 'fielddata_fields',
- includeSegmentFileSizes: 'include_segment_file_sizes',
- includeUnloadedSegments: 'include_unloaded_segments',
-};
-
-function NodesApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-NodesApi.prototype.clearMeteringArchive = function nodesClearMeteringArchiveApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.node_id == null && params.nodeId == null) {
- const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId');
- return handleError(err, callback);
- }
- if (params.max_archive_version == null && params.maxArchiveVersion == null) {
- const err = new this[kConfigurationError](
- 'Missing required parameter: max_archive_version or maxArchiveVersion'
- );
- return handleError(err, callback);
- }
-
- // check required url components
- if (
- (params.max_archive_version != null || params.maxArchiveVersion != null) &&
- params.node_id == null &&
- params.nodeId == null
- ) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: node_id');
- return handleError(err, callback);
- }
-
- let { method, body, nodeId, node_id, maxArchiveVersion, max_archive_version, ...querystring } =
- params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'DELETE';
- path =
- '/' +
- '_nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- '_repositories_metering' +
- '/' +
- encodeURIComponent(max_archive_version || maxArchiveVersion);
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-NodesApi.prototype.getMeteringInfo = function nodesGetMeteringInfoApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.node_id == null && params.nodeId == null) {
- const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId');
- return handleError(err, callback);
- }
-
- let { method, body, nodeId, node_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'GET';
- path =
- '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about hot threads on each node in the cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ OpenSearch - Nodes Hot Threads}
- * @memberOf API-Nodes
- *
- * @param {Object} params
- * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
- * @param {string} [params.interval] - The interval for the second sampling of threads
- * @param {number} [params.snapshots] - Number of samples of thread stacktrace (default: 10)
- * @param {number} [params.threads] - Specify the number of threads to provide information for (default: 3)
- * @param {boolean} [params.ignore_idle_threads] - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)
- * @param {string} [params.type] - The type to sample (default: cpu) (options: cpu, wait, block)
- * @param {string} [params.timeout] - Explicit operation timeout
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads';
- } else if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_cluster' +
- '/' +
- 'nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- 'hotthreads';
- } else if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hotthreads';
- } else if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_cluster' +
- '/' +
- 'nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- 'hot_threads';
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + 'hot_threads';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns information about hot threads on each node in the cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ OpenSearch - Nodes Info}
- * @memberOf API-Nodes
- *
- * @param {Object} params
- * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
- * @param {string} [params.metric] - A comma-separated list of metrics you wish returned. Leave empty to return all. (options: settings, os, process, jvm, thread_pool, transport, http, plugins, ingest)
- * @param {boolean} [params.flat_settings] - Return settings in flat format (default: false)
- * @param {string} [params.timeout] - Explicit operation timeout
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-NodesApi.prototype.info = function nodesInfoApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, metric, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null && metric != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- encodeURIComponent(metric);
- } else if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId);
- } else if (metric != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + encodeURIComponent(metric);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_nodes';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Reloads secure settings.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/ OpenSearch - Nodes Reload Security Settings}
- * @memberOf API-Nodes
- *
- * @param {Object} params
- * @param {string} [params.node_id] - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {Object} [params.body] - An object containing the password for the opensearch keystore
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null) {
- if (method == null) method = 'POST';
- path =
- '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'reload_secure_settings';
- } else {
- if (method == null) method = 'POST';
- path = '/' + '_nodes' + '/' + 'reload_secure_settings';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns statistical information about nodes in the cluster.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-stats/ OpenSearch - Nodes Stats}
- * @memberOf API-Nodes
- *
- * @param {Object} params
- * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
- * @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, breaker, fs, http, indices, jvm, os, process, thread_pool, transport, discovery, indexing_pressure)
- * @param {string} [params.index_metric] - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest)
- * @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
- * @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
- * @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
- * @param {boolean} [params.groups] - A comma-separated list of search groups for `search` index metric
- * @param {string} [params.level] - Return indices stats aggregated at index, node or shard level (options: indices, node, shards)
- * @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {boolean} [params.include_segment_file_sizes] - Whether to report 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] - If set to true segment stats will include stats for segments that are not currently loaded into memory
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null && metric != null && (index_metric || indexMetric) != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- 'stats' +
- '/' +
- encodeURIComponent(metric) +
- '/' +
- encodeURIComponent(index_metric || indexMetric);
- } else if ((node_id || nodeId) != null && metric != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- 'stats' +
- '/' +
- encodeURIComponent(metric);
- } else if (metric != null && (index_metric || indexMetric) != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_nodes' +
- '/' +
- 'stats' +
- '/' +
- encodeURIComponent(metric) +
- '/' +
- encodeURIComponent(index_metric || indexMetric);
- } else if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats';
- } else if (metric != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + 'stats' + '/' + encodeURIComponent(metric);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + 'stats';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-/**
- * Returns low-level information about REST actions usage on nodes.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ OpenSearch - Nodes Usage}
- * @memberOf API-Nodes
- *
- * @param {Object} params
- * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
- * @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, rest_actions)
- * @param {string} [params.timeout] - Explicit operation timeout
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-NodesApi.prototype.usage = function nodesUsageApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, nodeId, node_id, metric, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((node_id || nodeId) != null && metric != null) {
- if (method == null) method = 'GET';
- path =
- '/' +
- '_nodes' +
- '/' +
- encodeURIComponent(node_id || nodeId) +
- '/' +
- 'usage' +
- '/' +
- encodeURIComponent(metric);
- } else if ((node_id || nodeId) != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage';
- } else if (metric != null) {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + 'usage' + '/' + encodeURIComponent(metric);
- } else {
- if (method == null) method = 'GET';
- path = '/' + '_nodes' + '/' + 'usage';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-};
-
-Object.defineProperties(NodesApi.prototype, {
- clear_metering_archive: {
- get() {
- return this.clearMeteringArchive;
- },
- },
- get_metering_info: {
- get() {
- return this.getMeteringInfo;
- },
- },
- hot_threads: {
- get() {
- return this.hotThreads;
- },
- },
- reload_secure_settings: {
- get() {
- return this.reloadSecureSettings;
- },
- },
-});
-
-module.exports = NodesApi;
diff --git a/api/api/ping.js b/api/api/ping.js
deleted file mode 100644
index 0c617f26c..000000000
--- a/api/api/ping.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Returns whether the cluster is running.
- *
- * @memberOf API-Cluster
- *
- * @param {Object} params - (Unused)
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function pingApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'HEAD';
- path = '/';
-
- // build request object
- const request = {
- method,
- path,
- body: null,
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = pingApi;
diff --git a/api/api/put_script.js b/api/api/put_script.js
deleted file mode 100644
index e2c8453fe..000000000
--- a/api/api/put_script.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'cluster_manager_timeout',
- 'timeout',
- 'master_timeout',
- 'context',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- clusterManagerTimeout: 'cluster_manager_timeout',
- masterTimeout: 'master_timeout',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Creates or updates a script.
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ OpenSearch - Create or update stored script}
- * @memberOf API-Script
- *
- * @param {Object} params
- * @param {string} params.id - Stored script or search template name
- * @param {string} params.body - The script
- * @param {string} [params.context] - Context in which the script or search template is to run. To prevent errors, the API immediately compiles the script or template in this context.
- * @param {string} [params.timeout=30s] - Explicit operation timeout
- * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function putScriptApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.context != null && params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, context, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (id != null && context != null) {
- if (method == null) method = 'PUT';
- path = '/' + '_scripts' + '/' + encodeURIComponent(id) + '/' + encodeURIComponent(context);
- } else {
- if (method == null) method = 'PUT';
- path = '/' + '_scripts' + '/' + encodeURIComponent(id);
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = putScriptApi;
diff --git a/api/api/rank_eval.js b/api/api/rank_eval.js
deleted file mode 100644
index 0648fcce9..000000000
--- a/api/api/rank_eval.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'ignore_unavailable',
- 'allow_no_indices',
- 'expand_wildcards',
- 'search_type',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- ignoreUnavailable: 'ignore_unavailable',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- searchType: 'search_type',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Allows to evaluate the quality of ranked search results over a set of typical search queries
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/rank-eval/ OpenSearch - Ranking evaluation}
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
- * @param {Object} params.body - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/rank-eval/#sample-response Ranking Evaluation Response}
- */
-function rankEvalApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_rank_eval';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_rank_eval';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = rankEvalApi;
diff --git a/api/api/reindex.js b/api/api/reindex.js
deleted file mode 100644
index ffbc66de5..000000000
--- a/api/api/reindex.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'refresh',
- 'timeout',
- 'wait_for_active_shards',
- 'wait_for_completion',
- 'requests_per_second',
- 'scroll',
- 'slices',
- 'max_docs',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- waitForActiveShards: 'wait_for_active_shards',
- waitForCompletion: 'wait_for_completion',
- requestsPerSecond: 'requests_per_second',
- maxDocs: 'max_docs',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Copy all or a subset of your data from a source index into a destination index.
- *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/ OpenSearch - Reindex Document}
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {Object} params.body The search definition using the Query DSL and the prototype for the index request.
- * @param {boolean} [params.refresh=false] Should the affected indexes be refreshed?
- * @param {string} [params.timeout=30s] Time each individual bulk request should wait for shards that are unavailable.
- * @param {string} [params.wait_for_active_shards] Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
- * @param {boolean} [params.wait_for_completion=false] Should the request should block until the reindex is complete.
- * @param {number} [params.requests_per_second=-1] The throttle to set on this request in sub-requests per second. -1 means no throttle.
- * @param {string} [params.scroll=5m] Control how long to keep the search context alive
- * @param {number|string} [params.slices=1] The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to `auto`.
- * @param {number} [params.max_docs] Maximum number of documents to process (default: all documents)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/#response Reindex Document Response}
- */
-function reindexApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_reindex';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = reindexApi;
diff --git a/api/api/reindex_rethrottle.js b/api/api/reindex_rethrottle.js
deleted file mode 100644
index dfab5d02c..000000000
--- a/api/api/reindex_rethrottle.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'requests_per_second',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- requestsPerSecond: 'requests_per_second',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Changes the number of requests per second for a particular Reindex operation.
- *
- * @memberOf API-Document
- *
- * @param {Object} params
- * @param {string} params.task_id - The task id to rethrottle
- * @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function reindexRethrottleApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.task_id == null && params.taskId == null) {
- const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId');
- return handleError(err, callback);
- }
- if (params.requests_per_second == null && params.requestsPerSecond == null) {
- const err = new this[kConfigurationError](
- 'Missing required parameter: requests_per_second or requestsPerSecond'
- );
- return handleError(err, callback);
- }
-
- let { method, body, taskId, task_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = 'POST';
- path = '/' + '_reindex' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = reindexRethrottleApi;
diff --git a/api/api/render_search_template.js b/api/api/render_search_template.js
deleted file mode 100644
index 6353ef760..000000000
--- a/api/api/render_search_template.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Allows to use the Mustache language to pre-render a search definition.
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} [params.id] - The id of the stored search template
- * @param {Object} [params.body] - The search definition template and its params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function renderSearchTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (id != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_render' + '/' + 'template' + '/' + encodeURIComponent(id);
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_render' + '/' + 'template';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = renderSearchTemplateApi;
diff --git a/api/api/rollups.js b/api/api/rollups.js
deleted file mode 100644
index b18660c8a..000000000
--- a/api/api/rollups.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
- * This file was generated from OpenSearch API Spec. Do not edit it
- * manually. If you want to make changes, either update the spec or
- * the API generator.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const {
- handleError,
- encodePathParam,
- normalizeArguments,
- kConfigurationError,
-} = require('../utils');
-
-/** @namespace API-Rollups */
-
-function RollupsApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-/**
- * Delete index rollup.
- *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job - rollups.delete}
- *
- * @memberOf API-Rollups
- *
- * @param {object} params
- * @param {string} params.id - Rollup to access
- *
- * @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|*}
- */
-RollupsApi.prototype.delete = function (params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- id = encodePathParam(id);
-
- let path = ['_plugins', '_rollup', 'jobs', id].filter((c) => c != null).join('/');
- method = 'DELETE';
- body = body || '';
-
- return this.transport.request({ method, path, querystring, body }, options, callback);
-};
-
-/**
- * Get an index rollup.
- *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job - rollups.get}
- *
- * @memberOf API-Rollups
- *
- * @param {object} params
- * @param {string} params.id - Rollup to access
- *
- * @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|*}
- */
-RollupsApi.prototype.get = function (params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- id = encodePathParam(id);
-
- let path = ['_plugins', '_rollup', 'jobs', id].filter((c) => c != null).join('/');
- method = 'GET';
- body = body || '';
-
- return this.transport.request({ method, path, querystring, body }, options, callback);
-};
-
-/**
- * Create or update index rollup.
- *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job - rollups.put}
- *
- * @memberOf API-Rollups
- *
- * @param {object} params
- * @param {number} [params.if_seq_no] - Only perform the operation if the document has this sequence number.
- * @param {number} [params.if_primary_term] - Only perform the operation if the document has this primary term.
- * @param {string} params.id - Rollup to access
- * @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|*}
- */
-RollupsApi.prototype.put = function (params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- id = encodePathParam(id);
-
- let path = ['_plugins', '_rollup', 'jobs', id].filter((c) => c != null).join('/');
- method = 'PUT';
- body = body || '';
-
- return this.transport.request({ method, path, querystring, body }, options, callback);
-};
-
-/**
- * Get a rollup's current status.
- *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job - rollups.explain}
- *
- * @memberOf API-Rollups
- *
- * @param {object} params
- * @param {string} params.id - Rollup to access
- *
- * @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|*}
- */
-RollupsApi.prototype.explain = function (params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- id = encodePathParam(id);
-
- let path = ['_plugins', '_rollup', 'jobs', id, '_explain'].filter((c) => c != null).join('/');
- method = 'GET';
- body = body || '';
-
- return this.transport.request({ method, path, querystring, body }, options, callback);
-};
-
-/**
- * Start rollup.
- *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job - rollups.start}
- *
- * @memberOf API-Rollups
- *
- * @param {object} params
- * @param {string} params.id - Rollup to access
- *
- * @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|*}
- */
-RollupsApi.prototype.start = function (params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- id = encodePathParam(id);
-
- let path = ['_plugins', '_rollup', 'jobs', id, '_start'].filter((c) => c != null).join('/');
- method = 'POST';
- body = body || '';
-
- return this.transport.request({ method, path, querystring, body }, options, callback);
-};
-
-/**
- * Stop rollup.
- *
See Also: {@link https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job - rollups.stop}
- *
- * @memberOf API-Rollups
- *
- * @param {object} params
- * @param {string} params.id - Rollup to access
- *
- * @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|*}
- */
-RollupsApi.prototype.stop = function (params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.id == null) {
- const err = new this[kConfigurationError]('Missing required parameter: id');
- return handleError(err, callback);
- }
-
- let { method, body, id, ...querystring } = params;
- id = encodePathParam(id);
-
- let path = ['_plugins', '_rollup', 'jobs', id, '_stop'].filter((c) => c != null).join('/');
- method = 'POST';
- body = body || '';
-
- return this.transport.request({ method, path, querystring, body }, options, callback);
-};
-
-module.exports = RollupsApi;
diff --git a/api/api/scripts_painless_execute.js b/api/api/scripts_painless_execute.js
deleted file mode 100644
index 9ec8a894b..000000000
--- a/api/api/scripts_painless_execute.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
-const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
-
-/**
- * Execute Painless script
- *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ OpenSearch - Execute Painless script}
- * @memberOf API-Script
- *
- * @param {Object} params
- * @param {string} params.body - The painless script
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function scriptsPainlessExecuteApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_scripts' + '/' + 'painless' + '/' + '_execute';
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = scriptsPainlessExecuteApi;
diff --git a/api/api/scroll.js b/api/api/scroll.js
deleted file mode 100644
index 045b22dbe..000000000
--- a/api/api/scroll.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'scroll',
- 'scroll_id',
- 'rest_total_hits_as_int',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- scrollId: 'scroll_id',
- restTotalHitsAsInt: 'rest_total_hits_as_int',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Allows to retrieve a large numbers of results from a single search request.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll }
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} [params.scroll_id] - The scroll ID *Deprecated*
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
- * @param {Object} [params.body] - The scroll ID if not passed by URL or query parameter.
- *
- * @param {Object} [options] - Options for {@link Transport#request}
- * @param {function} [callback] - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function scrollApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, scrollId, scroll_id, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if ((scroll_id || scrollId) != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId);
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_search' + '/' + 'scroll';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = scrollApi;
diff --git a/api/api/search.js b/api/api/search.js
deleted file mode 100644
index fd4a75ea3..000000000
--- a/api/api/search.js
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-/** @namespace API-Search */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'analyzer',
- 'analyze_wildcard',
- 'ccs_minimize_roundtrips',
- 'default_operator',
- 'df',
- 'explain',
- 'stored_fields',
- 'docvalue_fields',
- 'from',
- 'ignore_unavailable',
- 'ignore_throttled',
- 'allow_no_indices',
- 'expand_wildcards',
- 'lenient',
- 'preference',
- 'q',
- 'routing',
- 'scroll',
- 'search_pipeline',
- 'search_type',
- 'size',
- 'sort',
- '_source',
- '_source_excludes',
- '_source_exclude',
- '_source_includes',
- '_source_include',
- 'terminate_after',
- 'stats',
- 'suggest_field',
- 'suggest_mode',
- 'suggest_size',
- 'suggest_text',
- 'timeout',
- 'track_scores',
- 'track_total_hits',
- 'allow_partial_search_results',
- 'typed_keys',
- 'version',
- 'seq_no_primary_term',
- 'request_cache',
- 'batched_reduce_size',
- 'max_concurrent_shard_requests',
- 'pre_filter_shard_size',
- 'rest_total_hits_as_int',
- 'min_compatible_shard_node',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- analyzeWildcard: 'analyze_wildcard',
- ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
- defaultOperator: 'default_operator',
- storedFields: 'stored_fields',
- docvalueFields: 'docvalue_fields',
- ignoreUnavailable: 'ignore_unavailable',
- ignoreThrottled: 'ignore_throttled',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- searchPipeline: 'search_pipeline',
- searchType: 'search_type',
- _sourceExcludes: '_source_excludes',
- _sourceExclude: '_source_exclude',
- _sourceIncludes: '_source_includes',
- _sourceInclude: '_source_include',
- terminateAfter: 'terminate_after',
- suggestField: 'suggest_field',
- suggestMode: 'suggest_mode',
- suggestSize: 'suggest_size',
- suggestText: 'suggest_text',
- trackScores: 'track_scores',
- trackTotalHits: 'track_total_hits',
- allowPartialSearchResults: 'allow_partial_search_results',
- typedKeys: 'typed_keys',
- seqNoPrimaryTerm: 'seq_no_primary_term',
- requestCache: 'request_cache',
- batchedReduceSize: 'batched_reduce_size',
- maxConcurrentShardRequests: 'max_concurrent_shard_requests',
- preFilterShardSize: 'pre_filter_shard_size',
- restTotalHitsAsInt: 'rest_total_hits_as_int',
- minCompatibleShardNode: 'min_compatible_shard_node',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Allows to execute several search operations in one request.
- *
See Also: {@link https://opensearch.org/docs/latest/api-reference/search/ OpenSearch - Search}
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.analyzer] - The analyzer to use for the query string
- * @param {boolean} [params.analyze_wildcard] - Specify whether wildcard and prefix queries should be analyzed (default: false)
- * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
- * @param {string} [params.default_operator] - The default operator for query string query (AND or OR) (options: AND, OR)
- * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
- * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
- * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return as part of a hit
- * @param {string} [params.docvalue_fields] - A comma-separated list of fields to return as the docvalue representation of a field for each hit
- * @param {number} [params.from] - Starting offset (default: 0)
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
- * @param {string} [params.q] - Query in the Lucene query string syntax
- * @param {string} [params.routing] - A comma-separated list of specific routing values
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
- * @param {string} [params.search_pipeline] - Customizable sequence of processing stages applied to search queries.
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
- * @param {number} [params.size] - Number of hits to return (default: 10)
- * @param {string} [params.sort] - A comma-separated list of : pairs
- * @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_excludes] - A list of fields to exclude from the returned _source field
- * @param {string} [params._source_includes] - A list of fields to extract and return from the _source field
- * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
- * @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes
- * @param {string} [params.suggest_field] - Specify which field to use for suggestions
- * @param {string} [params.suggest_mode] - Specify suggest mode (options: missing, popular, always)
- * @param {number} [params.suggest_size] - How many suggestions to return in response
- * @param {string} [params.suggest_text] - The source text for which the suggestions should be returned
- * @param {string} [params.timeout] - Explicit operation timeout
- * @param {boolean} [params.track_scores] - Whether to calculate and return scores even if they are not used for sorting
- * @param {boolean} [params.track_total_hits] - Indicate if the number of documents that match the query should be tracked
- * @param {boolean} [params.allow_partial_search_results] - Indicate if an error should be returned if there is a partial search failure or timeout
- * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
- * @param {boolean} [params.version] - Specify whether to return document version as part of a hit
- * @param {boolean} [params.seq_no_primary_term] - Specify whether to return sequence number and primary term of the last modification of each hit
- * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting
- * @param {number} [params.batched_reduce_size] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
- * @param {number} [params.max_concurrent_shard_requests] - 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] - 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 ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
- * @param {string} [params.min_compatible_shard_node] - The minimum compatible version that all shards involved in search should have for this request to be successful
- * @param {Object} [params.body] - The search definition using the Query DSL
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/search/#response-body Search Response}
- */
-function searchApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_search';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_search';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = searchApi;
diff --git a/api/api/search_shards.js b/api/api/search_shards.js
deleted file mode 100644
index 5190463c9..000000000
--- a/api/api/search_shards.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'preference',
- 'routing',
- 'local',
- 'ignore_unavailable',
- 'allow_no_indices',
- 'expand_wildcards',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- ignoreUnavailable: 'ignore_unavailable',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Returns information about the indices and shards that a search request would be executed against.
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
- * @param {string} [params.routing] - Specific routing value
- * @param {boolean} [params.local] - Return local information, do not retrieve the state from cluster_manager node (default: false)
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function searchShardsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, index, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_search_shards';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_search_shards';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = searchShardsApi;
diff --git a/api/api/search_template.js b/api/api/search_template.js
deleted file mode 100644
index c45c6ef16..000000000
--- a/api/api/search_template.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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.
- *
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-'use strict';
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
-const acceptedQuerystring = [
- 'ignore_unavailable',
- 'ignore_throttled',
- 'allow_no_indices',
- 'expand_wildcards',
- 'preference',
- 'routing',
- 'scroll',
- 'search_type',
- 'explain',
- 'profile',
- 'typed_keys',
- 'rest_total_hits_as_int',
- 'ccs_minimize_roundtrips',
- 'pretty',
- 'human',
- 'error_trace',
- 'source',
- 'filter_path',
-];
-const snakeCase = {
- ignoreUnavailable: 'ignore_unavailable',
- ignoreThrottled: 'ignore_throttled',
- allowNoIndices: 'allow_no_indices',
- expandWildcards: 'expand_wildcards',
- searchType: 'search_type',
- typedKeys: 'typed_keys',
- restTotalHitsAsInt: 'rest_total_hits_as_int',
- ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips',
- errorTrace: 'error_trace',
- filterPath: 'filter_path',
-};
-
-/**
- * Allows to use the Mustache language to pre-render a search definition.
- *
- * @memberOf API-Search
- *
- * @param {Object} params
- * @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
- * @param {Object} params.body - The search definition template and its params
- * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
- * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
- * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
- * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
- * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
- * @param {string} [params.routing] - A comma-separated list of specific routing values
- * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
- * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
- * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
- * @param {boolean} [params.profile] - Specify whether to profile the query execution
- * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
- * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
- * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-function searchTemplateApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- // check required parameters
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- // check required url components
- if (params.type != null && params.index == null) {
- const err = new this[kConfigurationError]('Missing required parameter of the url: index');
- return handleError(err, callback);
- }
-
- let { method, body, index, type, ...querystring } = params;
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
-
- let path = '';
- if (index != null && type != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path =
- '/' +
- encodeURIComponent(index) +
- '/' +
- encodeURIComponent(type) +
- '/' +
- '_search' +
- '/' +
- 'template';
- } else if (index != null) {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template';
- } else {
- if (method == null) method = body == null ? 'GET' : 'POST';
- path = '/' + '_search' + '/' + 'template';
- }
-
- // build request object
- const request = {
- method,
- path,
- body: body || '',
- querystring,
- };
-
- return this.transport.request(request, options, callback);
-}
-
-module.exports = searchTemplateApi;
diff --git a/api/api/security.js b/api/api/security.js
deleted file mode 100644
index 1a8c31f2e..000000000
--- a/api/api/security.js
+++ /dev/null
@@ -1,1954 +0,0 @@
-/*
- * 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.
- *
- */
-
-'use strict';
-
-/** @namespace API-Security */
-
-/* eslint camelcase: 0 */
-/* eslint no-unused-vars: 0 */
-
-const {
- handleError,
- snakeCaseKeys,
- encodePathParam,
- normalizeArguments,
- kConfigurationError,
-} = require('../utils');
-const snakeCase = {};
-
-function SecurityApi(transport, ConfigurationError) {
- this.transport = transport;
- this[kConfigurationError] = ConfigurationError;
-}
-
-/**
- * Changes the password for the current user.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#change-password - Security - Change Password}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.changePassword = function securityChangePasswordApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'account'].filter((c) => c != null).join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates or replaces the specified action group.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#create-action-group - Security - Create Action Group}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.action_group - The name of the action group to create or replace
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.createActionGroup = function securityCreateActionGroupApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.actionGroup == null && params.action_group == null) {
- const err = new this[kConfigurationError]('Missing required parameter: action_group');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, actionGroup, action_group, ...querystring } = params;
-
- action_group = encodePathParam(actionGroup, action_group);
-
- let path = ['', '_plugins', '_security', 'api', 'actiongroups', action_group]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates or replaces the specified role.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#create-role - Security - Create Role}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.createRole = function securityCreateRoleApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'roles', role].filter((c) => c != null).join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates or replaces the specified role mapping.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#create-role-mapping - Security - Create Role Mapping}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.createRoleMapping = function securityCreateRoleMappingApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'rolesmapping', role]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates or replaces the specified tenant.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#create-tenant - Security - Create Tenant}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.tenant
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.createTenant = function securityCreateTenantApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.tenant == null) {
- const err = new this[kConfigurationError]('Missing required parameter: tenant');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, tenant, ...querystring } = params;
-
- tenant = encodePathParam(tenant);
-
- let path = ['', '_plugins', '_security', 'api', 'tenants', tenant]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates or replaces the specified user.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#create-user - Security - Create User}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.username
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.createUser = function securityCreateUserApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.username == null) {
- const err = new this[kConfigurationError]('Missing required parameter: username');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, username, ...querystring } = params;
-
- username = encodePathParam(username);
-
- let path = ['', '_plugins', '_security', 'api', 'internalusers', username]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Delete a specified action group.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group - Security - Delete Action Group}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.action_group - Action group to delete.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.deleteActionGroup = function securityDeleteActionGroupApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.actionGroup == null && params.action_group == null) {
- const err = new this[kConfigurationError]('Missing required parameter: action_group');
- return handleError(err, callback);
- }
-
- let { method, body, actionGroup, action_group, ...querystring } = params;
-
- action_group = encodePathParam(actionGroup, action_group);
-
- let path = ['', '_plugins', '_security', 'api', 'actiongroups', action_group]
- .filter((c) => c != null)
- .join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Deletes all distinguished names in the specified cluster’s or node’s allow list.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#delete-distinguished-names - Security - Delete Distinguished Names}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.cluster_name
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.deleteDistinguishedNames = function securityDeleteDistinguishedNamesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.clusterName == null && params.cluster_name == null) {
- const err = new this[kConfigurationError]('Missing required parameter: cluster_name');
- return handleError(err, callback);
- }
-
- let { method, body, clusterName, cluster_name, ...querystring } = params;
-
- cluster_name = encodePathParam(clusterName, cluster_name);
-
- let path = ['', '_plugins', '_security', 'api', 'nodesdn', cluster_name]
- .filter((c) => c != null)
- .join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Delete the specified role.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#delete-role - Security - Delete Role}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.deleteRole = function securityDeleteRoleApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'roles', role].filter((c) => c != null).join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Deletes the specified role mapping.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#delete-role-mapping - Security - Delete Role Mapping}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.deleteRoleMapping = function securityDeleteRoleMappingApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'rolesmapping', role]
- .filter((c) => c != null)
- .join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Delete the specified tenant.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group - Security - Delete Tenant}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.tenant
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.deleteTenant = function securityDeleteTenantApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.tenant == null) {
- const err = new this[kConfigurationError]('Missing required parameter: tenant');
- return handleError(err, callback);
- }
-
- let { method, body, tenant, ...querystring } = params;
-
- tenant = encodePathParam(tenant);
-
- let path = ['', '_plugins', '_security', 'api', 'tenants', tenant]
- .filter((c) => c != null)
- .join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Delete the specified user.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#delete-user - Security - Delete User}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.username
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.deleteUser = function securityDeleteUserApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.username == null) {
- const err = new this[kConfigurationError]('Missing required parameter: username');
- return handleError(err, callback);
- }
-
- let { method, body, username, ...querystring } = params;
-
- username = encodePathParam(username);
-
- let path = ['', '_plugins', '_security', 'api', 'internalusers', username]
- .filter((c) => c != null)
- .join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Flushes the Security plugin user, authentication, and authorization cache.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#flush-cache - Security - Flush Cache}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.flushCache = function securityFlushCacheApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'cache'].filter((c) => c != null).join('/');
- method = method || 'DELETE';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Returns account details for the current user.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-account-details - Security - Get Account Details}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getAccountDetails = function securityGetAccountDetailsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'account'].filter((c) => c != null).join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves one action group.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-action-group - Security - Get Action Group}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.action_group - Action group to retrieve.
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getActionGroup = function securityGetActionGroupApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.actionGroup == null && params.action_group == null) {
- const err = new this[kConfigurationError]('Missing required parameter: action_group');
- return handleError(err, callback);
- }
-
- let { method, body, actionGroup, action_group, ...querystring } = params;
-
- action_group = encodePathParam(actionGroup, action_group);
-
- let path = ['', '_plugins', '_security', 'api', 'actiongroups', action_group]
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves all action groups.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-action-groups - Security - Get Action Groups}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getActionGroups = function securityGetActionGroupsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'actiongroups']
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves the audit configuration.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#audit-logs - Security - Get Audit Configuration}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getAuditConfiguration = function securityGetAuditConfigurationApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'audit'].filter((c) => c != null).join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves the cluster’s security certificates.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-certificates - Security - Get Certificates}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getCertificates = function securityGetCertificatesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'ssl', 'certs']
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Returns the current Security plugin configuration in JSON format.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#get-configuration - Security - Get Configuration}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getConfiguration = function securityGetConfigurationApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'securityconfig']
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves all distinguished names in the allow list.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-distinguished-names - Security - Get Distinguished Names}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} [params.cluster_name]
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getDistinguishedNames = function securityGetDistinguishedNamesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, clusterName, cluster_name, ...querystring } = params;
-
- cluster_name = encodePathParam(clusterName, cluster_name);
-
- let path = ['', '_plugins', '_security', 'api', 'nodesdn', cluster_name]
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves one role.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-role - Security - Get Role}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getRole = function securityGetRoleApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'roles', role].filter((c) => c != null).join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves one role mapping.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-role-mapping - Security - Get Role Mapping}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getRoleMapping = function securityGetRoleMappingApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'rolesmapping', role]
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves all role mappings.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-role-mappings - Security - Get Role Mappings}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getRoleMappings = function securityGetRoleMappingsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'rolesmapping']
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves all roles.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-roles - Security - Get Roles}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getRoles = function securityGetRolesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'roles'].filter((c) => c != null).join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves one tenant.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#get-tenant - Security - Get Tenant}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.tenant
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getTenant = function securityGetTenantApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.tenant == null) {
- const err = new this[kConfigurationError]('Missing required parameter: tenant');
- return handleError(err, callback);
- }
-
- let { method, body, tenant, ...querystring } = params;
-
- tenant = encodePathParam(tenant);
-
- let path = ['', '_plugins', '_security', 'api', 'tenants', tenant]
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieves all tenants.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#get-tenants - Security - Get Tenants}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getTenants = function securityGetTenantsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'tenants'].filter((c) => c != null).join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieve one internal user.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-user - Security - Get User}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.username
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getUser = function securityGetUserApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.username == null) {
- const err = new this[kConfigurationError]('Missing required parameter: username');
- return handleError(err, callback);
- }
-
- let { method, body, username, ...querystring } = params;
-
- username = encodePathParam(username);
-
- let path = ['', '_plugins', '_security', 'api', 'internalusers', username]
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Retrieve all internal users.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#get-users - Security - Get Users}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.getUsers = function securityGetUsersApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'internalusers']
- .filter((c) => c != null)
- .join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Checks to see if the Security plugin is up and running.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#health-check - Security - Health}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.health = function securityHealthApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'health'].filter((c) => c != null).join('/');
- method = method || 'GET';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Updates individual attributes of an action group.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-action-group - Security - Patch Action Group}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.action_group
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchActionGroup = function securityPatchActionGroupApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.actionGroup == null && params.action_group == null) {
- const err = new this[kConfigurationError]('Missing required parameter: action_group');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, actionGroup, action_group, ...querystring } = params;
-
- action_group = encodePathParam(actionGroup, action_group);
-
- let path = ['', '_plugins', '_security', 'api', 'actiongroups', action_group]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates, updates, or deletes multiple action groups in a single call.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-action-groups - Security - Patch Action Groups}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchActionGroups = function securityPatchActionGroupsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'actiongroups']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * A PATCH call is used to update specified fields in the audit configuration.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#audit-logs - Security - Patch Audit Configuration}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchAuditConfiguration = function securityPatchAuditConfigurationApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'audit'].filter((c) => c != null).join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * A PATCH call is used to update the existing configuration using the REST API.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#patch-configuration - Security - Patch Configuration}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchConfiguration = function securityPatchConfigurationApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'securityconfig']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Bulk update of distinguished names.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#update-all-distinguished-names - Security - Patch Distinguished Names}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchDistinguishedNames = function securityPatchDistinguishedNamesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'nodesdn'].filter((c) => c != null).join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Updates individual attributes of a role.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-role - Security - Patch Role}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchRole = function securityPatchRoleApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'roles', role].filter((c) => c != null).join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Updates individual attributes of a role mapping.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mapping - Security - Patch Role Mapping}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.role
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchRoleMapping = function securityPatchRoleMappingApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.role == null) {
- const err = new this[kConfigurationError]('Missing required parameter: role');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, role, ...querystring } = params;
-
- role = encodePathParam(role);
-
- let path = ['', '_plugins', '_security', 'api', 'rolesmapping', role]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates or updates multiple role mappings in a single call.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mappings - Security - Patch Role Mappings}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchRoleMappings = function securityPatchRoleMappingsApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'rolesmapping']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates, updates, or deletes multiple roles in a single call.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-roles - Security - Patch Roles}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchRoles = function securityPatchRolesApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'roles'].filter((c) => c != null).join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Add, delete, or modify a single tenant.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#patch-tenant - Security - Patch Tenant}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.tenant
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchTenant = function securityPatchTenantApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.tenant == null) {
- const err = new this[kConfigurationError]('Missing required parameter: tenant');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, tenant, ...querystring } = params;
-
- tenant = encodePathParam(tenant);
-
- let path = ['', '_plugins', '_security', 'api', 'tenants', tenant]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Add, delete, or modify multiple tenants in a single call.
- *
See Also: {@link https://opensearch.org/docs/2.7/security/access-control/api/#patch-tenants - Security - Patch Tenants}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchTenants = function securityPatchTenantsApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'tenants'].filter((c) => c != null).join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Updates individual attributes of an internal user.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-user - Security - Patch User}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {string} params.username
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchUser = function securityPatchUserApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.username == null) {
- const err = new this[kConfigurationError]('Missing required parameter: username');
- return handleError(err, callback);
- }
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, username, ...querystring } = params;
-
- username = encodePathParam(username);
-
- let path = ['', '_plugins', '_security', 'api', 'internalusers', username]
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Creates, updates, or deletes multiple internal users in a single call.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#patch-users - Security - Patch Users}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.patchUsers = function securityPatchUsersApi(params, options, callback) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'internalusers']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PATCH';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Reload HTTP layer communication certificates.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#reload-http-certificates - Security - Reload Http Certificates}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.reloadHttpCertificates = function securityReloadHttpCertificatesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'ssl', 'http', 'reloadcerts']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Reload transport layer communication certificates.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#reload-transport-certificates - Security - Reload Transport Certificates}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.reloadTransportCertificates = function securityReloadTransportCertificatesApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'ssl', 'transport', 'reloadcerts']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Updates the audit configuration.
- *
See Also: {@link https://opensearch.org/docs/latest/security/access-control/api/#audit-logs - Security - Update Audit Configuration}
- *
- * @memberOf API-Security
- *
- * @param {Object} params
- * @param {Object} params.body
- *
- * @param {Object} options - Options for {@link Transport#request}
- * @param {function} callback - Callback that handles errors and response
- *
- * @returns {{abort: function(), then: function(), catch: function()}|Promise|*}
- */
-SecurityApi.prototype.updateAuditConfiguration = function securityUpdateAuditConfigurationApi(
- params,
- options,
- callback
-) {
- [params, options, callback] = normalizeArguments(params, options, callback);
-
- if (params.body == null) {
- const err = new this[kConfigurationError]('Missing required parameter: body');
- return handleError(err, callback);
- }
-
- let { method, body, ...querystring } = params;
-
- let path = ['', '_plugins', '_security', 'api', 'audit', 'config']
- .filter((c) => c != null)
- .join('/');
- method = method || 'PUT';
- body = body || '';
- querystring = snakeCaseKeys(null, snakeCase, querystring);
-
- return this.transport.request({ method, path, body, querystring }, options, callback);
-};
-
-/**
- * Adds or updates the existing configuration using the REST API.
- *