Skip to content

Commit f17f2bf

Browse files
committed
[API] Updates [delete/update]_by_query, transform APIs
1 parent 924ef64 commit f17f2bf

File tree

7 files changed

+21
-17
lines changed

7 files changed

+21
-17
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ module Actions
4141
# @option arguments [Number] :size Deprecated, please use `max_docs` instead
4242
# @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents)
4343
# @option arguments [List] :sort A comma-separated list of <field>:<direction> pairs
44-
# @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
45-
# @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
46-
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
4744
# @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
4845
# @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes
4946
# @option arguments [Boolean] :version Specify whether to return document version as part of a hit
@@ -112,9 +109,6 @@ def delete_by_query(arguments = {})
112109
:size,
113110
:max_docs,
114111
:sort,
115-
:_source,
116-
:_source_excludes,
117-
:_source_includes,
118112
:terminate_after,
119113
:stats,
120114
:version,

elasticsearch-api/lib/elasticsearch/api/actions/update_by_query.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ module Actions
4343
# @option arguments [Number] :size Deprecated, please use `max_docs` instead
4444
# @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents)
4545
# @option arguments [List] :sort A comma-separated list of <field>:<direction> pairs
46-
# @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
47-
# @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
48-
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
4946
# @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
5047
# @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes
5148
# @option arguments [Boolean] :version Specify whether to return document version as part of a hit
@@ -115,9 +112,6 @@ def update_by_query(arguments = {})
115112
:size,
116113
:max_docs,
117114
:sort,
118-
:_source,
119-
:_source_excludes,
120-
:_source_includes,
121115
:terminate_after,
122116
:stats,
123117
:version,

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/transform/delete_transform.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Actions
2424
#
2525
# @option arguments [String] :transform_id The id of the transform to delete
2626
# @option arguments [Boolean] :force When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
27+
# @option arguments [Time] :timeout Controls the time to wait for the transform deletion
2728
# @option arguments [Hash] :headers Custom HTTP headers
2829
#
2930
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.16/delete-transform.html
@@ -49,7 +50,8 @@ def delete_transform(arguments = {})
4950
#
5051
# @since 6.2.0
5152
ParamsRegistry.register(:delete_transform, [
52-
:force
53+
:force,
54+
:timeout
5355
].freeze)
5456
end
5557
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/transform/preview_transform.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# Previews a transform.
2424
#
2525
# @option arguments [String] :transform_id The id of the transform to preview.
26+
# @option arguments [Time] :timeout Controls the time to wait for the preview
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
# @option arguments [Hash] :body The definition for the transform to preview
2829
#
@@ -46,11 +47,18 @@ def preview_transform(arguments = {})
4647
else
4748
"_transform/_preview"
4849
end
49-
params = {}
50+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
5051

5152
body = arguments[:body]
5253
perform_request(method, path, params, body, headers).body
5354
end
55+
56+
# Register this action with its valid params when the module is loaded.
57+
#
58+
# @since 6.2.0
59+
ParamsRegistry.register(:preview_transform, [
60+
:timeout
61+
].freeze)
5462
end
5563
end
5664
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/transform/put_transform.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Actions
2424
#
2525
# @option arguments [String] :transform_id The id of the new transform.
2626
# @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false.
27+
# @option arguments [Time] :timeout Controls the time to wait for the transform to start
2728
# @option arguments [Hash] :headers Custom HTTP headers
2829
# @option arguments [Hash] :body The transform definition (*Required*)
2930
#
@@ -51,7 +52,8 @@ def put_transform(arguments = {})
5152
#
5253
# @since 6.2.0
5354
ParamsRegistry.register(:put_transform, [
54-
:defer_validation
55+
:defer_validation,
56+
:timeout
5557
].freeze)
5658
end
5759
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/transform/update_transform.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Actions
2424
#
2525
# @option arguments [String] :transform_id The id of the transform. (*Required*)
2626
# @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false.
27+
# @option arguments [Time] :timeout Controls the time to wait for the update
2728
# @option arguments [Hash] :headers Custom HTTP headers
2829
# @option arguments [Hash] :body The update transform definition (*Required*)
2930
#
@@ -51,7 +52,8 @@ def update_transform(arguments = {})
5152
#
5253
# @since 6.2.0
5354
ParamsRegistry.register(:update_transform, [
54-
:defer_validation
55+
:defer_validation,
56+
:timeout
5557
].freeze)
5658
end
5759
end

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/transform/upgrade_transforms.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# Upgrades all transforms.
2424
#
2525
# @option arguments [Boolean] :dry_run Whether to only check for updates but don't execute
26+
# @option arguments [Time] :timeout Controls the time to wait for the upgrade
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
#
2829
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.16/upgrade-transforms.html
@@ -44,7 +45,8 @@ def upgrade_transforms(arguments = {})
4445
#
4546
# @since 6.2.0
4647
ParamsRegistry.register(:upgrade_transforms, [
47-
:dry_run
48+
:dry_run,
49+
:timeout
4850
].freeze)
4951
end
5052
end

0 commit comments

Comments
 (0)