From 8fac57ab5c8cd008c82a99a67e7018a78faae1bc Mon Sep 17 00:00:00 2001 From: Anan Zhuang Date: Thu, 21 Apr 2022 06:55:52 +0000 Subject: [PATCH] [2.0] Deprecate the "Master" nomenclature in nodejs client 1.Deprecate setting cluster.initial_master_nodes and introduce the alternative setting cluster.initial_cluster_manager_nodes. 2.Use a new node role cluster_manager that has the same functionality with master in the node setting node.roles: [ master ] 3.Cat API _cat/master is replaced with _cat/cluster_manager 4.Deprecate master_timeout parameter to cluster_manager_timeout 5.Deprecate several interfaces, for example CatMasterMasterRecord 6.Replaces tests and comments Issue Resolved: https://github.com/opensearch-project/opensearch-js/issues/221 Signed-off-by: Anan Zhuang --- api/api/cat.js | 8 +- api/api/cluster.js | 4 +- api/api/dangling_indices.js | 4 +- api/api/delete_script.js | 4 +- api/api/features.js | 4 +- api/api/get_script.js | 4 +- api/api/indices.js | 4 +- api/api/ingest.js | 4 +- api/api/put_script.js | 4 +- api/api/snapshot.js | 4 +- api/new.d.ts | 8 +- api/opensearch_dashboards.d.ts | 2 +- api/requestParams.d.ts | 140 ++++++++++++------------- api/types.d.ts | 124 +++++++++++----------- index.d.ts | 10 +- lib/Connection.d.ts | 4 +- lib/Connection.js | 4 +- lib/Transport.js | 4 +- lib/pool/BaseConnectionPool.js | 2 +- lib/pool/ConnectionPool.js | 2 +- lib/pool/index.d.ts | 2 +- test/acceptance/sniff.test.js | 4 +- test/integration/test-runner.js | 4 +- test/types/connection.test-d.ts | 2 +- test/unit/base-connection-pool.test.js | 50 ++++----- test/unit/client.test.js | 18 ++-- test/unit/connection-pool.test.js | 60 +++++------ test/unit/connection.test.js | 14 +-- test/utils/MockConnection.js | 4 +- test/utils/buildCluster.js | 2 +- 30 files changed, 252 insertions(+), 252 deletions(-) diff --git a/api/api/cat.js b/api/api/cat.js index 14ca5e6f5..8958fe2cc 100644 --- a/api/api/cat.js +++ b/api/api/cat.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id'] -const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' } +const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'cluster_manager_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id'] +const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', clusterManagerTimeout: 'cluster_manager_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' } function CatApi (transport, ConfigurationError) { this.transport = transport @@ -214,7 +214,7 @@ CatApi.prototype.indices = function catIndicesApi (params, options, callback) { return this.transport.request(request, options, callback) } -CatApi.prototype.master = function catMasterApi (params, options, callback) { +CatApi.prototype.cluster_manager = function catClusterManagerApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) let { method, body, ...querystring } = params @@ -222,7 +222,7 @@ CatApi.prototype.master = function catMasterApi (params, options, callback) { let path = '' if (method == null) method = 'GET' - path = '/' + '_cat' + '/' + 'master' + path = '/' + '_cat' + '/' + 'cluster_manager' // build request object const request = { diff --git a/api/api/cluster.js b/api/api/cluster.js index 9a1637625..d7c6140e2 100644 --- a/api/api/cluster.js +++ b/api/api/cluster.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'timeout', 'master_timeout', 'wait_for_removal', 'local', 'flat_settings', 'include_defaults', 'expand_wildcards', 'level', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'node_ids', 'node_names', 'create', 'dry_run', 'explain', 'retry_failed', 'metric', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices'] -const snakeCase = { includeYesDecisions: 'include_yes_decisions', includeDiskInfo: 'include_disk_info', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForRemoval: 'wait_for_removal', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', expandWildcards: 'expand_wildcards', waitForActiveShards: 'wait_for_active_shards', waitForNodes: 'wait_for_nodes', waitForEvents: 'wait_for_events', waitForNoRelocatingShards: 'wait_for_no_relocating_shards', waitForNoInitializingShards: 'wait_for_no_initializing_shards', waitForStatus: 'wait_for_status', nodeIds: 'node_ids', nodeNames: 'node_names', dryRun: 'dry_run', retryFailed: 'retry_failed', waitForMetadataVersion: 'wait_for_metadata_version', waitForTimeout: 'wait_for_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices' } +const acceptedQuerystring = ['include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'timeout', 'cluster_manager_timeout', 'wait_for_removal', 'local', 'flat_settings', 'include_defaults', 'expand_wildcards', 'level', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'node_ids', 'node_names', 'create', 'dry_run', 'explain', 'retry_failed', 'metric', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices'] +const snakeCase = { includeYesDecisions: 'include_yes_decisions', includeDiskInfo: 'include_disk_info', errorTrace: 'error_trace', filterPath: 'filter_path', clusterManagerTimeout: 'cluster_manager_timeout', waitForRemoval: 'wait_for_removal', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', expandWildcards: 'expand_wildcards', waitForActiveShards: 'wait_for_active_shards', waitForNodes: 'wait_for_nodes', waitForEvents: 'wait_for_events', waitForNoRelocatingShards: 'wait_for_no_relocating_shards', waitForNoInitializingShards: 'wait_for_no_initializing_shards', waitForStatus: 'wait_for_status', nodeIds: 'node_ids', nodeNames: 'node_names', dryRun: 'dry_run', retryFailed: 'retry_failed', waitForMetadataVersion: 'wait_for_metadata_version', waitForTimeout: 'wait_for_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices' } function ClusterApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/dangling_indices.js b/api/api/dangling_indices.js index ad8459efa..957f5f7bc 100644 --- a/api/api/dangling_indices.js +++ b/api/api/dangling_indices.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { acceptDataLoss: 'accept_data_loss', masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['accept_data_loss', 'timeout', 'cluster_manager_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { acceptDataLoss: 'accept_data_loss', clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } function DanglingIndicesApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/delete_script.js b/api/api/delete_script.js index b148d52df..c02556051 100644 --- a/api/api/delete_script.js +++ b/api/api/delete_script.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['timeout', 'cluster_manager_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } function deleteScriptApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/features.js b/api/api/features.js index 033727894..b98d656b0 100644 --- a/api/api/features.js +++ b/api/api/features.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['cluster_manager_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } function FeaturesApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/get_script.js b/api/api/get_script.js index b50870007..728abe371 100644 --- a/api/api/get_script.js +++ b/api/api/get_script.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['cluster_manager_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } function getScriptApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/indices.js b/api/api/indices.js index 9c74d6614..a611c2e86 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'run_expensive_tasks', 'flush', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards'] -const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', runExpensiveTasks: 'run_expensive_tasks', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' } +const acceptedQuerystring = ['timeout', 'cluster_manager_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'run_expensive_tasks', 'flush', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', runExpensiveTasks: 'run_expensive_tasks', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' } function IndicesApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/ingest.js b/api/api/ingest.js index d1325d968..c835bf0f4 100644 --- a/api/api/ingest.js +++ b/api/api/ingest.js @@ -34,8 +34,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', 'summary', 'verbose'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['cluster_manager_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } function IngestApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/api/put_script.js b/api/api/put_script.js index ffe81dbce..2ffc8c4fb 100644 --- a/api/api/put_script.js +++ b/api/api/put_script.js @@ -34,8 +34,8 @@ /* eslint no-unused-vars: 0 */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') -const acceptedQuerystring = ['timeout', 'master_timeout', 'context', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } +const acceptedQuerystring = ['timeout', 'cluster_manager_timeout', 'context', 'pretty', 'human', 'error_trace', 'source', 'filter_path'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' } function putScriptApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) diff --git a/api/api/snapshot.js b/api/api/snapshot.js index 69460002a..92c4dcbcf 100644 --- a/api/api/snapshot.js +++ b/api/api/snapshot.js @@ -34,8 +34,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', 'index_details', 'include_repository', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes'] -const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' } +const acceptedQuerystring = ['cluster_manager_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes'] +const snakeCase = { clusterManagerTimeout: 'cluster_manager_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' } function SnapshotApi (transport, ConfigurationError) { this.transport = transport diff --git a/api/new.d.ts b/api/new.d.ts index bb4e26cb5..9b04d3d4b 100644 --- a/api/new.d.ts +++ b/api/new.d.ts @@ -130,10 +130,10 @@ declare class Client { indices(callback: callbackFn): TransportRequestCallback indices(params: T.CatIndicesRequest, callback: callbackFn): TransportRequestCallback indices(params: T.CatIndicesRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - master(params?: T.CatMasterRequest, options?: TransportRequestOptions): TransportRequestPromise> - master(callback: callbackFn): TransportRequestCallback - master(params: T.CatMasterRequest, callback: callbackFn): TransportRequestCallback - master(params: T.CatMasterRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + cluster_manager(params?: T.CatClusterManagerRequest, options?: TransportRequestOptions): TransportRequestPromise> + cluster_manager(callback: callbackFn): TransportRequestCallback + cluster_manager(params: T.CatClusterManagerRequest, callback: callbackFn): TransportRequestCallback + cluster_manager(params: T.CatClusterManagerRequest, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback nodeattrs(params?: T.CatNodeAttributesRequest, options?: TransportRequestOptions): TransportRequestPromise> nodeattrs(callback: callbackFn): TransportRequestCallback nodeattrs(params: T.CatNodeAttributesRequest, callback: callbackFn): TransportRequestCallback diff --git a/api/opensearch_dashboards.d.ts b/api/opensearch_dashboards.d.ts index 613541b27..f24a66cbf 100644 --- a/api/opensearch_dashboards.d.ts +++ b/api/opensearch_dashboards.d.ts @@ -98,7 +98,7 @@ import { health(params?: T.CatHealthRequest, options?: TransportRequestOptions): TransportRequestPromise> help(params?: T.CatHelpRequest, options?: TransportRequestOptions): TransportRequestPromise> indices(params?: T.CatIndicesRequest, options?: TransportRequestOptions): TransportRequestPromise> - master(params?: T.CatMasterRequest, options?: TransportRequestOptions): TransportRequestPromise> + cluster_manager(params?: T.CatClusterManagerRequest, options?: TransportRequestOptions): TransportRequestPromise> nodeattrs(params?: T.CatNodeAttributesRequest, options?: TransportRequestOptions): TransportRequestPromise> nodes(params?: T.CatNodesRequest, options?: TransportRequestOptions): TransportRequestPromise> pendingTasks(params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise> diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index a761c8462..f1ad0dfa1 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -71,7 +71,7 @@ export interface CatAllocation extends Generic { format?: string; bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -117,7 +117,7 @@ export interface CatIndices extends Generic { format?: string; bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; health?: 'green' | 'yellow' | 'red'; help?: boolean; @@ -129,10 +129,10 @@ export interface CatIndices extends Generic { expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; } -export interface CatMaster extends Generic { +export interface CatClusterManager extends Generic { format?: string; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -142,7 +142,7 @@ export interface CatMaster extends Generic { export interface CatNodeattrs extends Generic { format?: string; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -154,7 +154,7 @@ export interface CatNodes extends Generic { format?: string; full_id?: boolean; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -166,7 +166,7 @@ export interface CatNodes extends Generic { export interface CatPendingTasks extends Generic { format?: string; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -177,7 +177,7 @@ export interface CatPendingTasks extends Generic { export interface CatPlugins extends Generic { format?: string; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; include_bootstrap?: boolean; @@ -201,7 +201,7 @@ export interface CatRecovery extends Generic { export interface CatRepositories extends Generic { format?: string; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -223,7 +223,7 @@ export interface CatShards extends Generic { format?: string; bytes?: 'b' | 'k' | 'kb' | 'm' | 'mb' | 'g' | 'gb' | 't' | 'tb' | 'p' | 'pb'; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -235,7 +235,7 @@ export interface CatSnapshots extends Generic { repository?: string | string[]; format?: string; ignore_unavailable?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -260,7 +260,7 @@ export interface CatTemplates extends Generic { name?: string; format?: string; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -272,7 +272,7 @@ export interface CatThreadPool extends Generic { format?: string; size?: '' | 'k' | 'm' | 'g' | 't' | 'p'; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; h?: string | string[]; help?: boolean; s?: string | string[]; @@ -293,7 +293,7 @@ export interface ClusterAllocationExplain extends Generic { export interface ClusterDeleteComponentTemplate extends Generic { name: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface ClusterDeleteVotingConfigExclusions extends Generic { @@ -302,19 +302,19 @@ export interface ClusterDeleteVotingConfigExclusions extends Generic { export interface ClusterExistsComponentTemplate extends Generic { name: string; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } export interface ClusterGetComponentTemplate extends Generic { name?: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } export interface ClusterGetSettings extends Generic { flat_settings?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; include_defaults?: boolean; } @@ -324,7 +324,7 @@ export interface ClusterHealth extends Generic { expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; level?: 'cluster' | 'indices' | 'shards'; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; wait_for_active_shards?: string; wait_for_nodes?: string; @@ -336,7 +336,7 @@ export interface ClusterHealth extends Generic { export interface ClusterPendingTasks extends Generic { local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface ClusterPostVotingConfigExclusions extends Generic { @@ -349,13 +349,13 @@ export interface ClusterPutComponentTemplate extends Generic { name: string; create?: boolean; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body: T; } export interface ClusterPutSettings extends Generic { flat_settings?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; body: T; } @@ -368,7 +368,7 @@ export interface ClusterReroute extends Generic { explain?: boolean; retry_failed?: boolean; metric?: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; body?: T; } @@ -377,7 +377,7 @@ export interface ClusterState extends Generic { index?: string | string[]; metric?: string | string[]; local?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; flat_settings?: boolean; wait_for_metadata_version?: number; wait_for_timeout?: string; @@ -430,14 +430,14 @@ export interface DanglingIndicesDeleteDanglingIndex extends Generic { index_uuid: string; accept_data_loss?: boolean; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface DanglingIndicesImportDanglingIndex extends Generic { index_uuid: string; accept_data_loss?: boolean; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface DanglingIndicesListDanglingIndices extends Generic { @@ -506,7 +506,7 @@ export interface DeleteByQueryRethrottle extends Generic { export interface DeleteScript extends Generic { id: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface Exists extends Generic { @@ -566,7 +566,7 @@ export interface Explain extends Generic { } export interface FeaturesGetFeatures extends Generic { - master_timeout?: string; + cluster_manager_timeout?: string; } export interface FeaturesResetFeatures extends Generic { @@ -602,7 +602,7 @@ export interface Get extends Generic { export interface GetScript extends Generic { id: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface GetScriptContext extends Generic { @@ -650,7 +650,7 @@ export interface IndicesAddBlock extends Generic { index: string | string[]; block: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; @@ -676,7 +676,7 @@ export interface IndicesClone extends Generic { index: string; target: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; wait_for_active_shards?: string; body?: T; } @@ -684,7 +684,7 @@ export interface IndicesClone extends Generic { export interface IndicesClose extends Generic { index: string | string[]; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; @@ -696,14 +696,14 @@ export interface IndicesCreate extends Generic { include_type_name?: boolean; wait_for_active_shards?: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body?: T; } export interface IndicesDelete extends Generic { index: string | string[]; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; @@ -713,18 +713,18 @@ export interface IndicesDeleteAlias extends Generic { index: string | string[]; name: string | string[]; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface IndicesDeleteIndexTemplate extends Generic { name: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface IndicesDeleteTemplate extends Generic { name: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface IndicesDiskUsage extends Generic { @@ -758,14 +758,14 @@ export interface IndicesExistsAlias extends Generic { export interface IndicesExistsIndexTemplate extends Generic { name: string; flat_settings?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } export interface IndicesExistsTemplate extends Generic { name: string | string[]; flat_settings?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } @@ -821,7 +821,7 @@ export interface IndicesGet extends Generic { expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; flat_settings?: boolean; include_defaults?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface IndicesGetAlias extends Generic { @@ -848,7 +848,7 @@ export interface IndicesGetFieldMapping extends Generic { export interface IndicesGetIndexTemplate extends Generic { name?: string | string[]; flat_settings?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } @@ -859,14 +859,14 @@ export interface IndicesGetMapping extends Generic { ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } export interface IndicesGetSettings extends Generic { index?: string | string[]; name?: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; @@ -879,7 +879,7 @@ export interface IndicesGetTemplate extends Generic { name?: string | string[]; include_type_name?: boolean; flat_settings?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } @@ -894,7 +894,7 @@ export interface IndicesGetUpgrade extends Generic { export interface IndicesOpen extends Generic { index: string | string[]; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; @@ -905,7 +905,7 @@ export interface IndicesPutAlias extends Generic { index: string | string[]; name: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body?: T; } @@ -913,7 +913,7 @@ export interface IndicesPutIndexTemplate extends Generic { name: string; create?: boolean; cause?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body: T; } @@ -922,7 +922,7 @@ export interface IndicesPutMapping extends Generic { type?: string; include_type_name?: boolean; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; @@ -932,7 +932,7 @@ export interface IndicesPutMapping extends Generic { export interface IndicesPutSettings extends Generic { index?: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; preserve_existing?: boolean; ignore_unavailable?: boolean; @@ -947,7 +947,7 @@ export interface IndicesPutTemplate extends Generic { include_type_name?: boolean; order?: number; create?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; body: T; } @@ -975,7 +975,7 @@ export interface IndicesRollover extends Generic { include_type_name?: boolean; timeout?: string; dry_run?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; wait_for_active_shards?: string; body?: T; } @@ -1001,7 +1001,7 @@ export interface IndicesShrink extends Generic { target: string; copy_settings?: boolean; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; wait_for_active_shards?: string; body?: T; } @@ -1010,7 +1010,7 @@ export interface IndicesSimulateIndexTemplate extends Generic { name: string; create?: boolean; cause?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body?: T; } @@ -1018,7 +1018,7 @@ export interface IndicesSimulateTemplate extends Generic { name?: string; create?: boolean; cause?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body?: T; } @@ -1027,7 +1027,7 @@ export interface IndicesSplit extends Generic { target: string; copy_settings?: boolean; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; wait_for_active_shards?: string; body?: T; } @@ -1049,7 +1049,7 @@ export interface IndicesStats extends Generic { export interface IndicesUpdateAliases extends Generic { timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body: T; } @@ -1085,7 +1085,7 @@ export interface Info extends Generic { export interface IngestDeletePipeline extends Generic { id: string; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; } @@ -1095,7 +1095,7 @@ export interface IngestGeoIpStats extends Generic { export interface IngestGetPipeline extends Generic { id?: string; summary?: boolean; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface IngestProcessorGrok extends Generic { @@ -1103,7 +1103,7 @@ export interface IngestProcessorGrok extends Generic { export interface IngestPutPipeline extends Generic { id: string; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; body: T; } @@ -1232,7 +1232,7 @@ export interface PutScript extends Generic { id: string; context?: string; timeout?: string; - master_timeout?: string; + cluster_manager_timeout?: string; body: T; } @@ -1373,7 +1373,7 @@ export interface ShutdownPutNode extends Generic { export interface SnapshotCleanupRepository extends Generic { repository: string; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; } @@ -1381,21 +1381,21 @@ export interface SnapshotClone extends Generic { repository: string; snapshot: string; target_snapshot: string; - master_timeout?: string; + cluster_manager_timeout?: string; body: T; } export interface SnapshotCreate extends Generic { repository: string; snapshot: string; - master_timeout?: string; + cluster_manager_timeout?: string; wait_for_completion?: boolean; body?: T; } export interface SnapshotCreateRepository extends Generic { repository: string; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; verify?: boolean; body: T; @@ -1404,19 +1404,19 @@ export interface SnapshotCreateRepository extends Generic { export interface SnapshotDelete extends Generic { repository: string; snapshot: string; - master_timeout?: string; + cluster_manager_timeout?: string; } export interface SnapshotDeleteRepository extends Generic { repository: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; } export interface SnapshotGet extends Generic { repository: string; snapshot: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; index_details?: boolean; include_repository?: boolean; @@ -1425,7 +1425,7 @@ export interface SnapshotGet extends Generic { export interface SnapshotGetRepository extends Generic { repository?: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; local?: boolean; } @@ -1447,7 +1447,7 @@ export interface SnapshotRepositoryAnalyze extends Generic { export interface SnapshotRestore extends Generic { repository: string; snapshot: string; - master_timeout?: string; + cluster_manager_timeout?: string; wait_for_completion?: boolean; body?: T; } @@ -1455,13 +1455,13 @@ export interface SnapshotRestore extends Generic { export interface SnapshotStatus extends Generic { repository?: string; snapshot?: string | string[]; - master_timeout?: string; + cluster_manager_timeout?: string; ignore_unavailable?: boolean; } export interface SnapshotVerifyRepository extends Generic { repository: string; - master_timeout?: string; + cluster_manager_timeout?: string; timeout?: string; } diff --git a/api/types.d.ts b/api/types.d.ts index 028e60bbc..2c62f5baf 100644 --- a/api/types.d.ts +++ b/api/types.d.ts @@ -257,7 +257,7 @@ export interface DeleteByQueryRethrottleResponse extends TaskListResponse { export interface DeleteScriptRequest extends RequestBase { id: Id - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -426,7 +426,7 @@ export interface GetResponse { export interface GetScriptRequest extends RequestBase { id: Id - master_timeout?: Time + cluster_manager_timeout?: Time } export interface GetScriptResponse { @@ -683,7 +683,7 @@ export type PingResponse = boolean export interface PutScriptRequest extends RequestBase { id: Id context?: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { script?: StoredScript @@ -2062,7 +2062,7 @@ export type NodeIds = string export type NodeName = string -export type NodeRole = 'master' | 'data' | 'client' | 'ingest' | 'voting_only' | 'remote_cluster_client' | 'coordinating_only' +export type NodeRole = 'cluster_manager' | 'data' | 'client' | 'ingest' | 'voting_only' | 'remote_cluster_client' | 'coordinating_only' export type NodeRoles = NodeRole[] @@ -5159,7 +5159,7 @@ export interface CatIndicesRequest extends CatCatRequestBase { export type CatIndicesResponse = CatIndicesIndicesRecord[] -export interface CatMasterMasterRecord { +export interface CatClusterManagerClusterManagerRecord { id?: string host?: string h?: string @@ -5168,10 +5168,10 @@ export interface CatMasterMasterRecord { n?: string } -export interface CatMasterRequest extends CatCatRequestBase { +export interface CatClusterManagerRequest extends CatCatRequestBase { } -export type CatMasterResponse = CatMasterMasterRecord[] +export type CatClusterManagerResponse = CatClusterManagerClusterManagerRecord[] export interface CatNodeAttributesNodeAttributesRecord { node?: string @@ -5264,7 +5264,7 @@ export interface CatNodesNodesRecord { r?: string role?: string nodeRole?: string - master?: string + cluster_manager?: string m?: string name?: Name n?: Name @@ -6255,7 +6255,7 @@ export type ClusterAllocationExplainUnassignedInformationReason = 'INDEX_CREATED export interface ClusterDeleteComponentTemplateRequest extends RequestBase { name: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -6288,7 +6288,7 @@ export interface ClusterGetComponentTemplateRequest extends RequestBase { name?: Name flat_settings?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface ClusterGetComponentTemplateResponse { @@ -6298,7 +6298,7 @@ export interface ClusterGetComponentTemplateResponse { export interface ClusterGetSettingsRequest extends RequestBase { flat_settings?: boolean include_defaults?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -6325,7 +6325,7 @@ export interface ClusterHealthRequest extends RequestBase { expand_wildcards?: ExpandWildcards level?: Level local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards wait_for_events?: WaitForEvents @@ -6373,7 +6373,7 @@ export interface ClusterPendingTasksPendingTask { export interface ClusterPendingTasksRequest extends RequestBase { local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface ClusterPendingTasksResponse { @@ -6383,7 +6383,7 @@ export interface ClusterPendingTasksResponse { export interface ClusterPutComponentTemplateRequest extends RequestBase { name: Name create?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time body?: { template: IndicesIndexState aliases?: Record @@ -6399,7 +6399,7 @@ export interface ClusterPutComponentTemplateResponse extends AcknowledgedRespons export interface ClusterPutSettingsRequest extends RequestBase { flat_settings?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { persistent?: Record @@ -6482,7 +6482,7 @@ export interface ClusterRerouteRequest extends RequestBase { explain?: boolean metric?: Metrics retry_failed?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { commands?: ClusterRerouteCommand[] @@ -6513,7 +6513,7 @@ export interface ClusterRerouteRerouteParameters { export interface ClusterRerouteRerouteState { cluster_uuid: Uuid state_uuid?: Uuid - master_node?: string + cluster_manager_node?: string version?: VersionNumber blocks?: EmptyObject nodes?: Record @@ -6542,7 +6542,7 @@ export interface ClusterStateRequest extends RequestBase { flat_settings?: boolean ignore_unavailable?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time wait_for_metadata_version?: VersionNumber wait_for_timeout?: Time } @@ -6550,7 +6550,7 @@ export interface ClusterStateRequest extends RequestBase { export interface ClusterStateResponse { cluster_name: Name cluster_uuid: Uuid - master_node?: string + cluster_manager_node?: string state?: string[] state_uuid?: Uuid version?: VersionNumber @@ -6643,7 +6643,7 @@ export interface ClusterStatsClusterNodeCount { coordinating_only: integer data: integer ingest: integer - master: integer + cluster_manager: integer total: integer voting_only: integer remote_cluster_client: integer @@ -7054,7 +7054,7 @@ export interface IndicesAddBlockRequest extends RequestBase { allow_no_indices?: boolean expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -7146,7 +7146,7 @@ export interface IndicesClearCacheResponse extends ShardsOperationResponseBase { export interface IndicesCloneRequest extends RequestBase { index: IndexName target: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards body?: { @@ -7174,7 +7174,7 @@ export interface IndicesCloseRequest extends RequestBase { allow_no_indices?: boolean expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards } @@ -7187,7 +7187,7 @@ export interface IndicesCloseResponse extends AcknowledgedResponseBase { export interface IndicesCreateRequest extends RequestBase { index: IndexName include_type_name?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards body?: { @@ -7207,7 +7207,7 @@ export interface IndicesDeleteRequest extends RequestBase { allow_no_indices?: boolean expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -7217,7 +7217,7 @@ export interface IndicesDeleteResponse extends IndicesResponseBase { export interface IndicesDeleteAliasRequest extends RequestBase { index: Indices name: Names - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -7233,7 +7233,7 @@ export interface IndicesDeleteIndexTemplateResponse extends AcknowledgedResponse export interface IndicesDeleteTemplateRequest extends RequestBase { name: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -7265,7 +7265,7 @@ export type IndicesExistsAliasResponse = boolean export interface IndicesExistsIndexTemplateRequest extends RequestBase { name: Name - master_timeout?: Time + cluster_manager_timeout?: Time } export type IndicesExistsIndexTemplateResponse = boolean @@ -7274,7 +7274,7 @@ export interface IndicesExistsTemplateRequest extends RequestBase { name: Names flat_settings?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export type IndicesExistsTemplateResponse = boolean @@ -7335,7 +7335,7 @@ export interface IndicesGetRequest extends RequestBase { include_defaults?: boolean include_type_name?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface IndicesGetResponse extends DictionaryResponseBase { @@ -7404,7 +7404,7 @@ export interface IndicesGetIndexTemplateRequest extends RequestBase { body?: { flat_settings?: boolean include_type_name?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } } @@ -7425,7 +7425,7 @@ export interface IndicesGetMappingRequest extends RequestBase { ignore_unavailable?: boolean include_type_name?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface IndicesGetMappingResponse extends DictionaryResponseBase { @@ -7440,7 +7440,7 @@ export interface IndicesGetSettingsRequest extends RequestBase { ignore_unavailable?: boolean include_defaults?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface IndicesGetSettingsResponse extends DictionaryResponseBase { @@ -7451,7 +7451,7 @@ export interface IndicesGetTemplateRequest extends RequestBase { flat_settings?: boolean include_type_name?: boolean local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface IndicesGetTemplateResponse extends DictionaryResponseBase { @@ -7471,7 +7471,7 @@ export interface IndicesOpenRequest extends RequestBase { allow_no_indices?: boolean expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards } @@ -7483,7 +7483,7 @@ export interface IndicesOpenResponse extends AcknowledgedResponseBase { export interface IndicesPutAliasRequest extends RequestBase { index: Indices name: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { filter?: QueryDslQueryContainer @@ -7526,7 +7526,7 @@ export interface IndicesPutMappingRequest extends RequestBase { expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean include_type_name?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time write_index_only?: boolean body?: { @@ -7560,7 +7560,7 @@ export interface IndicesPutSettingsRequest extends RequestBase { expand_wildcards?: ExpandWildcards flat_settings?: boolean ignore_unavailable?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time preserve_existing?: boolean timeout?: Time body?: IndicesPutSettingsIndexSettingsBody @@ -7574,7 +7574,7 @@ export interface IndicesPutTemplateRequest extends RequestBase { create?: boolean flat_settings?: boolean include_type_name?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { aliases?: Record @@ -7737,7 +7737,7 @@ export interface IndicesRolloverRequest extends RequestBase { new_index?: IndexName dry_run?: boolean include_type_name?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards body?: { @@ -7848,7 +7848,7 @@ export interface IndicesShardStoresShardStoreWrapper { export interface IndicesShrinkRequest extends RequestBase { index: IndexName target: IndexName - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards body?: { @@ -7878,7 +7878,7 @@ export interface IndicesSimulateIndexTemplateResponse { export interface IndicesSimulateTemplateRequest extends RequestBase { name?: Name create?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time body?: IndicesGetIndexTemplateIndexTemplate } @@ -7889,7 +7889,7 @@ export interface IndicesSimulateTemplateResponse { export interface IndicesSplitRequest extends RequestBase { index: IndexName target: IndexName - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time wait_for_active_shards?: WaitForActiveShards body?: { @@ -8040,7 +8040,7 @@ export interface IndicesUpdateAliasesIndicesUpdateAliasBulk { } export interface IndicesUpdateAliasesRequest extends RequestBase { - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { actions?: IndicesUpdateAliasesIndicesUpdateAliasBulk[] @@ -8402,7 +8402,7 @@ export type IngestUserAgentProperty = 'NAME' | 'MAJOR' | 'MINOR' | 'PATCH' | 'OS export interface IngestDeletePipelineRequest extends RequestBase { id: Id - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -8436,7 +8436,7 @@ export interface IngestGeoIpStatsResponse { export interface IngestGetPipelineRequest extends RequestBase { id?: Id - master_timeout?: Time + cluster_manager_timeout?: Time summary?: boolean } @@ -8452,7 +8452,7 @@ export interface IngestProcessorGrokResponse { export interface IngestPutPipelineRequest extends RequestBase { id: Id - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { description?: string @@ -8887,7 +8887,7 @@ export interface NodesInfoNodeInfoSettingsCluster { name: Name routing?: IndicesIndexRouting election: NodesInfoNodeInfoSettingsClusterElection - initial_master_nodes?: string + initial_cluster_manager_nodes?: string } export interface NodesInfoNodeInfoSettingsClusterElection { @@ -8982,7 +8982,7 @@ export interface NodesInfoRequest extends RequestBase { node_id?: NodeIds metric?: Metrics flat_settings?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -9025,7 +9025,7 @@ export interface NodesStatsRequest extends RequestBase { groups?: boolean include_segment_file_sizes?: boolean level?: Level - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time types?: string[] include_unloaded_segments?: boolean @@ -9206,7 +9206,7 @@ export interface SnapshotCleanupRepositoryCleanupRepositoryResults { export interface SnapshotCleanupRepositoryRequest extends RequestBase { repository: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -9218,7 +9218,7 @@ export interface SnapshotCloneRequest extends RequestBase { repository: Name snapshot: Name target_snapshot: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time body?: { indices: string @@ -9231,7 +9231,7 @@ export interface SnapshotCloneResponse extends AcknowledgedResponseBase { export interface SnapshotCreateRequest extends RequestBase { repository: Name snapshot: Name - master_timeout?: Time + cluster_manager_timeout?: Time wait_for_completion?: boolean body?: { ignore_unavailable?: boolean @@ -9249,7 +9249,7 @@ export interface SnapshotCreateResponse { export interface SnapshotCreateRepositoryRequest extends RequestBase { repository: Name - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time verify?: boolean body?: { @@ -9265,7 +9265,7 @@ export interface SnapshotCreateRepositoryResponse extends AcknowledgedResponseBa export interface SnapshotDeleteRequest extends RequestBase { repository: Name snapshot: Name - master_timeout?: Time + cluster_manager_timeout?: Time } export interface SnapshotDeleteResponse extends AcknowledgedResponseBase { @@ -9273,7 +9273,7 @@ export interface SnapshotDeleteResponse extends AcknowledgedResponseBase { export interface SnapshotDeleteRepositoryRequest extends RequestBase { repository: Names - master_timeout?: Time + cluster_manager_timeout?: Time timeout?: Time } @@ -9284,7 +9284,7 @@ export interface SnapshotGetRequest extends RequestBase { repository: Name snapshot: Names ignore_unavailable?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time verbose?: boolean index_details?: boolean human?: boolean @@ -9304,7 +9304,7 @@ export interface SnapshotGetSnapshotResponseItem { export interface SnapshotGetRepositoryRequest extends RequestBase { repository?: Names local?: boolean - master_timeout?: Time + cluster_manager_timeout?: Time } export interface SnapshotGetRepositoryResponse extends DictionaryResponseBase { @@ -9313,7 +9313,7 @@ export interface SnapshotGetRepositoryResponse extends DictionaryResponseBase; roles?: { - master: boolean; + cluster_manager: boolean; data: boolean; ingest: boolean; } @@ -187,10 +187,10 @@ declare class Client { indices, TContext = Context>(callback: callbackFn): TransportRequestCallback indices, TContext = Context>(params: RequestParams.CatIndices, callback: callbackFn): TransportRequestCallback indices, TContext = Context>(params: RequestParams.CatIndices, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - master, TContext = Context>(params?: RequestParams.CatMaster, options?: TransportRequestOptions): TransportRequestPromise> - master, TContext = Context>(callback: callbackFn): TransportRequestCallback - master, TContext = Context>(params: RequestParams.CatMaster, callback: callbackFn): TransportRequestCallback - master, TContext = Context>(params: RequestParams.CatMaster, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + cluster_manager, TContext = Context>(params?: RequestParams.CatClusterManager, options?: TransportRequestOptions): TransportRequestPromise> + cluster_manager, TContext = Context>(callback: callbackFn): TransportRequestCallback + cluster_manager, TContext = Context>(params: RequestParams.CatClusterManager, callback: callbackFn): TransportRequestCallback + cluster_manager, TContext = Context>(params: RequestParams.CatClusterManager, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback nodeattrs, TContext = Context>(params?: RequestParams.CatNodeattrs, options?: TransportRequestOptions): TransportRequestPromise> nodeattrs, TContext = Context>(callback: callbackFn): TransportRequestCallback nodeattrs, TContext = Context>(params: RequestParams.CatNodeattrs, callback: callbackFn): TransportRequestCallback diff --git a/lib/Connection.d.ts b/lib/Connection.d.ts index 3df2dafd1..36ee01faf 100644 --- a/lib/Connection.d.ts +++ b/lib/Connection.d.ts @@ -54,7 +54,7 @@ export interface ConnectionOptions { } interface ConnectionRoles { - master?: boolean + cluster_manager?: boolean data?: boolean ingest?: boolean } @@ -78,7 +78,7 @@ export default class Connection { DEAD: string; }; static roles: { - MASTER: string; + CLUSTER_MANAGER: string; DATA: string; INGEST: string; }; diff --git a/lib/Connection.js b/lib/Connection.js index c0ab2e6fd..a150da4a8 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -293,13 +293,13 @@ Connection.statuses = { } Connection.roles = { - MASTER: 'master', + CLUSTER_MANAGER: 'cluster_manager', DATA: 'data', INGEST: 'ingest' } const defaultRoles = { - [Connection.roles.MASTER]: true, + [Connection.roles.CLUSTER_MANAGER]: true, [Connection.roles.DATA]: true, [Connection.roles.INGEST]: true } diff --git a/lib/Transport.js b/lib/Transport.js index ce67a5c42..ab8188d1c 100644 --- a/lib/Transport.js +++ b/lib/Transport.js @@ -610,8 +610,8 @@ function isStream (obj) { } function defaultNodeFilter (node) { - // avoid master only nodes - if (node.roles.master === true && + // avoid cluster_manager only nodes + if (node.roles.cluster_manager === true && node.roles.data === false && node.roles.ingest === false) { return false diff --git a/lib/pool/BaseConnectionPool.js b/lib/pool/BaseConnectionPool.js index 05243415a..cadb8bdfa 100644 --- a/lib/pool/BaseConnectionPool.js +++ b/lib/pool/BaseConnectionPool.js @@ -243,7 +243,7 @@ class BaseConnectionPool { url: new URL(address), id: ids[i], roles: Object.assign({ - [Connection.roles.MASTER]: false, + [Connection.roles.CLUSTER_MANAGER]: false, [Connection.roles.DATA]: false, [Connection.roles.INGEST]: false }, roles) diff --git a/lib/pool/ConnectionPool.js b/lib/pool/ConnectionPool.js index 7fca12550..3ff63fc74 100644 --- a/lib/pool/ConnectionPool.js +++ b/lib/pool/ConnectionPool.js @@ -188,7 +188,7 @@ class ConnectionPool extends BaseConnectionPool { /** * Returns an alive connection if present, * otherwise returns a dead connection. - * By default it filters the `master` only nodes. + * By default it filters the `cluster_manager` only nodes. * It uses the selector to choose which * connection return. * diff --git a/lib/pool/index.d.ts b/lib/pool/index.d.ts index c08098fd7..3c93f9ec0 100644 --- a/lib/pool/index.d.ts +++ b/lib/pool/index.d.ts @@ -109,7 +109,7 @@ declare class BaseConnectionPool { /** * Returns an alive connection if present, * otherwise returns a dead connection. - * By default it filters the `master` only nodes. + * By default it filters the `cluster_manager` only nodes. * It uses the selector to choose which * connection return. * diff --git a/test/acceptance/sniff.test.js b/test/acceptance/sniff.test.js index 9d3e1b5ce..03727844e 100644 --- a/test/acceptance/sniff.test.js +++ b/test/acceptance/sniff.test.js @@ -78,7 +78,7 @@ test('Should update the connection pool', t => { url: new URL(nodes[id].url), id: id, roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -88,7 +88,7 @@ test('Should update the connection pool', t => { url: new URL(nodes[id].url), id: id, roles: { - master: true, + cluster_manager: true, data: true, ingest: true }, diff --git a/test/integration/test-runner.js b/test/integration/test-runner.js index d07c6e934..f382a555f 100644 --- a/test/integration/test-runner.js +++ b/test/integration/test-runner.js @@ -158,8 +158,8 @@ function build (opts = {}) { /** * Fill the stashed values of a command - * let's say the we have stashed the `master` value, - * is_true: nodes.$master.transport.profiles + * let's say the we have stashed the `cluster_manager` value, + * is_true: nodes.$cluster_manager.transport.profiles * becomes * is_true: nodes.new_value.transport.profiles * @param {object|string} the action to update diff --git a/test/types/connection.test-d.ts b/test/types/connection.test-d.ts index 7b855afe4..ebaddf9e9 100644 --- a/test/types/connection.test-d.ts +++ b/test/types/connection.test-d.ts @@ -41,7 +41,7 @@ import { ConnectionOptions } from '../../lib/Connection' headers: {}, agent: { keepAlive: false }, status: 'alive', - roles: { master: true }, + roles: { cluster_manager: true }, auth: { username: 'username', password: 'password' } }) diff --git a/test/unit/base-connection-pool.test.js b/test/unit/base-connection-pool.test.js index b7961ccb0..ac9665185 100644 --- a/test/unit/base-connection-pool.test.js +++ b/test/unit/base-connection-pool.test.js @@ -141,13 +141,13 @@ test('API', t => { http: { publish_address: '127.0.0.1:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: '127.0.0.1:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -155,7 +155,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -163,7 +163,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -181,13 +181,13 @@ test('API', t => { http: { publish_address: '[::1]:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: '[::1]:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -195,7 +195,7 @@ test('API', t => { url: new URL('http://[::1]:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -203,7 +203,7 @@ test('API', t => { url: new URL('http://[::1]:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -221,13 +221,13 @@ test('API', t => { http: { publish_address: 'example.com/127.0.0.1:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: 'example.com/127.0.0.1:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -235,7 +235,7 @@ test('API', t => { url: new URL('http://example.com:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -243,7 +243,7 @@ test('API', t => { url: new URL('http://example.com:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -261,13 +261,13 @@ test('API', t => { http: { publish_address: 'example.com/[::1]:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: 'example.com/[::1]:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -275,7 +275,7 @@ test('API', t => { url: new URL('http://example.com:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -283,7 +283,7 @@ test('API', t => { url: new URL('http://example.com:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -301,13 +301,13 @@ test('API', t => { http: { publish_address: 'example.com/127.0.0.1:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: 'example.com/127.0.0.1:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -327,7 +327,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -335,7 +335,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -368,7 +368,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -378,7 +378,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -414,7 +414,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'http://127.0.0.1:9200/', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -429,7 +429,7 @@ test('API', t => { // roles will never be updated, we only use it to do // a dummy check to see if the connection has been updated t.same(pool.connections.find(c => c.id === 'a1').roles, { - master: true, + cluster_manager: true, data: true, ingest: true }) @@ -443,7 +443,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } diff --git a/test/unit/client.test.js b/test/unit/client.test.js index cc2e04c83..eb9423ddd 100644 --- a/test/unit/client.test.js +++ b/test/unit/client.test.js @@ -54,7 +54,7 @@ test('Configure host', t => { deadCount: 0, resurrectTimeout: 0, roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -74,7 +74,7 @@ test('Configure host', t => { deadCount: 0, resurrectTimeout: 0, roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -86,7 +86,7 @@ test('Configure host', t => { deadCount: 0, resurrectTimeout: 0, roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -101,7 +101,7 @@ test('Configure host', t => { url: new URL('http://localhost:9200'), id: 'node', roles: { - master: true, + cluster_manager: true, data: false, ingest: false }, @@ -118,7 +118,7 @@ test('Configure host', t => { }) t.same(pool.connections.find(c => c.id === 'node').roles, { - master: true, + cluster_manager: true, data: false, ingest: false }) @@ -132,7 +132,7 @@ test('Configure host', t => { url: new URL('http://localhost:9200'), id: 'node1', roles: { - master: true, + cluster_manager: true, data: false, ingest: false }, @@ -141,7 +141,7 @@ test('Configure host', t => { url: new URL('http://localhost:9200'), id: 'node2', roles: { - master: false, + cluster_manager: false, data: true, ingest: false }, @@ -158,7 +158,7 @@ test('Configure host', t => { }) t.same(pool.connections.find(c => c.id === 'node1').roles, { - master: true, + cluster_manager: true, data: false, ingest: false }) @@ -172,7 +172,7 @@ test('Configure host', t => { }) t.same(pool.connections.find(c => c.id === 'node2').roles, { - master: false, + cluster_manager: false, data: true, ingest: false }) diff --git a/test/unit/connection-pool.test.js b/test/unit/connection-pool.test.js index a904a17fa..35f0d89a5 100644 --- a/test/unit/connection-pool.test.js +++ b/test/unit/connection-pool.test.js @@ -339,13 +339,13 @@ test('API', t => { http: { publish_address: '127.0.0.1:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: '127.0.0.1:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -353,7 +353,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -361,7 +361,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -379,13 +379,13 @@ test('API', t => { http: { publish_address: '[::1]:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: '[::1]:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -393,7 +393,7 @@ test('API', t => { url: new URL('http://[::1]:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -401,7 +401,7 @@ test('API', t => { url: new URL('http://[::1]:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -419,13 +419,13 @@ test('API', t => { http: { publish_address: 'example.com/127.0.0.1:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: 'example.com/127.0.0.1:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -433,7 +433,7 @@ test('API', t => { url: new URL('http://example.com:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -441,7 +441,7 @@ test('API', t => { url: new URL('http://example.com:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -459,13 +459,13 @@ test('API', t => { http: { publish_address: 'example.com/[::1]:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: 'example.com/[::1]:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -473,7 +473,7 @@ test('API', t => { url: new URL('http://example.com:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -481,7 +481,7 @@ test('API', t => { url: new URL('http://example.com:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -499,13 +499,13 @@ test('API', t => { http: { publish_address: 'example.com/127.0.0.1:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { publish_address: 'example.com/127.0.0.1:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } @@ -521,7 +521,7 @@ test('API', t => { http: { publish_address: 'example.com:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, a2: { http: { @@ -534,7 +534,7 @@ test('API', t => { url: new URL('http://example.com:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -542,7 +542,7 @@ test('API', t => { url: new URL('http://example.com:9201'), id: 'a2', roles: { - master: false, + cluster_manager: false, data: false, ingest: false } @@ -562,7 +562,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -570,7 +570,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -603,7 +603,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -613,7 +613,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9201'), id: 'a2', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -649,7 +649,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'http://127.0.0.1:9200/', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -664,7 +664,7 @@ test('API', t => { // roles will never be updated, we only use it to do // a dummy check to see if the connection has been updated t.same(pool.connections.find(c => c.id === 'a1').roles, { - master: true, + cluster_manager: true, data: true, ingest: true }) @@ -678,7 +678,7 @@ test('API', t => { url: new URL('http://127.0.0.1:9200'), id: 'a1', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -782,13 +782,13 @@ test('Node filter', t => { t.ok(pool.getConnection({ filter: defaultNodeFilter }) instanceof Connection) }) - t.test('Should filter master only nodes', t => { + t.test('Should filter cluster_manager only nodes', t => { t.plan(1) const pool = new ConnectionPool({ Connection }) pool.addConnection({ url: new URL('http://localhost:9200/'), roles: { - master: true, + cluster_manager: true, data: false, ingest: false } diff --git a/test/unit/connection.test.js b/test/unit/connection.test.js index 7dfcd7719..5f8962aad 100644 --- a/test/unit/connection.test.js +++ b/test/unit/connection.test.js @@ -650,15 +650,15 @@ test('setRole', t => { }) t.same(connection.roles, { - master: true, + cluster_manager: true, data: true, ingest: true }) - connection.setRole('master', false) + connection.setRole('cluster_manager', false) t.same(connection.roles, { - master: false, + cluster_manager: false, data: true, ingest: true }) @@ -688,7 +688,7 @@ test('setRole', t => { }) try { - connection.setRole('master', 1) + connection.setRole('cluster_manager', 1) t.fail('Shoud throw') } catch (err) { t.ok(err instanceof ConfigurationError) @@ -724,7 +724,7 @@ test('Util.inspect Connection class should hide agent, ssl and auth', t => { resurrectTimeout: 0, _openRequests: 0, status: 'alive', - roles: { master: true, data: true, ingest: true }}`) + roles: { cluster_manager: true, data: true, ingest: true }}`) ) }) @@ -748,7 +748,7 @@ test('connection.toJSON should hide agent, ssl and auth', t => { _openRequests: 0, status: 'alive', roles: { - master: true, + cluster_manager: true, data: true, ingest: true } @@ -818,7 +818,7 @@ test('Should not add agent and ssl to the serialized connection', t => { t.equal( JSON.stringify(connection), - '{"url":"http://localhost:9200/","id":"http://localhost:9200/","headers":{},"deadCount":0,"resurrectTimeout":0,"_openRequests":0,"status":"alive","roles":{"master":true,"data":true,"ingest":true}}' + '{"url":"http://localhost:9200/","id":"http://localhost:9200/","headers":{},"deadCount":0,"resurrectTimeout":0,"_openRequests":0,"status":"alive","roles":{"cluster_manager":true,"data":true,"ingest":true}}' ) t.end() diff --git a/test/utils/MockConnection.js b/test/utils/MockConnection.js index 5d6d967f7..6dc14b463 100644 --- a/test/utils/MockConnection.js +++ b/test/utils/MockConnection.js @@ -104,13 +104,13 @@ class MockConnectionSniff extends Connection { http: { publish_address: 'localhost:9200' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] }, 'node-2': { http: { publish_address: 'localhost:9201' }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } } } diff --git a/test/utils/buildCluster.js b/test/utils/buildCluster.js index 39abbefa6..b58235518 100644 --- a/test/utils/buildCluster.js +++ b/test/utils/buildCluster.js @@ -73,7 +73,7 @@ function buildCluster (options, callback) { ? `localhost/127.0.0.1:${port}` : `127.0.0.1:${port}` }, - roles: ['master', 'data', 'ingest'] + roles: ['cluster_manager', 'data', 'ingest'] } debug(`Booted cluster node '${opts.id}' on port ${port} (cluster id: '${clusterId}')`) done()