Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTOCUT] Update opensearch-js to reflect the latest OpenSearch API spec (2025-02-09) #970

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/OpenSearchApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ export default class OpenSearchAPI {
};

ml: {
executeAlgorithm (params: API.Ml_ExecuteAlgorithm_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_ExecuteAlgorithm_Response>;
executeAlgorithm (params: API.Ml_ExecuteAlgorithm_Request, callback: callbackFn<API.Ml_ExecuteAlgorithm_Response>): TransportRequestCallback;
executeAlgorithm (params: API.Ml_ExecuteAlgorithm_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_ExecuteAlgorithm_Response>): TransportRequestCallback;

predict (params: API.Ml_Predict_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_Predict_Response>;
predict (params: API.Ml_Predict_Request, callback: callbackFn<API.Ml_Predict_Response>): TransportRequestCallback;
predict (params: API.Ml_Predict_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_Predict_Response>): TransportRequestCallback;
Expand Down
1 change: 1 addition & 0 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export type GetStats = {
missing_time?: Duration;
missing_time_in_millis: DurationValueUnitMillis;
missing_total: number;
time?: Duration;
time_in_millis: DurationValueUnitMillis;
total: number;
}
Expand Down
34 changes: 34 additions & 0 deletions api/_types/ml._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type AdditionalInfo = Record<string, any>

export type Aggregation = {
field?: string;
max?: Aggregation;
sum?: Aggregation;
[key: string]: any;
}
Expand All @@ -41,6 +42,7 @@ export type Algorithm = {

export type AlgorithmOperations = {
deploy?: ModelStats;
execute?: ModelStats;
predict?: ModelStats;
register?: ModelStats;
train?: ModelStats;
Expand All @@ -57,6 +59,13 @@ export type BoolQuery = {
should?: Filter[];
}

export type Buckets = {
end_time?: number;
entities?: Entity[];
overall_aggregate_value?: number;
start_time?: number;
}

export type ByteBuffer = {
array?: string;
order?: 'BIG_ENDIAN' | 'LITTLE_ENDIAN';
Expand Down Expand Up @@ -84,6 +93,26 @@ export type Credential = {
[key: string]: any;
}

export type Entity = {
base_value?: number;
contribution_value?: number;
key?: string[];
new_value?: number;
}

export type ExecuteAlgorithmResponse = ExecuteLocalSampleCalculatorResponse | {
results?: ExecuteAnomalyLocalizationResponse[];
}

export type ExecuteAnomalyLocalizationResponse = {
name?: string;
result?: Result;
}

export type ExecuteLocalSampleCalculatorResponse = {
result?: number;
}

export type Exists = {
field?: Common.Field;
}
Expand Down Expand Up @@ -258,6 +287,7 @@ export type ModelGroupRegistration = {

export type ModelProfile = {
deploy?: ModelStats;
execute?: ModelStats;
memory_size_estimation_cpu?: number;
memory_size_estimation_gpu?: number;
model_state?: 'DEPLOYED' | 'DEPLOYING' | 'DEPLOY_FAILED' | 'PARTIALLY_DEPLOYED' | 'REGISTERED' | 'REGISTERING' | 'UNDEPLOYED';
Expand Down Expand Up @@ -396,6 +426,10 @@ export type RateLimiter = {
unit: 'DAYS' | 'HOURS' | 'MICROSECONDS' | 'MILLISECONDS' | 'MINUTES' | 'NANOSECONDS' | 'SECONDS';
}

export type Result = {
buckets?: Buckets[];
}

export type Rows = {
values?: Values[];
}
Expand Down
6 changes: 3 additions & 3 deletions api/asynchronousSearch/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const { normalizeArguments } = require('../utils');
*
* @param {object} [params]
* @param {string} [params.index] - The name of the index to be searched. Can be an individual name, a comma-separated list of indexes, or a wildcard expression of index names.
* @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query execution time. If the query overruns this time, the process cancels this query automatically.
* @param {boolean} [params.keep_on_completion] - Whether you want to save the results in the cluster after the search is complete. You can examine the stored results at a later time.
* @param {string} [params.wait_for_completion_timeout] - The amount of time that you plan to wait for the results. You can poll the remaining results based on an ID. The maximum value is 300 seconds. Default is `1s`.
* @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query execution time. If the query exceeds this amount of time, the process cancels this query automatically.
* @param {boolean} [params.keep_on_completion] - Whether to save the results in the cluster after the search is complete. You can examine the stored results at a later time.
* @param {string} [params.wait_for_completion_timeout] - The amount of time to wait for the results. You can poll the remaining results based on an ID. The maximum value is 300 seconds. Default is `1s`.
* @param {object} [params.body] - The search definition using the Query DSL.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
Expand Down
2 changes: 1 addition & 1 deletion api/asynchronousSearch/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
const { normalizeArguments } = require('../utils');

/**
* Monitors any asynchronous searches that are `running`, `completed`, `persisted`.
* Monitors any asynchronous searches that are `running`, `completed`, or `persisted`.
* <br/> See Also: {@link https://opensearch.org/docs/latest/search-plugins/async/index/#monitor-stats - asynchronous_search.stats}
*
* @memberOf API-Asynchronous-Search
Expand Down
8 changes: 4 additions & 4 deletions api/cluster/allocationExplain.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
const { normalizeArguments } = require('../utils');

/**
* Provides explanations for shard allocations in the cluster.
* Explains how shards are allocated in the current cluster and provides an explanation for why unassigned shards can't be allocated to a node.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-allocation/ - cluster.allocation_explain}
*
* @memberOf API-Cluster
*
* @param {object} [params]
* @param {boolean} [params.include_disk_info=false] - If `true`, returns information about disk usage and shard sizes.
* @param {boolean} [params.include_yes_decisions=false] - If `true`, returns YES decisions in explanation.
* @param {object} [params.body] - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
* @param {boolean} [params.include_disk_info=false] - When `true`, returns information about disk usage and shard sizes.
* @param {boolean} [params.include_yes_decisions=false] - When `true`, returns any `YES` decisions in the allocation explanation.
* @param {object} [params.body] - The index, shard, and primary flag for which to generate an explanation. Leave this empty to generate an explanation for the first unassigned shard.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
6 changes: 3 additions & 3 deletions api/cluster/deleteComponentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u
*
* @param {object} params
* @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
* @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} params.name - Name of the component template to delete. Wildcard (*) expressions are supported.
* @param {string} [params.master_timeout] DEPRECATED - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {string} [params.timeout] - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {string} params.name - The name of the component template to delete. Supports wildcard (*) expressions.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
2 changes: 1 addition & 1 deletion api/cluster/deleteDecommissionAwareness.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
const { normalizeArguments } = require('../utils');

/**
* Delete any existing decommission.
* Recommissions a decommissioned zone.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone - cluster.delete_decommission_awareness}
*
* @memberOf API-Cluster
Expand Down
4 changes: 2 additions & 2 deletions api/cluster/deleteVotingConfigExclusions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
const { normalizeArguments } = require('../utils');

/**
* Clears cluster voting config exclusions.
* Clears any cluster voting configuration exclusions.
* <br/> See Also: {@link https://opensearch.org/docs/latest - cluster.delete_voting_config_exclusions}
*
* @memberOf API-Cluster
*
* @param {object} [params]
* @param {boolean} [params.wait_for_removal=true] - Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any action. If set to `false` then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster.
* @param {boolean} [params.wait_for_removal=true] - Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. When `true`, all excluded nodes are removed from the cluster before this API takes any action. When `false`, the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
8 changes: 4 additions & 4 deletions api/cluster/existsComponentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u
* @memberOf API-Cluster
*
* @param {object} params
* @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
* @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node.
* @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} params.name - Name of the component template to check existence of. Wildcard (*) expressions are supported.
* @param {string} [params.cluster_manager_timeout] - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {boolean} [params.local=false] - When `true`, the request retrieves information from the local node only. When `false, information is retrieved from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {string} params.name - The name of the component template. Wildcard (*) expressions are supported.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
8 changes: 4 additions & 4 deletions api/cluster/getComponentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const { normalizeArguments, parsePathParam } = require('../utils');
* @memberOf API-Cluster
*
* @param {object} [params]
* @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
* @param {string} [params.cluster_manager_timeout] - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format.
* @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node.
* @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} [params.name] - Name of the component template to retrieve. Wildcard (`*`) expressions are supported.
* @param {boolean} [params.local=false] - When `true`, the request retrieves information from the local node only. When `false`, information is retrieved from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {string} [params.name] - The name of the component template to retrieve. Wildcard (`*`) expressions are supported.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
4 changes: 2 additions & 2 deletions api/cluster/getDecommissionAwareness.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');

/**
* Get details and status of decommissioned attribute.
* Retrieves the decommission status for all zones.
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-getting-zone-decommission-status - cluster.get_decommission_awareness}
*
* @memberOf API-Cluster
*
* @param {object} params
* @param {string} params.awareness_attribute_name - Awareness attribute name.
* @param {string} params.awareness_attribute_name - The name of the awareness attribute.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
10 changes: 5 additions & 5 deletions api/cluster/getSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const { normalizeArguments } = require('../utils');
* @memberOf API-Cluster
*
* @param {object} [params]
* @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
* @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format.
* @param {boolean} [params.include_defaults=false] - If `true`, returns default cluster settings from the local node.
* @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} [params.timeout] - Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} [params.cluster_manager_timeout] - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {boolean} [params.flat_settings=false] - When `true`, returns cluster settings in a flat format.
* @param {boolean} [params.include_defaults=false] - When `true`, returns default cluster settings from the local node.
* @param {string} [params.master_timeout] DEPRECATED - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
* @param {string} [params.timeout] - A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
2 changes: 1 addition & 1 deletion api/cluster/getWeightedRouting.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u
* @memberOf API-Cluster
*
* @param {object} params
* @param {string} params.attribute - Awareness attribute name.
* @param {string} params.attribute - The name of the awareness attribute.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
Loading
Loading