Sha256: 5024bf3c8489c1ae7a74fd74cfbe4b671710270621c658e3ee1408812dc89aca

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 KB

Contents

module Elasticsearch
  module XPack
    module API
      module Security
        module Actions

          # Remove a user from the native realm
          #
          # @option arguments [String] :username username (*Required*)
          # @option arguments [Boolean] :refresh Refresh the index after performing the operation
          #
          # @see https://www.elastic.co/guide/en/x-pack/current/security-api-users.html#security-api-delete-user
          #
          def delete_user(arguments={})
            valid_params = [
              :username,
              :refresh ]

            arguments = arguments.clone
            username  = arguments.delete(:username)

            method = Elasticsearch::API::HTTP_DELETE
            path   = "_xpack/security/user/#{username}"
            params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
            body   = nil

            if Array(arguments[:ignore]).include?(404)
              Elasticsearch::API::Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
            else
              perform_request(method, path, params, body).body
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
elasticsearch-xpack-6.8.1 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-6.8.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-6.3.1 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-6.3.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-6.2.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-6.1.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-6.0.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-5.5.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-5.0.0 lib/elasticsearch/xpack/api/actions/security/delete_user.rb
elasticsearch-xpack-0.1.0.pre lib/elasticsearch/xpack/api/actions/security/delete_user.rb