Method: Elasticsearch::API::MachineLearning::Actions#get_datafeed_stats
- Defined in:
- lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb
#get_datafeed_stats(arguments = {}) ⇒ Object
Get datafeed stats. You can get statistics for multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can get statistics for all datafeeds by using _all, by specifying ‘*` as the `<feed_id>`, or by omitting the `<feed_id>`. If the datafeed is stopped, the only information you receive is the datafeed_id and the state. This API returns a maximum of 10,000 datafeeds.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb', line 59 def get_datafeed_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeed_stats' } defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_GET path = if _datafeed_id "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_stats" else '_ml/datafeeds/_stats' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |