@opensearch-project/opensearch 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/api/OpenSearchApi.d.ts +162 -3
  2. package/api/_core/count.js +1 -1
  3. package/api/_core/createPit.d.ts +1 -2
  4. package/api/_core/deleteAllPits.d.ts +2 -2
  5. package/api/_core/deleteByQuery.d.ts +2 -1
  6. package/api/_core/deleteByQuery.js +1 -1
  7. package/api/_core/deletePit.d.ts +2 -2
  8. package/api/_core/getAllPits.d.ts +2 -2
  9. package/api/_core/rankEval.d.ts +1 -1
  10. package/api/_core/reindex.d.ts +1 -0
  11. package/api/_core/reindex.js +1 -0
  12. package/api/_core/renderSearchTemplate.d.ts +1 -1
  13. package/api/_core/search.d.ts +1 -0
  14. package/api/_core/searchShards.d.ts +0 -11
  15. package/api/_core/searchShards.js +0 -1
  16. package/api/_core/updateByQuery.d.ts +2 -1
  17. package/api/_core/updateByQuery.js +1 -1
  18. package/api/_types/_common.aggregations.d.ts +37 -156
  19. package/api/_types/_common.d.ts +4 -17
  20. package/api/_types/_core.field_caps.d.ts +1 -1
  21. package/api/_types/{_core._common.d.ts → _core.pit.d.ts} +0 -12
  22. package/api/_types/_core.rank_eval.d.ts +3 -3
  23. package/api/_types/_core.termvectors.d.ts +1 -1
  24. package/api/_types/{cat._common.d.ts → cat.segment_replication.d.ts} +1 -18
  25. package/api/_types/cat.snapshots.d.ts +1 -1
  26. package/api/_types/index.d.ts +233 -0
  27. package/api/_types/ingest._common.d.ts +3 -40
  28. package/api/_types/ml._common.d.ts +293 -7
  29. package/api/_types/nodes.info.d.ts +17 -5
  30. package/api/asynchronousSearch/delete.js +1 -1
  31. package/api/asynchronousSearch/get.js +1 -1
  32. package/api/asynchronousSearch/search.js +4 -4
  33. package/api/asynchronousSearch/stats.js +1 -1
  34. package/api/cat/aliases.js +1 -1
  35. package/api/cat/allPitSegments.d.ts +2 -2
  36. package/api/cat/allPitSegments.js +1 -1
  37. package/api/cat/clusterManager.js +1 -1
  38. package/api/cat/count.js +1 -1
  39. package/api/cat/fielddata.js +1 -1
  40. package/api/cat/health.js +1 -1
  41. package/api/cat/indices.js +2 -2
  42. package/api/cat/master.js +1 -1
  43. package/api/cat/nodeattrs.js +1 -1
  44. package/api/cat/nodes.d.ts +1 -1
  45. package/api/cat/nodes.js +2 -2
  46. package/api/cat/pendingTasks.js +1 -1
  47. package/api/cat/pitSegments.d.ts +2 -2
  48. package/api/cat/pitSegments.js +1 -1
  49. package/api/cat/plugins.js +1 -1
  50. package/api/cat/recovery.js +1 -1
  51. package/api/cat/repositories.js +1 -1
  52. package/api/cat/segmentReplication.d.ts +2 -2
  53. package/api/cat/segmentReplication.js +2 -2
  54. package/api/cat/shards.js +1 -1
  55. package/api/cat/snapshots.js +1 -1
  56. package/api/cat/tasks.js +1 -1
  57. package/api/cat/templates.js +1 -1
  58. package/api/cat/threadPool.js +1 -1
  59. package/api/index.d.ts +76 -4
  60. package/api/ml/_api.js +108 -0
  61. package/api/ml/chunkModel.d.ts +37 -0
  62. package/api/ml/chunkModel.js +53 -0
  63. package/api/ml/createController.d.ts +39 -0
  64. package/api/ml/createController.js +50 -0
  65. package/api/ml/createMemory.d.ts +36 -0
  66. package/api/ml/createMemory.js +47 -0
  67. package/api/ml/createMessage.d.ts +42 -0
  68. package/api/ml/createMessage.js +50 -0
  69. package/api/ml/createModelMeta.d.ts +46 -0
  70. package/api/ml/createModelMeta.js +47 -0
  71. package/api/ml/deleteController.d.ts +30 -0
  72. package/api/ml/deleteController.js +49 -0
  73. package/api/ml/deleteMemory.d.ts +31 -0
  74. package/api/ml/deleteMemory.js +49 -0
  75. package/api/ml/executeAgent.d.ts +36 -0
  76. package/api/ml/executeAgent.js +50 -0
  77. package/api/ml/getAgent.d.ts +30 -0
  78. package/api/ml/getAgent.js +49 -0
  79. package/api/ml/getAllMemories.d.ts +34 -0
  80. package/api/ml/getAllMemories.js +48 -0
  81. package/api/ml/getAllMessages.d.ts +35 -0
  82. package/api/ml/getAllMessages.js +51 -0
  83. package/api/ml/getAllTools.d.ts +28 -0
  84. package/api/ml/getAllTools.js +45 -0
  85. package/api/ml/getController.d.ts +34 -0
  86. package/api/ml/getController.js +49 -0
  87. package/api/ml/getMemory.d.ts +30 -0
  88. package/api/ml/getMemory.js +49 -0
  89. package/api/ml/getMessage.d.ts +30 -0
  90. package/api/ml/getMessage.js +49 -0
  91. package/api/ml/getMessageTraces.d.ts +35 -0
  92. package/api/ml/getMessageTraces.js +51 -0
  93. package/api/ml/getModel.d.ts +30 -0
  94. package/api/ml/getModel.js +49 -0
  95. package/api/ml/getProfile.d.ts +30 -0
  96. package/api/ml/getProfile.js +47 -0
  97. package/api/ml/getProfileModels.d.ts +31 -0
  98. package/api/ml/getProfileModels.js +49 -0
  99. package/api/ml/getProfileTasks.d.ts +31 -0
  100. package/api/ml/getProfileTasks.js +49 -0
  101. package/api/ml/getStats.d.ts +31 -0
  102. package/api/ml/getStats.js +50 -0
  103. package/api/ml/getTool.d.ts +30 -0
  104. package/api/ml/getTool.js +49 -0
  105. package/api/ml/loadModel.d.ts +33 -0
  106. package/api/ml/loadModel.js +49 -0
  107. package/api/ml/predictModel.d.ts +36 -0
  108. package/api/ml/predictModel.js +50 -0
  109. package/api/ml/registerModel.d.ts +8 -3
  110. package/api/ml/registerModelMeta.d.ts +46 -0
  111. package/api/ml/registerModelMeta.js +47 -0
  112. package/api/ml/searchAgents.d.ts +36 -0
  113. package/api/ml/searchAgents.js +47 -0
  114. package/api/ml/searchMemory.d.ts +36 -0
  115. package/api/ml/searchMemory.js +47 -0
  116. package/api/ml/searchMessage.d.ts +37 -0
  117. package/api/ml/searchMessage.js +50 -0
  118. package/api/ml/searchModels.js +1 -1
  119. package/api/ml/searchTasks.d.ts +36 -0
  120. package/api/ml/searchTasks.js +47 -0
  121. package/api/ml/undeployModel.d.ts +8 -1
  122. package/api/ml/undeployModel.js +5 -5
  123. package/api/ml/unloadModel.d.ts +37 -0
  124. package/api/ml/unloadModel.js +49 -0
  125. package/api/ml/updateController.d.ts +37 -0
  126. package/api/ml/updateController.js +50 -0
  127. package/api/ml/updateMemory.d.ts +35 -0
  128. package/api/ml/updateMemory.js +50 -0
  129. package/api/ml/updateMessage.d.ts +40 -0
  130. package/api/ml/updateMessage.js +50 -0
  131. package/api/ml/updateModel.d.ts +44 -0
  132. package/api/ml/updateModel.js +50 -0
  133. package/api/ml/uploadChunk.d.ts +37 -0
  134. package/api/ml/uploadChunk.js +53 -0
  135. package/api/ml/uploadModel.d.ts +42 -0
  136. package/api/ml/uploadModel.js +47 -0
  137. package/index.d.ts +2 -0
  138. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_GetModel_Request extends Global.Params {
22
+ model_id: string;
23
+ }
24
+
25
+ export interface Ml_GetModel_Response extends ApiResponse {
26
+ body: Ml_GetModel_ResponseBody;
27
+ }
28
+
29
+ export type Ml_GetModel_ResponseBody = Ml_Common.Model
30
+
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
20
+
21
+ /**
22
+ * Retrieves a model.
23
+ * <br/> See Also: {@link undefined - ml.get_model}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} params
28
+ * @param {string} params.model_id
29
+ *
30
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
31
+ * @param {function} [callback] - Callback that handles errors and response
32
+ *
33
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
34
+ */
35
+ function getModelFunc(params, options, callback) {
36
+ [params, options, callback] = normalizeArguments(params, options, callback);
37
+ if (params.model_id == null) return handleMissingParam('model_id', this, callback);
38
+
39
+ let { body, model_id, ...querystring } = params;
40
+ model_id = parsePathParam(model_id);
41
+
42
+ const path = '/_plugins/_ml/models/' + model_id;
43
+ const method = 'GET';
44
+ body = body || '';
45
+
46
+ return this.transport.request({ method, path, querystring, body }, options, callback);
47
+ }
48
+
49
+ module.exports = getModelFunc;
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_GetProfile_Request extends Global.Params {
22
+ body?: Ml_Common.ProfileRequest;
23
+ }
24
+
25
+ export interface Ml_GetProfile_Response extends ApiResponse {
26
+ body: Ml_GetProfile_ResponseBody;
27
+ }
28
+
29
+ export type Ml_GetProfile_ResponseBody = Ml_Common.GetProfileResponse
30
+
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments } = require('../utils');
20
+
21
+ /**
22
+ * Get a profile.
23
+ * <br/> See Also: {@link undefined - ml.get_profile}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} [params]
28
+ * @param {object} [params.body]
29
+ *
30
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
31
+ * @param {function} [callback] - Callback that handles errors and response
32
+ *
33
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
34
+ */
35
+ function getProfileFunc(params, options, callback) {
36
+ [params, options, callback] = normalizeArguments(params, options, callback);
37
+
38
+ let { body, ...querystring } = params;
39
+
40
+ const path = '/_plugins/_ml/profile';
41
+ const method = 'GET';
42
+ body = body || '';
43
+
44
+ return this.transport.request({ method, path, querystring, body }, options, callback);
45
+ }
46
+
47
+ module.exports = getProfileFunc;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_GetProfileModels_Request extends Global.Params {
22
+ body?: Ml_Common.ProfileRequest;
23
+ model_id?: string;
24
+ }
25
+
26
+ export interface Ml_GetProfileModels_Response extends ApiResponse {
27
+ body: Ml_GetProfileModels_ResponseBody;
28
+ }
29
+
30
+ export type Ml_GetProfileModels_ResponseBody = Ml_Common.GetProfileResponse
31
+
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam } = require('../utils');
20
+
21
+ /**
22
+ * Get a profile models.
23
+ * <br/> See Also: {@link undefined - ml.get_profile_models}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} [params]
28
+ * @param {string} [params.model_id]
29
+ * @param {object} [params.body]
30
+ *
31
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
32
+ * @param {function} [callback] - Callback that handles errors and response
33
+ *
34
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
35
+ */
36
+ function getProfileModelsFunc(params, options, callback) {
37
+ [params, options, callback] = normalizeArguments(params, options, callback);
38
+
39
+ let { body, model_id, ...querystring } = params;
40
+ model_id = parsePathParam(model_id);
41
+
42
+ const path = ['/_plugins/_ml/profile/models', model_id].filter(c => c != null).join('/');
43
+ const method = 'GET';
44
+ body = body || '';
45
+
46
+ return this.transport.request({ method, path, querystring, body }, options, callback);
47
+ }
48
+
49
+ module.exports = getProfileModelsFunc;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_GetProfileTasks_Request extends Global.Params {
22
+ body?: Ml_Common.ProfileRequest;
23
+ task_id?: string;
24
+ }
25
+
26
+ export interface Ml_GetProfileTasks_Response extends ApiResponse {
27
+ body: Ml_GetProfileTasks_ResponseBody;
28
+ }
29
+
30
+ export type Ml_GetProfileTasks_ResponseBody = Ml_Common.GetProfileResponse
31
+
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam } = require('../utils');
20
+
21
+ /**
22
+ * Get a profile tasks.
23
+ * <br/> See Also: {@link undefined - ml.get_profile_tasks}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} [params]
28
+ * @param {string} [params.task_id]
29
+ * @param {object} [params.body]
30
+ *
31
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
32
+ * @param {function} [callback] - Callback that handles errors and response
33
+ *
34
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
35
+ */
36
+ function getProfileTasksFunc(params, options, callback) {
37
+ [params, options, callback] = normalizeArguments(params, options, callback);
38
+
39
+ let { body, task_id, ...querystring } = params;
40
+ task_id = parsePathParam(task_id);
41
+
42
+ const path = ['/_plugins/_ml/profile/tasks', task_id].filter(c => c != null).join('/');
43
+ const method = 'GET';
44
+ body = body || '';
45
+
46
+ return this.transport.request({ method, path, querystring, body }, options, callback);
47
+ }
48
+
49
+ module.exports = getProfileTasksFunc;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_GetStats_Request extends Global.Params {
22
+ node_id?: string;
23
+ stat?: 'ml_config_index_status' | 'ml_connector_count' | 'ml_connector_index_status' | 'ml_controller_index_status' | 'ml_model_count' | 'ml_model_index_status' | 'ml_task_index_status';
24
+ }
25
+
26
+ export interface Ml_GetStats_Response extends ApiResponse {
27
+ body: Ml_GetStats_ResponseBody;
28
+ }
29
+
30
+ export type Ml_GetStats_ResponseBody = Ml_Common.GetStatsResponse
31
+
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam } = require('../utils');
20
+
21
+ /**
22
+ * Get stats.
23
+ * <br/> See Also: {@link undefined - ml.get_stats}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} [params]
28
+ * @param {string} [params.node_id]
29
+ * @param {string} [params.stat]
30
+ *
31
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
32
+ * @param {function} [callback] - Callback that handles errors and response
33
+ *
34
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
35
+ */
36
+ function getStatsFunc(params, options, callback) {
37
+ [params, options, callback] = normalizeArguments(params, options, callback);
38
+
39
+ let { body, node_id, stat, ...querystring } = params;
40
+ node_id = parsePathParam(node_id);
41
+ stat = parsePathParam(stat);
42
+
43
+ const path = ['/_plugins/_ml', node_id, 'stats', stat].filter(c => c != null).join('/');
44
+ const method = 'GET';
45
+ body = body || '';
46
+
47
+ return this.transport.request({ method, path, querystring, body }, options, callback);
48
+ }
49
+
50
+ module.exports = getStatsFunc;
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_GetTool_Request extends Global.Params {
22
+ tool_name: 'AgentTool' | 'CatIndexTool' | 'ConnectorTool' | 'CreateAnomalyDetectorTool' | 'IndexMappingTool' | 'LogPatternTool' | 'MLModelTool' | 'NeuralSparseSearchTool' | 'PPLTool' | 'RAGTool' | 'SearchAlertsTool' | 'SearchAnomalyDetectorsTool' | 'SearchAnomalyResultsTool' | 'SearchIndexTool' | 'SearchMonitorsTool' | 'VectorDBTool' | 'VisualizationTool';
23
+ }
24
+
25
+ export interface Ml_GetTool_Response extends ApiResponse {
26
+ body: Ml_GetTool_ResponseBody;
27
+ }
28
+
29
+ export type Ml_GetTool_ResponseBody = Ml_Common.Tool
30
+
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
20
+
21
+ /**
22
+ * Get tools.
23
+ * <br/> See Also: {@link undefined - ml.get_tool}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} params
28
+ * @param {string} params.tool_name
29
+ *
30
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
31
+ * @param {function} [callback] - Callback that handles errors and response
32
+ *
33
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
34
+ */
35
+ function getToolFunc(params, options, callback) {
36
+ [params, options, callback] = normalizeArguments(params, options, callback);
37
+ if (params.tool_name == null) return handleMissingParam('tool_name', this, callback);
38
+
39
+ let { body, tool_name, ...querystring } = params;
40
+ tool_name = parsePathParam(tool_name);
41
+
42
+ const path = '/_plugins/_ml/tools/' + tool_name;
43
+ const method = 'GET';
44
+ body = body || '';
45
+
46
+ return this.transport.request({ method, path, querystring, body }, options, callback);
47
+ }
48
+
49
+ module.exports = getToolFunc;
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+
20
+ export interface Ml_LoadModel_Request extends Global.Params {
21
+ model_id: string;
22
+ }
23
+
24
+ export interface Ml_LoadModel_Response extends ApiResponse {
25
+ body: Ml_LoadModel_ResponseBody;
26
+ }
27
+
28
+ export type Ml_LoadModel_ResponseBody = {
29
+ status: string;
30
+ task_id: string;
31
+ task_type: 'BATCH_INGEST' | 'BATCH_PREDICTION' | 'DEPLOY_MODEL' | 'EXECUTION' | 'PREDICTION' | 'REGISTER_MODEL' | 'TRAINING' | 'TRAINING_AND_PREDICTION';
32
+ }
33
+
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
20
+
21
+ /**
22
+ * Deploys a model.
23
+ * <br/> See Also: {@link undefined - ml.load_model}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} params
28
+ * @param {string} params.model_id
29
+ *
30
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
31
+ * @param {function} [callback] - Callback that handles errors and response
32
+ *
33
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
34
+ */
35
+ function loadModelFunc(params, options, callback) {
36
+ [params, options, callback] = normalizeArguments(params, options, callback);
37
+ if (params.model_id == null) return handleMissingParam('model_id', this, callback);
38
+
39
+ let { body, model_id, ...querystring } = params;
40
+ model_id = parsePathParam(model_id);
41
+
42
+ const path = '/_plugins/_ml/models/' + model_id + '/_load';
43
+ const method = 'POST';
44
+ body = body || '';
45
+
46
+ return this.transport.request({ method, path, querystring, body }, options, callback);
47
+ }
48
+
49
+ module.exports = loadModelFunc;
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ import { ApiResponse } from '../../lib/Transport'
18
+ import * as Global from '../_types/_global'
19
+ import * as Ml_Common from '../_types/ml._common'
20
+
21
+ export interface Ml_PredictModel_Request extends Global.Params {
22
+ body?: Ml_PredictModel_RequestBody;
23
+ model_id: string;
24
+ }
25
+
26
+ export type Ml_PredictModel_RequestBody = {
27
+ query_text?: string;
28
+ text_docs: string[];
29
+ }
30
+
31
+ export interface Ml_PredictModel_Response extends ApiResponse {
32
+ body: Ml_PredictModel_ResponseBody;
33
+ }
34
+
35
+ export type Ml_PredictModel_ResponseBody = Ml_Common.PredictModelResponse
36
+
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Copyright OpenSearch Contributors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * The OpenSearch Contributors require contributions made to
6
+ * this file be licensed under the Apache-2.0 license or a
7
+ * compatible open source license.
8
+ *
9
+ */
10
+
11
+ /*
12
+ * This file was generated from the OpenSearch API Spec. Do NOT edit it
13
+ * manually. If you want to make changes, either update the spec or
14
+ * modify the API generator.
15
+ */
16
+
17
+ 'use strict';
18
+
19
+ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../utils');
20
+
21
+ /**
22
+ * Predicts a model.
23
+ * <br/> See Also: {@link undefined - ml.predict_model}
24
+ *
25
+ * @memberOf API-Ml
26
+ *
27
+ * @param {object} params
28
+ * @param {string} params.model_id
29
+ * @param {object} [params.body]
30
+ *
31
+ * @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
32
+ * @param {function} [callback] - Callback that handles errors and response
33
+ *
34
+ * @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
35
+ */
36
+ function predictModelFunc(params, options, callback) {
37
+ [params, options, callback] = normalizeArguments(params, options, callback);
38
+ if (params.model_id == null) return handleMissingParam('model_id', this, callback);
39
+
40
+ let { body, model_id, ...querystring } = params;
41
+ model_id = parsePathParam(model_id);
42
+
43
+ const path = '/_plugins/_ml/models/' + model_id + '/_predict';
44
+ const method = 'POST';
45
+ body = body || '';
46
+
47
+ return this.transport.request({ method, path, querystring, body }, options, callback);
48
+ }
49
+
50
+ module.exports = predictModelFunc;