-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed Legacy X-Pack Point-In-Time API Signed-off-by: Theo Truong <[email protected]>
- Loading branch information
Showing
19 changed files
with
509 additions
and
220 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
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
.bundle | ||
.config | ||
.yardoc | ||
.ruby-version | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
|
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
46 changes: 46 additions & 0 deletions
46
opensearch-api/lib/opensearch/api/actions/cat/all_pit_segments.rb
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,46 @@ | ||
# 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. | ||
# | ||
# Modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
module OpenSearch | ||
module API | ||
module Cat | ||
module Actions | ||
# Retrieves info of all PIT segments | ||
# | ||
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml | ||
# @option arguments [List] :h Comma-separated list of column names to display | ||
# @option arguments [Boolean] :help Return help information | ||
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by | ||
# @option arguments [Boolean] :v Verbose mode. Display column headers | ||
# @option arguments [Hash] :headers Custom HTTP headers | ||
def all_pit_segments(arguments = {}) | ||
arguments = arguments.clone | ||
headers = arguments.delete(:headers) || {} | ||
|
||
|
||
method = OpenSearch::API::HTTP_GET | ||
path = '_cat/pit_segments/_all' | ||
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) | ||
params[:h] = Utils.__listify(params[:h]) if params[:h] | ||
|
||
body = nil | ||
perform_request(method, path, params, body, headers).body | ||
end | ||
|
||
ParamsRegistry.register(:all_pit_segments, [ | ||
:format, | ||
:h, | ||
:help, | ||
:s, | ||
:v | ||
].freeze) | ||
end | ||
end | ||
end | ||
end |
49 changes: 49 additions & 0 deletions
49
opensearch-api/lib/opensearch/api/actions/cat/pit_segments.rb
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,49 @@ | ||
# 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. | ||
# | ||
# Modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
module OpenSearch | ||
module API | ||
module Cat | ||
module Actions | ||
# Retrieves info of certain PIT segments | ||
# | ||
# @option arguments [Hash] body: Must include `pit_id`, which is an array of PIT IDs. (required) | ||
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml | ||
# @option arguments [List] :h Comma-separated list of column names to display | ||
# @option arguments [Boolean] :help Return help information | ||
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by | ||
# @option arguments [Boolean] :v Verbose mode. Display column headers | ||
# @option arguments [Hash] :headers Custom HTTP headers | ||
def pit_segments(arguments = {}) | ||
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] | ||
|
||
arguments = arguments.clone | ||
headers = arguments.delete(:headers) || {} | ||
|
||
|
||
method = OpenSearch::API::HTTP_GET | ||
path = '_cat/pit_segments' | ||
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) | ||
params[:h] = Utils.__listify(params[:h]) if params[:h] | ||
|
||
body = arguments[:body] | ||
perform_request(method, path, params, body, headers).body | ||
end | ||
|
||
ParamsRegistry.register(:pit_segments, [ | ||
:format, | ||
:h, | ||
:help, | ||
:s, | ||
:v | ||
].freeze) | ||
end | ||
end | ||
end | ||
end |
50 changes: 0 additions & 50 deletions
50
opensearch-api/lib/opensearch/api/actions/close_point_in_time.rb
This file was deleted.
Oops, something went wrong.
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,45 @@ | ||
# 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. | ||
# | ||
# Modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
module OpenSearch | ||
module API | ||
module Actions | ||
# Creates a point in time. | ||
# | ||
# @option arguments [String] :index The name(s) of the target index(es) for the PIT. May contain a comma-separated list or a wildcard index pattern. (required) | ||
# @option arguments [String] :keep_alive The amount of time to keep the PIT. (required) | ||
# @option arguments [String] :preference The node or the shard used to perform the search. (default: random) | ||
# @option arguments [String] :routing Specifies to route search requests to a specific shard. | ||
# @option arguments [String] :expand_wildcards The type of index that can match the wildcard pattern. Supports comma-separated values. (default: open) | ||
# @option arguments [String] :allow_partial_pit_creation Specifies whether to create a PIT with partial failures. (default: false) | ||
def create_pit(arguments = {}) | ||
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] | ||
raise ArgumentError, "Required argument 'keep_alive' missing" unless arguments[:keep_alive] | ||
|
||
arguments = arguments.clone | ||
_index = arguments.delete(:index) | ||
|
||
method = OpenSearch::API::HTTP_POST | ||
path = "#{Utils.__listify(_index)}/_search/point_in_time" | ||
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) | ||
body = nil | ||
|
||
perform_request(method, path, params, body).body | ||
end | ||
|
||
ParamsRegistry.register(:create_pit, [ | ||
:keep_alive, | ||
:preference, | ||
:routing, | ||
:expand_wildcards, | ||
:allow_partial_pit_creation | ||
].freeze) | ||
end | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
opensearch-api/lib/opensearch/api/actions/delete_all_pits.rb
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,26 @@ | ||
# 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. | ||
# | ||
# Modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
module OpenSearch | ||
module API | ||
module Actions | ||
# Deletes all PITs. | ||
def delete_all_pits(arguments = {}) | ||
method = OpenSearch::API::HTTP_DELETE | ||
path = "_search/point_in_time/_all" | ||
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) | ||
body = nil | ||
|
||
perform_request(method, path, params, body).body | ||
end | ||
|
||
ParamsRegistry.register(:delete_all_pits, [].freeze) | ||
end | ||
end | ||
end |
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,30 @@ | ||
# 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. | ||
# | ||
# Modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
module OpenSearch | ||
module API | ||
module Actions | ||
# Deletes one or several PITs. | ||
# | ||
# @option arguments [Hash] body: Must include `pit_id`, which is an array of PIT IDs to be deleted. (required) | ||
def delete_pit(arguments = {}) | ||
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] | ||
|
||
method = OpenSearch::API::HTTP_DELETE | ||
path = "_search/point_in_time" | ||
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) | ||
body = arguments[:body] | ||
|
||
perform_request(method, path, params, body).body | ||
end | ||
|
||
ParamsRegistry.register(:delete_pit, [].freeze) | ||
end | ||
end | ||
end |
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,26 @@ | ||
# 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. | ||
# | ||
# Modifications Copyright OpenSearch Contributors. See | ||
# GitHub history for details. | ||
|
||
module OpenSearch | ||
module API | ||
module Actions | ||
# Gets all PITs. | ||
def get_all_pits(arguments = {}) | ||
method = OpenSearch::API::HTTP_GET | ||
path = "_search/point_in_time/_all" | ||
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) | ||
body = nil | ||
|
||
perform_request(method, path, params, body).body | ||
end | ||
|
||
ParamsRegistry.register(:get_all_pits, [].freeze) | ||
end | ||
end | ||
end |
Oops, something went wrong.