elasticsearch-api/lib/elasticsearch/api/actions/indices/add_block.rb
# Adds a block to an index.
#
# @option arguments [List] :index A comma separated list of indices to add a block to
# @option arguments [String] :block The block to add (one of read, write, read_only or metadata)
# @option arguments [Time] :timeout Explicit operation timeout
# @option arguments [Time] :master_timeout Specify timeout for connection to master
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html
#
Adds a block to an index.
Adds a block to an index .
def add_block(arguments = {})
          raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
          raise ArgumentError, "Required argument 'block' missing" unless arguments[:block]
          headers = arguments.delete(:headers) || {}
          body = nil
          arguments = arguments.clone
          _index = arguments.delete(:index)
          _block = arguments.delete(:block)
          method = Elasticsearch::API::HTTP_PUT
          path   = "#{Utils.__listify(_index)}/_block/#{Utils.__listify(_block)}"
          params = Utils.process_params(arguments)
          perform_request(method, path, params, body, headers).body
        end
def add_block ( arguments = { } ) raise ArgumentError , "Required argument 'index' missing" unless arguments [ :index ] raise ArgumentError , "Required argument 'block' missing" unless arguments [ :block ] headers = arguments . delete ( :headers ) || { } body = nil arguments = arguments . clone _index = arguments . delete ( :index ) _block = arguments . delete ( :block ) method = Elasticsearch :: API :: HTTP_PUT path = "#{Utils.__listify(_index)}/_block/#{Utils.__listify(_block)}" params = Utils . process_params ( arguments ) perform_request ( method , path , params , body , headers ) . body end
Adds a block to an index.
Adds a block to an index .
arguments
:headers Custom HTTP headers
: headers Custom HTTP headers
see
None