-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ajay Gupta
committed
Dec 16, 2022
1 parent
2f840e5
commit bb949f4
Showing
10 changed files
with
515 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/* eslint camelcase: 0 */ | ||
/* eslint no-unused-vars: 0 */ | ||
|
||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); | ||
const acceptedQuerystring = [ | ||
'allow_partial_pit_creation', | ||
'keep_alive', | ||
'preference', | ||
'routing', | ||
'pretty', | ||
'human', | ||
'error_trace', | ||
'source', | ||
'filter_path', | ||
]; | ||
const snakeCase = { | ||
allowPartialPitCreation: 'allow_partial_pit_creation', | ||
keepAlive: 'keep_alive', | ||
errorTrace: 'error_trace', | ||
filterPath: 'filter_path', | ||
}; | ||
|
||
function createPitApi(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); | ||
} | ||
|
||
if (params['keep_alive'] == null) { | ||
const err = new this[kConfigurationError]('Missing required parameter: keep_alive'); | ||
return handleError(err, callback); | ||
} | ||
|
||
let { method, body, index, ...querystring } = params; | ||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring); | ||
|
||
let path = ''; | ||
if (method == null) method = 'POST'; | ||
path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'point_in_time'; | ||
|
||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring, | ||
}; | ||
|
||
return this.transport.request(request, options, callback); | ||
} | ||
|
||
module.exports = createPitApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/* eslint camelcase: 0 */ | ||
/* eslint no-unused-vars: 0 */ | ||
|
||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); | ||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; | ||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; | ||
|
||
function deleteAllPitsApi(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 = 'DELETE'; | ||
path = '/' + '_search' + '/' + 'point_in_time' + '/' + '_all'; | ||
|
||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring, | ||
}; | ||
|
||
return this.transport.request(request, options, callback); | ||
} | ||
|
||
module.exports = deleteAllPitsApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/* eslint camelcase: 0 */ | ||
/* eslint no-unused-vars: 0 */ | ||
|
||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); | ||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; | ||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; | ||
|
||
function deletePitApi(params, options, callback) { | ||
[params, options, callback] = normalizeArguments(params, options, callback); | ||
|
||
// check required parameters | ||
if (params['body'] == null) { | ||
const err = new this[kConfigurationError]('Missing required parameter: body'); | ||
return handleError(err, callback); | ||
} | ||
|
||
let { method, body, ...querystring } = params; | ||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring); | ||
|
||
let path = ''; | ||
if (method == null) method = 'DELETE'; | ||
path = '/' + '_search' + '/' + 'point_in_time'; | ||
|
||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring, | ||
}; | ||
|
||
return this.transport.request(request, options, callback); | ||
} | ||
|
||
module.exports = deletePitApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/* eslint camelcase: 0 */ | ||
/* eslint no-unused-vars: 0 */ | ||
|
||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); | ||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; | ||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; | ||
|
||
function getAllPitsApi(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 = '/' + '_search' + '/' + 'point_in_time' + '/' + '_all'; | ||
|
||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: null, | ||
querystring, | ||
}; | ||
|
||
return this.transport.request(request, options, callback); | ||
} | ||
|
||
module.exports = getAllPitsApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.