Skip to content

Commit

Permalink
Auto Generated API
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <theotr@amazon.com>
  • Loading branch information
nhtruong committed Jun 21, 2024
1 parent 2b4eb03 commit f3a9956
Show file tree
Hide file tree
Showing 352 changed files with 23,739 additions and 14,529 deletions.
58 changes: 58 additions & 0 deletions api/_core/bulk.js
Original file line number Diff line number Diff line change
@@ -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'

Check failure on line 16 in api/_core/bulk.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

Check failure on line 16 in api/_core/bulk.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');

/**
* Allows to perform multiple index/update/delete operations in a single request.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/ - bulk}
*
* @memberOf API-Core
*
* @param {object} params
* @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.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 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._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 {boolean} [params.require_alias=false] - If `true`, the request’s actions must target an index alias.
* @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<never>|*}
*/
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('//', '/');

Check failure on line 52 in api/_core/bulk.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Replace `.filter(c·=>·c).join('')` with `⏎····.filter((c)·=>·c)⏎····.join('')⏎····`

Check failure on line 52 in api/_core/bulk.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Replace `.filter(c·=>·c).join('')` with `⏎····.filter((c)·=>·c)⏎····.join('')⏎····`
const method = index == null ? 'POST' : 'PUT';

return this.transport.request({ method, path, querystring, bulkBody: body }, options, callback);
};

Check failure on line 56 in api/_core/bulk.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Delete `;`

Check failure on line 56 in api/_core/bulk.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Delete `;`

module.exports = bulkFunc;
48 changes: 48 additions & 0 deletions api/_core/clear_scroll.js
Original file line number Diff line number Diff line change
@@ -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'

Check failure on line 16 in api/_core/clear_scroll.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

Check failure on line 16 in api/_core/clear_scroll.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

const { normalizeArguments, parsePathParam } = require('../utils');

/**
* Explicitly clears the search context for a scroll.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ - clear_scroll}
*
* @memberOf API-Core
*
* @param {object} [params]
* @param {string} [params.scroll_id] - 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<never>|*}
*/
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('//', '/');

Check failure on line 41 in api/_core/clear_scroll.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Replace `.filter(c·=>·c).join('')` with `⏎····.filter((c)·=>·c)⏎····.join('')⏎····`

Check failure on line 41 in api/_core/clear_scroll.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Replace `.filter(c·=>·c).join('')` with `⏎····.filter((c)·=>·c)⏎····.join('')⏎····`
const method = 'DELETE';
body = body || '';

return this.transport.request({ method, path, querystring, body }, options, callback);
};

Check failure on line 46 in api/_core/clear_scroll.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Delete `;`

Check failure on line 46 in api/_core/clear_scroll.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Delete `;`

module.exports = clearScrollFunc;
62 changes: 62 additions & 0 deletions api/_core/count.js
Original file line number Diff line number Diff line change
@@ -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'

Check failure on line 16 in api/_core/count.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

Check failure on line 16 in api/_core/count.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

const { normalizeArguments, parsePathParam } = require('../utils');

/**
* Returns number of documents matching a query.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/count/ - count}
*
* @memberOf API-Core
*
* @param {object} [params]
* @param {boolean} [params.ignore_unavailable] - If `false`, the request returns an error if it targets a missing or closed index.
* @param {boolean} [params.ignore_throttled] - If `true`, concrete, expanded or aliased indices are ignored when frozen.
* @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 {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 {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.routing] - Custom value used to route operations to a specific shard.
* @param {string} [params.q] - Query in the Lucene query string syntax.
* @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 {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.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 {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.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<never>|*}
*/
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('//', '/');

Check failure on line 55 in api/_core/count.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Replace `.filter(c·=>·c).join('')` with `⏎····.filter((c)·=>·c)⏎····.join('')⏎····`

Check failure on line 55 in api/_core/count.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Replace `.filter(c·=>·c).join('')` with `⏎····.filter((c)·=>·c)⏎····.join('')⏎····`
const method = body ? 'POST' : 'GET';
body = body || '';

return this.transport.request({ method, path, querystring, body }, options, callback);
};

Check failure on line 60 in api/_core/count.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Delete `;`

Check failure on line 60 in api/_core/count.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Delete `;`

module.exports = countFunc;
61 changes: 61 additions & 0 deletions api/_core/create.js
Original file line number Diff line number Diff line change
@@ -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'

Check failure on line 16 in api/_core/create.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

Check failure on line 16 in api/_core/create.js

View workflow job for this annotation

GitHub Actions / Test (16.x, ubuntu-latest)

Insert `;`

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.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ - create}
*
* @memberOf API-Core
*
* @param {object} params
* @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.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.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.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<never>|*}
*/
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;
53 changes: 53 additions & 0 deletions api/_core/create_pit.js
Original file line number Diff line number Diff line change
@@ -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.
* <br/> 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.keep_alive] - Specify the keep alive for point in time.
* @param {string} [params.preference=random] - Specify the node or shard the operation should be performed on.
* @param {array} [params.routing] - Comma-separated list of specific routing values.
* @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both.
* @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<never>|*}
*/
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;
59 changes: 59 additions & 0 deletions api/_core/delete.js
Original file line number Diff line number Diff line change
@@ -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.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/ - delete}
*
* @memberOf API-Core
*
* @param {object} params
* @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.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.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 {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 - 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<never>|*}
*/
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;
44 changes: 44 additions & 0 deletions api/_core/delete_all_pits.js
Original file line number Diff line number Diff line change
@@ -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.
* <br/> 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<never>|*}
*/
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;
Loading

0 comments on commit f3a9956

Please sign in to comment.