diff --git a/api/api/fleet.js b/api/api/fleet.js new file mode 100644 index 000000000..50329860d --- /dev/null +++ b/api/api/fleet.js @@ -0,0 +1,65 @@ +/* + * 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_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path' } + +function FleetApi (transport, ConfigurationError) { + this.transport = transport + this[kConfigurationError] = ConfigurationError +} + +FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (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) + '/' + '_fleet' + '/' + 'global_checkpoints' + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + +Object.defineProperties(FleetApi.prototype, { + global_checkpoints: { get () { return this.globalCheckpoints } } +}) + +module.exports = FleetApi diff --git a/api/api/monitoring.js b/api/api/monitoring.js index 531a8b068..5366bd517 100644 --- a/api/api/monitoring.js +++ b/api/api/monitoring.js @@ -56,7 +56,7 @@ MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, call const request = { method, path, - body: body || '', + bulkBody: body, querystring } diff --git a/api/api/searchable_snapshots.js b/api/api/searchable_snapshots.js index 5b7e42b32..3828a2474 100644 --- a/api/api/searchable_snapshots.js +++ b/api/api/searchable_snapshots.js @@ -23,14 +23,40 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage', 'level'] -const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' } +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'master_timeout', 'wait_for_completion', 'storage', 'level'] +const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' } function SearchableSnapshotsApi (transport, ConfigurationError) { this.transport = transport this[kConfigurationError] = ConfigurationError } +SearchableSnapshotsApi.prototype.cacheStats = function searchableSnapshotsCacheStatsApi (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 = '/' + '_searchable_snapshots' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'cache' + '/' + 'stats' + } else { + if (method == null) method = 'GET' + path = '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'stats' + } + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + SearchableSnapshotsApi.prototype.clearCache = function searchableSnapshotsClearCacheApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -152,6 +178,7 @@ SearchableSnapshotsApi.prototype.stats = function searchableSnapshotsStatsApi (p } Object.defineProperties(SearchableSnapshotsApi.prototype, { + cache_stats: { get () { return this.cacheStats } }, clear_cache: { get () { return this.clearCache } }, repository_stats: { get () { return this.repositoryStats } } }) diff --git a/api/api/security.js b/api/api/security.js index 389dd6d4a..96d775dc5 100644 --- a/api/api/security.js +++ b/api/api/security.js @@ -192,6 +192,50 @@ SecurityApi.prototype.clearCachedRoles = function securityClearCachedRolesApi (p return this.transport.request(request, options, callback) } +SecurityApi.prototype.clearCachedServiceTokens = function securityClearCachedServiceTokensApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.namespace == null) { + const err = new this[kConfigurationError]('Missing required parameter: namespace') + return handleError(err, callback) + } + if (params.service == null) { + const err = new this[kConfigurationError]('Missing required parameter: service') + 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.service == null || params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace') + return handleError(err, callback) + } else if (params.service != null && (params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: namespace') + return handleError(err, callback) + } + + let { method, body, namespace, service, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'POST' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name) + '/' + '_clear_cache' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -219,6 +263,51 @@ SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, o return this.transport.request(request, options, callback) } +SecurityApi.prototype.createServiceToken = function securityCreateServiceTokenApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.namespace == null) { + const err = new this[kConfigurationError]('Missing required parameter: namespace') + return handleError(err, callback) + } + if (params.service == null) { + const err = new this[kConfigurationError]('Missing required parameter: service') + return handleError(err, callback) + } + + // check required url components + if (params.name != null && (params.service == null || params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace') + return handleError(err, callback) + } else if (params.service != null && (params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: namespace') + return handleError(err, callback) + } + + let { method, body, namespace, service, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if ((namespace) != null && (service) != null && (name) != null) { + if (method == null) method = 'PUT' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name) + } else { + if (method == null) method = 'POST' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + } + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + SecurityApi.prototype.deletePrivileges = function securityDeletePrivilegesApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -310,6 +399,50 @@ SecurityApi.prototype.deleteRoleMapping = function securityDeleteRoleMappingApi return this.transport.request(request, options, callback) } +SecurityApi.prototype.deleteServiceToken = function securityDeleteServiceTokenApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.namespace == null) { + const err = new this[kConfigurationError]('Missing required parameter: namespace') + return handleError(err, callback) + } + if (params.service == null) { + const err = new this[kConfigurationError]('Missing required parameter: service') + 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.service == null || params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace') + return handleError(err, callback) + } else if (params.service != null && (params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: namespace') + return handleError(err, callback) + } + + let { method, body, namespace, service, name, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'DELETE' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name) + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + SecurityApi.prototype.deleteUser = function securityDeleteUserApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -520,6 +653,78 @@ SecurityApi.prototype.getRoleMapping = function securityGetRoleMappingApi (param return this.transport.request(request, options, callback) } +SecurityApi.prototype.getServiceAccounts = function securityGetServiceAccountsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required url components + if (params.service != null && (params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: namespace') + return handleError(err, callback) + } + + let { method, body, namespace, service, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if ((namespace) != null && (service) != null) { + if (method == null) method = 'GET' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + } else if ((namespace) != null) { + if (method == null) method = 'GET' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + } else { + if (method == null) method = 'GET' + path = '/' + '_security' + '/' + 'service' + } + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + +SecurityApi.prototype.getServiceCredentials = function securityGetServiceCredentialsApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + // check required parameters + if (params.namespace == null) { + const err = new this[kConfigurationError]('Missing required parameter: namespace') + return handleError(err, callback) + } + if (params.service == null) { + const err = new this[kConfigurationError]('Missing required parameter: service') + return handleError(err, callback) + } + + // check required url components + if (params.service != null && (params.namespace == null)) { + const err = new this[kConfigurationError]('Missing required parameter of the url: namespace') + return handleError(err, callback) + } + + let { method, body, namespace, service, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = 'GET' + path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + + // build request object + const request = { + method, + path, + body: null, + querystring + } + + return this.transport.request(request, options, callback) +} + SecurityApi.prototype.getToken = function securityGetTokenApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -833,10 +1038,13 @@ Object.defineProperties(SecurityApi.prototype, { clear_cached_privileges: { get () { return this.clearCachedPrivileges } }, clear_cached_realms: { get () { return this.clearCachedRealms } }, clear_cached_roles: { get () { return this.clearCachedRoles } }, + clear_cached_service_tokens: { get () { return this.clearCachedServiceTokens } }, create_api_key: { get () { return this.createApiKey } }, + create_service_token: { get () { return this.createServiceToken } }, delete_privileges: { get () { return this.deletePrivileges } }, delete_role: { get () { return this.deleteRole } }, delete_role_mapping: { get () { return this.deleteRoleMapping } }, + delete_service_token: { get () { return this.deleteServiceToken } }, delete_user: { get () { return this.deleteUser } }, disable_user: { get () { return this.disableUser } }, enable_user: { get () { return this.enableUser } }, @@ -845,6 +1053,8 @@ Object.defineProperties(SecurityApi.prototype, { get_privileges: { get () { return this.getPrivileges } }, get_role: { get () { return this.getRole } }, get_role_mapping: { get () { return this.getRoleMapping } }, + get_service_accounts: { get () { return this.getServiceAccounts } }, + get_service_credentials: { get () { return this.getServiceCredentials } }, get_token: { get () { return this.getToken } }, get_user: { get () { return this.getUser } }, get_user_privileges: { get () { return this.getUserPrivileges } }, diff --git a/api/api/snapshot.js b/api/api/snapshot.js index 35de58733..911d13f2d 100644 --- a/api/api/snapshot.js +++ b/api/api/snapshot.js @@ -23,8 +23,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'verbose', 'local'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable' } +const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'verbose', 'local'] +const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details' } function SnapshotApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/index.js b/api/index.js index e3f2a4cac..ca8bb5d80 100644 --- a/api/index.js +++ b/api/index.js @@ -41,6 +41,7 @@ const existsSourceApi = require('./api/exists_source') const explainApi = require('./api/explain') const FeaturesApi = require('./api/features') const fieldCapsApi = require('./api/field_caps') +const FleetApi = require('./api/fleet') const getApi = require('./api/get') const getScriptApi = require('./api/get_script') const getScriptContextApi = require('./api/get_script_context') @@ -102,6 +103,7 @@ const kDanglingIndices = Symbol('DanglingIndices') const kEnrich = Symbol('Enrich') const kEql = Symbol('Eql') const kFeatures = Symbol('Features') +const kFleet = Symbol('Fleet') const kGraph = Symbol('Graph') const kIlm = Symbol('Ilm') const kIndices = Symbol('Indices') @@ -137,6 +139,7 @@ function ESAPI (opts) { this[kEnrich] = null this[kEql] = null this[kFeatures] = null + this[kFleet] = null this[kGraph] = null this[kIlm] = null this[kIndices] = null @@ -285,6 +288,14 @@ Object.defineProperties(ESAPI.prototype, { } }, field_caps: { get () { return this.fieldCaps } }, + fleet: { + get () { + if (this[kFleet] === null) { + this[kFleet] = new FleetApi(this.transport, this[kConfigurationError]) + } + return this[kFleet] + } + }, get_script: { get () { return this.getScript } }, get_script_context: { get () { return this.getScriptContext } }, get_script_languages: { get () { return this.getScriptLanguages } }, diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 0a72bcc01..7dbcb62a4 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -818,6 +818,14 @@ export interface FieldCaps extends Generic { body?: T; } +export interface FleetGlobalCheckpoints extends Generic { + index: string; + wait_for_advance?: boolean; + wait_for_index?: boolean; + checkpoints?: string | string[]; + timeout?: string; +} + export interface Get extends Generic { id: string; index: string; @@ -1936,7 +1944,7 @@ export interface MlValidateDetector extends Generic { body: T; } -export interface MonitoringBulk extends Generic { +export interface MonitoringBulk extends Generic { type?: string; system_id?: string; system_api_version?: string; @@ -2217,6 +2225,10 @@ export interface SearchTemplate extends Generic { body: T; } +export interface SearchableSnapshotsCacheStats extends Generic { + node_id?: string | string[]; +} + export interface SearchableSnapshotsClearCache extends Generic { index?: string | string[]; ignore_unavailable?: boolean; @@ -2268,11 +2280,24 @@ export interface SecurityClearCachedRoles extends Generic { name: string | string[]; } +export interface SecurityClearCachedServiceTokens extends Generic { + namespace: string; + service: string; + name: string | string[]; +} + export interface SecurityCreateApiKey extends Generic { refresh?: 'wait_for' | boolean; body: T; } +export interface SecurityCreateServiceToken extends Generic { + namespace: string; + service: string; + name?: string; + refresh?: 'wait_for' | boolean; +} + export interface SecurityDeletePrivileges extends Generic { application: string; name: string; @@ -2289,6 +2314,13 @@ export interface SecurityDeleteRoleMapping extends Generic { refresh?: 'wait_for' | boolean; } +export interface SecurityDeleteServiceToken extends Generic { + namespace: string; + service: string; + name: string; + refresh?: 'wait_for' | boolean; +} + export interface SecurityDeleteUser extends Generic { username: string; refresh?: 'wait_for' | boolean; @@ -2328,6 +2360,16 @@ export interface SecurityGetRoleMapping extends Generic { name?: string | string[]; } +export interface SecurityGetServiceAccounts extends Generic { + namespace?: string; + service?: string; +} + +export interface SecurityGetServiceCredentials extends Generic { + namespace: string; + service: string; +} + export interface SecurityGetToken extends Generic { body: T; } @@ -2472,6 +2514,7 @@ export interface SnapshotGet extends Generic { snapshot: string | string[]; master_timeout?: string; ignore_unavailable?: boolean; + index_details?: boolean; verbose?: boolean; } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 56e51fdee..2f99aac55 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -2078,7 +2078,7 @@ client.cluster.getSettings({ include_defaults: boolean }) ---- -link:{ref}/cluster-update-settings.html[Documentation] + +link:{ref}/cluster-get-settings.html[Documentation] + [cols=2*] |=== |`flat_settings` or `flatSettings` @@ -3337,6 +3337,41 @@ _Default:_ `open` |=== +[discrete] +=== fleet.globalCheckpoints +*Stability:* experimental +[source,ts] +---- +client.fleet.globalCheckpoints({ + index: string, + wait_for_advance: boolean, + wait_for_index: boolean, + checkpoints: string | string[], + timeout: string +}) +---- +[cols=2*] +|=== +|`index` +|`string` - The name of the index. + +|`wait_for_advance` or `waitForAdvance` +|`boolean` - Whether to wait for the global checkpoint to advance past the specified current checkpoints + +_Default:_ `false` + +|`wait_for_index` or `waitForIndex` +|`boolean` - Whether to wait for the target index to exist and all primary shards be active + +_Default:_ `false` + +|`checkpoints` +|`string \| string[]` - Comma separated list of checkpoints + +|`timeout` +|`string` - Timeout to wait for global checkpoint to advance + +_Default:_ `30s` + +|=== + [discrete] === get @@ -6238,7 +6273,7 @@ link:{ref}/ml-delete-calendar-job.html[Documentation] + [discrete] === ml.deleteDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.deleteDataFrameAnalytics({ @@ -6406,7 +6441,7 @@ link:{ref}/ml-delete-snapshot.html[Documentation] + [discrete] === ml.deleteTrainedModel -*Stability:* beta + [source,ts] ---- client.ml.deleteTrainedModel({ @@ -6423,7 +6458,7 @@ link:{ref}/delete-trained-models.html[Documentation] + [discrete] === ml.deleteTrainedModelAlias -*Stability:* beta + [source,ts] ---- client.ml.deleteTrainedModelAlias({ @@ -6461,7 +6496,7 @@ link:{ref}/ml-apis.html[Documentation] + [discrete] === ml.evaluateDataFrame -*Stability:* beta + [source,ts] ---- client.ml.evaluateDataFrame({ @@ -6478,7 +6513,7 @@ link:{ref}/evaluate-dfanalytics.html[Documentation] + [discrete] === ml.explainDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.explainDataFrameAnalytics({ @@ -6809,7 +6844,7 @@ link:{ref}/ml-get-category.html[Documentation] + [discrete] === ml.getDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.getDataFrameAnalytics({ @@ -6844,7 +6879,7 @@ _Default:_ `100` [discrete] === ml.getDataFrameAnalyticsStats -*Stability:* beta + [source,ts] ---- client.ml.getDataFrameAnalyticsStats({ @@ -7230,7 +7265,7 @@ link:{ref}/ml-get-record.html[Documentation] + [discrete] === ml.getTrainedModels -*Stability:* beta + [source,ts] ---- client.ml.getTrainedModels({ @@ -7284,7 +7319,7 @@ _Default:_ `100` [discrete] === ml.getTrainedModelsStats -*Stability:* beta + [source,ts] ---- client.ml.getTrainedModelsStats({ @@ -7392,7 +7427,7 @@ link:{ref}/ml-post-data.html[Documentation] + [discrete] === ml.previewDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.previewDataFrameAnalytics({ @@ -7476,7 +7511,7 @@ link:{ref}/ml-put-calendar-job.html[Documentation] + [discrete] === ml.putDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.putDataFrameAnalytics({ @@ -7576,7 +7611,7 @@ link:{ref}/ml-put-job.html[Documentation] + [discrete] === ml.putTrainedModel -*Stability:* beta + [source,ts] ---- client.ml.putTrainedModel({ @@ -7597,7 +7632,7 @@ link:{ref}/put-trained-models.html[Documentation] + [discrete] === ml.putTrainedModelAlias -*Stability:* beta + [source,ts] ---- client.ml.putTrainedModelAlias({ @@ -7672,7 +7707,7 @@ link:{ref}/ml-set-upgrade-mode.html[Documentation] + [discrete] === ml.startDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.startDataFrameAnalytics({ @@ -7730,7 +7765,7 @@ link:{ref}/ml-start-datafeed.html[Documentation] + [discrete] === ml.stopDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.stopDataFrameAnalytics({ @@ -7802,7 +7837,7 @@ WARNING: This parameter has been deprecated. [discrete] === ml.updateDataFrameAnalytics -*Stability:* beta + [source,ts] ---- client.ml.updateDataFrameAnalytics({ @@ -9165,6 +9200,23 @@ _Default:_ `true` |=== +[discrete] +=== searchableSnapshots.cacheStats +*Stability:* experimental +[source,ts] +---- +client.searchableSnapshots.cacheStats({ + node_id: string | string[] +}) +---- +link:{ref}/searchable-snapshots-apis.html[Documentation] + +[cols=2*] +|=== +|`node_id` or `nodeId` +|`string \| string[]` - 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 + +|=== + [discrete] === searchableSnapshots.clearCache *Stability:* experimental @@ -9378,6 +9430,31 @@ link:{ref}/security-api-clear-role-cache.html[Documentation] + |=== +[discrete] +=== security.clearCachedServiceTokens +*Stability:* beta +[source,ts] +---- +client.security.clearCachedServiceTokens({ + namespace: string, + service: string, + name: string | string[] +}) +---- +link:{ref}/security-api-clear-service-token-caches.html[Documentation] + +[cols=2*] +|=== +|`namespace` +|`string` - An identifier for the namespace + +|`service` +|`string` - An identifier for the service name + +|`name` +|`string \| string[]` - A comma-separated list of service token names + +|=== + [discrete] === security.createApiKey @@ -9399,6 +9476,35 @@ link:{ref}/security-api-create-api-key.html[Documentation] + |=== +[discrete] +=== security.createServiceToken +*Stability:* beta +[source,ts] +---- +client.security.createServiceToken({ + namespace: string, + service: string, + name: string, + refresh: 'true' | 'false' | 'wait_for' +}) +---- +link:{ref}/security-api-create-service-token.html[Documentation] + +[cols=2*] +|=== +|`namespace` +|`string` - An identifier for the namespace + +|`service` +|`string` - An identifier for the service name + +|`name` +|`string` - An identifier for the token name + +|`refresh` +|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. + +|=== + [discrete] === security.deletePrivileges @@ -9466,6 +9572,35 @@ link:{ref}/security-api-delete-role-mapping.html[Documentation] + |=== +[discrete] +=== security.deleteServiceToken +*Stability:* beta +[source,ts] +---- +client.security.deleteServiceToken({ + namespace: string, + service: string, + name: string, + refresh: 'true' | 'false' | 'wait_for' +}) +---- +link:{ref}/security-api-delete-service-token.html[Documentation] + +[cols=2*] +|=== +|`namespace` +|`string` - An identifier for the namespace + +|`service` +|`string` - An identifier for the service name + +|`name` +|`string` - An identifier for the token name + +|`refresh` +|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. + +|=== + [discrete] === security.deleteUser @@ -9627,6 +9762,48 @@ link:{ref}/security-api-get-role-mapping.html[Documentation] + |=== +[discrete] +=== security.getServiceAccounts +*Stability:* beta +[source,ts] +---- +client.security.getServiceAccounts({ + namespace: string, + service: string +}) +---- +link:{ref}/security-api-get-service-accounts.html[Documentation] + +[cols=2*] +|=== +|`namespace` +|`string` - An identifier for the namespace + +|`service` +|`string` - An identifier for the service name + +|=== + +[discrete] +=== security.getServiceCredentials +*Stability:* beta +[source,ts] +---- +client.security.getServiceCredentials({ + namespace: string, + service: string +}) +---- +link:{ref}/security-api-get-service-credentials.html[Documentation] + +[cols=2*] +|=== +|`namespace` +|`string` - An identifier for the namespace + +|`service` +|`string` - An identifier for the service name + +|=== + [discrete] === security.getToken @@ -10204,6 +10381,7 @@ client.snapshot.get({ snapshot: string | string[], master_timeout: string, ignore_unavailable: boolean, + index_details: boolean, verbose: boolean }) ---- @@ -10222,6 +10400,9 @@ link:{ref}/modules-snapshots.html[Documentation] + |`ignore_unavailable` or `ignoreUnavailable` |`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown +|`index_details` or `indexDetails` +|`boolean` - Whether to include details of each index in the snapshot, if those details are available. Defaults to false. + |`verbose` |`boolean` - Whether to show verbose snapshot info or only show the basic info found in the repository index blob diff --git a/index.d.ts b/index.d.ts index d7d82cd27..fd0ec3d52 100644 --- a/index.d.ts +++ b/index.d.ts @@ -747,6 +747,16 @@ declare class Client { fieldCaps, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback fieldCaps, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.FieldCaps, callback: callbackFn): TransportRequestCallback fieldCaps, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.FieldCaps, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + fleet: { + global_checkpoints, TContext = Context>(params?: RequestParams.FleetGlobalCheckpoints, options?: TransportRequestOptions): TransportRequestPromise> + global_checkpoints, TContext = Context>(callback: callbackFn): TransportRequestCallback + global_checkpoints, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, callback: callbackFn): TransportRequestCallback + global_checkpoints, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + globalCheckpoints, TContext = Context>(params?: RequestParams.FleetGlobalCheckpoints, options?: TransportRequestOptions): TransportRequestPromise> + globalCheckpoints, TContext = Context>(callback: callbackFn): TransportRequestCallback + globalCheckpoints, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, callback: callbackFn): TransportRequestCallback + globalCheckpoints, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + } get, TContext = Context>(params?: RequestParams.Get, options?: TransportRequestOptions): TransportRequestPromise> get, TContext = Context>(callback: callbackFn): TransportRequestCallback get, TContext = Context>(params: RequestParams.Get, callback: callbackFn): TransportRequestCallback @@ -1860,10 +1870,10 @@ declare class Client { validateDetector, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlValidateDetector, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } monitoring: { - bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MonitoringBulk, options?: TransportRequestOptions): TransportRequestPromise> - bulk, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MonitoringBulk, callback: callbackFn): TransportRequestCallback - bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MonitoringBulk, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MonitoringBulk, options?: TransportRequestOptions): TransportRequestPromise> + bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MonitoringBulk, callback: callbackFn): TransportRequestCallback + bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MonitoringBulk, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } msearch, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.Msearch, options?: TransportRequestOptions): TransportRequestPromise> msearch, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback @@ -2062,6 +2072,14 @@ declare class Client { searchTemplate, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SearchTemplate, callback: callbackFn): TransportRequestCallback searchTemplate, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SearchTemplate, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback searchable_snapshots: { + cache_stats, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise> + cache_stats, TContext = Context>(callback: callbackFn): TransportRequestCallback + cache_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn): TransportRequestCallback + cache_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + cacheStats, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise> + cacheStats, TContext = Context>(callback: callbackFn): TransportRequestCallback + cacheStats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn): TransportRequestCallback + cacheStats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback clear_cache, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise> clear_cache, TContext = Context>(callback: callbackFn): TransportRequestCallback clear_cache, TContext = Context>(params: RequestParams.SearchableSnapshotsClearCache, callback: callbackFn): TransportRequestCallback @@ -2088,6 +2106,14 @@ declare class Client { stats, TContext = Context>(params: RequestParams.SearchableSnapshotsStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } searchableSnapshots: { + cache_stats, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise> + cache_stats, TContext = Context>(callback: callbackFn): TransportRequestCallback + cache_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn): TransportRequestCallback + cache_stats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + cacheStats, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise> + cacheStats, TContext = Context>(callback: callbackFn): TransportRequestCallback + cacheStats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn): TransportRequestCallback + cacheStats, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback clear_cache, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise> clear_cache, TContext = Context>(callback: callbackFn): TransportRequestCallback clear_cache, TContext = Context>(params: RequestParams.SearchableSnapshotsClearCache, callback: callbackFn): TransportRequestCallback @@ -2158,6 +2184,14 @@ declare class Client { clearCachedRoles, TContext = Context>(callback: callbackFn): TransportRequestCallback clearCachedRoles, TContext = Context>(params: RequestParams.SecurityClearCachedRoles, callback: callbackFn): TransportRequestCallback clearCachedRoles, TContext = Context>(params: RequestParams.SecurityClearCachedRoles, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + clear_cached_service_tokens, TContext = Context>(params?: RequestParams.SecurityClearCachedServiceTokens, options?: TransportRequestOptions): TransportRequestPromise> + clear_cached_service_tokens, TContext = Context>(callback: callbackFn): TransportRequestCallback + clear_cached_service_tokens, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, callback: callbackFn): TransportRequestCallback + clear_cached_service_tokens, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + clearCachedServiceTokens, TContext = Context>(params?: RequestParams.SecurityClearCachedServiceTokens, options?: TransportRequestOptions): TransportRequestPromise> + clearCachedServiceTokens, TContext = Context>(callback: callbackFn): TransportRequestCallback + clearCachedServiceTokens, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, callback: callbackFn): TransportRequestCallback + clearCachedServiceTokens, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback create_api_key, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.SecurityCreateApiKey, options?: TransportRequestOptions): TransportRequestPromise> create_api_key, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback create_api_key, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityCreateApiKey, callback: callbackFn): TransportRequestCallback @@ -2166,6 +2200,14 @@ declare class Client { createApiKey, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback createApiKey, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityCreateApiKey, callback: callbackFn): TransportRequestCallback createApiKey, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityCreateApiKey, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + create_service_token, TContext = Context>(params?: RequestParams.SecurityCreateServiceToken, options?: TransportRequestOptions): TransportRequestPromise> + create_service_token, TContext = Context>(callback: callbackFn): TransportRequestCallback + create_service_token, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, callback: callbackFn): TransportRequestCallback + create_service_token, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + createServiceToken, TContext = Context>(params?: RequestParams.SecurityCreateServiceToken, options?: TransportRequestOptions): TransportRequestPromise> + createServiceToken, TContext = Context>(callback: callbackFn): TransportRequestCallback + createServiceToken, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, callback: callbackFn): TransportRequestCallback + createServiceToken, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback delete_privileges, TContext = Context>(params?: RequestParams.SecurityDeletePrivileges, options?: TransportRequestOptions): TransportRequestPromise> delete_privileges, TContext = Context>(callback: callbackFn): TransportRequestCallback delete_privileges, TContext = Context>(params: RequestParams.SecurityDeletePrivileges, callback: callbackFn): TransportRequestCallback @@ -2190,6 +2232,14 @@ declare class Client { deleteRoleMapping, TContext = Context>(callback: callbackFn): TransportRequestCallback deleteRoleMapping, TContext = Context>(params: RequestParams.SecurityDeleteRoleMapping, callback: callbackFn): TransportRequestCallback deleteRoleMapping, TContext = Context>(params: RequestParams.SecurityDeleteRoleMapping, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + delete_service_token, TContext = Context>(params?: RequestParams.SecurityDeleteServiceToken, options?: TransportRequestOptions): TransportRequestPromise> + delete_service_token, TContext = Context>(callback: callbackFn): TransportRequestCallback + delete_service_token, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, callback: callbackFn): TransportRequestCallback + delete_service_token, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + deleteServiceToken, TContext = Context>(params?: RequestParams.SecurityDeleteServiceToken, options?: TransportRequestOptions): TransportRequestPromise> + deleteServiceToken, TContext = Context>(callback: callbackFn): TransportRequestCallback + deleteServiceToken, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, callback: callbackFn): TransportRequestCallback + deleteServiceToken, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback delete_user, TContext = Context>(params?: RequestParams.SecurityDeleteUser, options?: TransportRequestOptions): TransportRequestPromise> delete_user, TContext = Context>(callback: callbackFn): TransportRequestCallback delete_user, TContext = Context>(params: RequestParams.SecurityDeleteUser, callback: callbackFn): TransportRequestCallback @@ -2254,6 +2304,22 @@ declare class Client { getRoleMapping, TContext = Context>(callback: callbackFn): TransportRequestCallback getRoleMapping, TContext = Context>(params: RequestParams.SecurityGetRoleMapping, callback: callbackFn): TransportRequestCallback getRoleMapping, TContext = Context>(params: RequestParams.SecurityGetRoleMapping, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + get_service_accounts, TContext = Context>(params?: RequestParams.SecurityGetServiceAccounts, options?: TransportRequestOptions): TransportRequestPromise> + get_service_accounts, TContext = Context>(callback: callbackFn): TransportRequestCallback + get_service_accounts, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, callback: callbackFn): TransportRequestCallback + get_service_accounts, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + getServiceAccounts, TContext = Context>(params?: RequestParams.SecurityGetServiceAccounts, options?: TransportRequestOptions): TransportRequestPromise> + getServiceAccounts, TContext = Context>(callback: callbackFn): TransportRequestCallback + getServiceAccounts, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, callback: callbackFn): TransportRequestCallback + getServiceAccounts, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + get_service_credentials, TContext = Context>(params?: RequestParams.SecurityGetServiceCredentials, options?: TransportRequestOptions): TransportRequestPromise> + get_service_credentials, TContext = Context>(callback: callbackFn): TransportRequestCallback + get_service_credentials, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, callback: callbackFn): TransportRequestCallback + get_service_credentials, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + getServiceCredentials, TContext = Context>(params?: RequestParams.SecurityGetServiceCredentials, options?: TransportRequestOptions): TransportRequestPromise> + getServiceCredentials, TContext = Context>(callback: callbackFn): TransportRequestCallback + getServiceCredentials, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, callback: callbackFn): TransportRequestCallback + getServiceCredentials, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback get_token, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.SecurityGetToken, options?: TransportRequestOptions): TransportRequestPromise> get_token, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback get_token, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityGetToken, callback: callbackFn): TransportRequestCallback