Sha256: 5166751df0d50fd6fb4e25e573e7c98299ec51adbf0e2e755fdb0c90bba8c060

Contents?: true

Size: 1.72 KB

Versions: 7

Compression:

Stored size: 1.72 KB

Contents

module Elasticsearch
  module XPack
    module API
      module MachineLearning
        module Actions

          # Retrieve anomaly records for a job
          #
          # @option arguments [String] :job_id [TODO] (*Required*)
          # @option arguments [Hash] :body Record selection criteria
          # @option arguments [Boolean] :exclude_interim Exclude interim results
          # @option arguments [Int] :from skips a number of records
          # @option arguments [Int] :size specifies a max number of records to get
          # @option arguments [String] :start Start time filter for records
          # @option arguments [String] :end End time filter for records
          # @option arguments [Double] :record_score [TODO]
          # @option arguments [String] :sort Sort records by a particular field
          # @option arguments [Boolean] :desc Set the sort direction
          #
          # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html
          #
          def get_records(arguments={})
            raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]

            valid_params = [
              :exclude_interim,
              :from,
              :size,
              :start,
              :end,
              :record_score,
              :sort,
              :desc ]

            method = Elasticsearch::API::HTTP_GET
            path   = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/results/records"
            params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
            body   = arguments[:body]

            perform_request(method, path, params, body).body
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
elasticsearch-xpack-6.8.1 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
elasticsearch-xpack-6.8.0 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
elasticsearch-xpack-6.3.1 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
elasticsearch-xpack-6.3.0 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
elasticsearch-xpack-6.2.0 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
elasticsearch-xpack-6.1.0 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
elasticsearch-xpack-6.0.0 lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb