Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[2.0] Deprecate the "Master" nomenclature in nodejs client #222

Merged
merged 2 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions api/api/cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const acceptedQuerystring = [
'source',
'filter_path',
'bytes',
'cluster_manager_timeout',
'master_timeout',
'fields',
'time',
Expand All @@ -74,6 +75,7 @@ const snakeCase = {
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path',
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
includeUnloadedSegments: 'include_unloaded_segments',
allowNoMatch: 'allow_no_match',
Expand Down Expand Up @@ -263,6 +265,31 @@ CatApi.prototype.indices = function catIndicesApi(params, options, callback) {
return this.transport.request(request, options, callback);
};

CatApi.prototype.cluster_manager = function catClusterManagerApi(params, options, callback) {
[params, options, callback] = normalizeArguments(params, options, callback);

let { method, body, ...querystring } = params;
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);

let path = '';
if (method == null) method = 'GET';
path = '/' + '_cat' + '/' + 'cluster_manager';

// build request object
const request = {
method,
path,
body: null,
querystring,
};

return this.transport.request(request, options, callback);
};

/**
* // TODO: delete CatApi.prototype.master when it is removed from OpenSearch
* @deprecated use CatApi.prototype.cluster_manager instead
*/
CatApi.prototype.master = function catMasterApi(params, options, callback) {
[params, options, callback] = normalizeArguments(params, options, callback);

Expand Down
2 changes: 2 additions & 0 deletions api/api/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const acceptedQuerystring = [
'source',
'filter_path',
'timeout',
'cluster_manager_timeout',
'master_timeout',
'wait_for_removal',
'local',
Expand Down Expand Up @@ -73,6 +74,7 @@ const snakeCase = {
includeDiskInfo: 'include_disk_info',
errorTrace: 'error_trace',
filterPath: 'filter_path',
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
waitForRemoval: 'wait_for_removal',
flatSettings: 'flat_settings',
Expand Down
2 changes: 2 additions & 0 deletions api/api/dangling_indices.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
const acceptedQuerystring = [
'accept_data_loss',
'timeout',
'cluster_manager_timeout',
'master_timeout',
'pretty',
'human',
Expand All @@ -46,6 +47,7 @@ const acceptedQuerystring = [
];
const snakeCase = {
acceptDataLoss: 'accept_data_loss',
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
2 changes: 2 additions & 0 deletions api/api/delete_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'timeout',
'cluster_manager_timeout',
'master_timeout',
'pretty',
'human',
Expand All @@ -44,6 +45,7 @@ const acceptedQuerystring = [
'filter_path',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
2 changes: 2 additions & 0 deletions api/api/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'cluster_manager_timeout',
'master_timeout',
'pretty',
'human',
Expand All @@ -43,6 +44,7 @@ const acceptedQuerystring = [
'filter_path',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
2 changes: 2 additions & 0 deletions api/api/get_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'cluster_manager_timeout',
'master_timeout',
'pretty',
'human',
Expand All @@ -43,6 +44,7 @@ const acceptedQuerystring = [
'filter_path',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
2 changes: 2 additions & 0 deletions api/api/indices.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'cluster_manager_timeout',
'timeout',
'master_timeout',
'ignore_unavailable',
Expand Down Expand Up @@ -92,6 +93,7 @@ const acceptedQuerystring = [
'all_shards',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
Expand Down
2 changes: 2 additions & 0 deletions api/api/ingest.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'cluster_manager_timeout',
'master_timeout',
'timeout',
'pretty',
Expand All @@ -46,6 +47,7 @@ const acceptedQuerystring = [
'verbose',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
2 changes: 2 additions & 0 deletions api/api/put_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'cluster_manager_timeout',
'timeout',
'master_timeout',
'context',
Expand All @@ -45,6 +46,7 @@ const acceptedQuerystring = [
'filter_path',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
2 changes: 2 additions & 0 deletions api/api/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
const acceptedQuerystring = [
'cluster_manager_timeout',
'master_timeout',
'timeout',
'pretty',
Expand All @@ -61,6 +62,7 @@ const acceptedQuerystring = [
'rarely_abort_writes',
];
const snakeCase = {
clusterManagerTimeout: 'cluster_manager_timeout',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path',
Expand Down
Loading