| 
 | 1 | +# Licensed to Elasticsearch B.V. under one or more contributor  | 
 | 2 | +# license agreements. See the NOTICE file distributed with  | 
 | 3 | +# this work for additional information regarding copyright  | 
 | 4 | +# ownership. Elasticsearch B.V. licenses this file to you under  | 
 | 5 | +# the Apache License, Version 2.0 (the "License"); you may  | 
 | 6 | +# not use this file except in compliance with the License.  | 
 | 7 | +# You may obtain a copy of the License at  | 
 | 8 | +#  | 
 | 9 | +#   http://www.apache.org/licenses/LICENSE-2.0  | 
 | 10 | +#  | 
 | 11 | +# Unless required by applicable law or agreed to in writing,  | 
 | 12 | +# software distributed under the License is distributed on an  | 
 | 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY  | 
 | 14 | +# KIND, either express or implied.  See the License for the  | 
 | 15 | +# specific language governing permissions and limitations  | 
 | 16 | +# under the License.  | 
 | 17 | +#  | 
 | 18 | +# This code was automatically generated from the Elasticsearch Specification  | 
 | 19 | +# See https://github.com/elastic/elasticsearch-specification  | 
 | 20 | +# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.  | 
 | 21 | +module Elasticsearch  | 
 | 22 | +  module API  | 
 | 23 | +    module Indices  | 
 | 24 | +      module Actions  | 
 | 25 | +        # Update data stream settings.  | 
 | 26 | +        # This API can be used to override settings on specific data streams. These overrides will take precedence over what  | 
 | 27 | +        # is specified in the template that the data stream matches. To prevent your data stream from getting into an invalid state,  | 
 | 28 | +        # only certain settings are allowed. If possible, the setting change is applied to all  | 
 | 29 | +        # backing indices. Otherwise, it will be applied when the data stream is next rolled over.  | 
 | 30 | +        #  | 
 | 31 | +        # @option arguments [String, Array] :name A comma-separated list of data streams or data stream patterns. (*Required*)  | 
 | 32 | +        # @option arguments [Boolean] :dry_run If `true`, the request does not actually change the settings on any data streams or indices. Instead, it  | 
 | 33 | +        #  simulates changing the settings and reports back to the user what would have happened had these settings  | 
 | 34 | +        #  actually been applied.  | 
 | 35 | +        # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. If no response is  | 
 | 36 | +        #  received before the timeout expires, the request fails and returns an  | 
 | 37 | +        #  error. Server default: 30s.  | 
 | 38 | +        # @option arguments [Time] :timeout The period to wait for a response. If no response is received before the  | 
 | 39 | +        #   timeout expires, the request fails and returns an error. Server default: 30s.  | 
 | 40 | +        # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors  | 
 | 41 | +        #  when they occur.  | 
 | 42 | +        # @option arguments [String] :filter_path Comma-separated list of filters in dot notation which reduce the response  | 
 | 43 | +        #  returned by Elasticsearch.  | 
 | 44 | +        # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.  | 
 | 45 | +        #  For example `"exists_time": "1h"` for humans and  | 
 | 46 | +        #  `"eixsts_time_in_millis": 3600000` for computers. When disabled the human  | 
 | 47 | +        #  readable values will be omitted. This makes sense for responses being consumed  | 
 | 48 | +        #  only by machines.  | 
 | 49 | +        # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use  | 
 | 50 | +        #  this option for debugging only.  | 
 | 51 | +        # @option arguments [Hash] :headers Custom HTTP headers  | 
 | 52 | +        # @option arguments [Hash] :body settings  | 
 | 53 | +        #  | 
 | 54 | +        # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-settings  | 
 | 55 | +        #  | 
 | 56 | +        def put_data_stream_settings(arguments = {})  | 
 | 57 | +          request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_stream_settings' }  | 
 | 58 | + | 
 | 59 | +          defined_params = [:name].each_with_object({}) do |variable, set_variables|  | 
 | 60 | +            set_variables[variable] = arguments[variable] if arguments.key?(variable)  | 
 | 61 | +          end  | 
 | 62 | +          request_opts[:defined_params] = defined_params unless defined_params.empty?  | 
 | 63 | + | 
 | 64 | +          raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]  | 
 | 65 | +          raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]  | 
 | 66 | + | 
 | 67 | +          arguments = arguments.clone  | 
 | 68 | +          headers = arguments.delete(:headers) || {}  | 
 | 69 | + | 
 | 70 | +          body = arguments.delete(:body)  | 
 | 71 | + | 
 | 72 | +          _name = arguments.delete(:name)  | 
 | 73 | + | 
 | 74 | +          method = Elasticsearch::API::HTTP_PUT  | 
 | 75 | +          path   = "_data_stream/#{Utils.listify(_name)}/_settings"  | 
 | 76 | +          params = Utils.process_params(arguments)  | 
 | 77 | + | 
 | 78 | +          Elasticsearch::API::Response.new(  | 
 | 79 | +            perform_request(method, path, params, body, headers, request_opts)  | 
 | 80 | +          )  | 
 | 81 | +        end  | 
 | 82 | +      end  | 
 | 83 | +    end  | 
 | 84 | +  end  | 
 | 85 | +end  | 
0 commit comments