Method: Elasticsearch::API::MachineLearning::Actions#get_datafeeds
- Defined in:
- lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb
#get_datafeeds(arguments = {}) ⇒ Object
Get datafeeds configuration info. You can get information for multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can get information for all datafeeds by using _all, by specifying ‘*` as the `<feed_id>`, or by omitting the `<feed_id>`. This API returns a maximum of 10,000 datafeeds.
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 86 87 |
# File 'lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb', line 61 def get_datafeeds(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeeds' } 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)}" else '_ml/datafeeds' end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |