lib/elasticsearch/xpack/api/actions/transform/preview_transform.rb in elasticsearch-xpack-7.16.0 vs lib/elasticsearch/xpack/api/actions/transform/preview_transform.rb in elasticsearch-xpack-7.16.1

- old
+ new

@@ -21,10 +21,11 @@ module Transform module Actions # Previews a transform. # # @option arguments [String] :transform_id The id of the transform to preview. + # @option arguments [Time] :timeout Controls the time to wait for the preview # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body The definition for the transform to preview # # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.16/preview-transform.html # @@ -44,14 +45,21 @@ path = if _transform_id "_transform/#{Elasticsearch::API::Utils.__listify(_transform_id)}/_preview" else "_transform/_preview" end - params = {} + params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body, headers).body end + + # Register this action with its valid params when the module is loaded. + # + # @since 6.2.0 + ParamsRegistry.register(:preview_transform, [ + :timeout + ].freeze) end end end end end