lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb in elasticsearch-xpack-7.3.0 vs lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb in elasticsearch-xpack-7.4.0

- old
+ new

@@ -18,19 +18,22 @@ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html # def post_data(arguments={}) raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id] raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - valid_params = [ - :reset_start, - :reset_end ] method = Elasticsearch::API::HTTP_POST path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_data" - params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params + params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end + + # Register this action with its valid params when the module is loaded. + # + # @since 7.4.0 + ParamsRegistry.register(:post_data, [ :reset_start, + :reset_end ].freeze) end end end end end