lib/elasticsearch/xpack/api/actions/security/clear_cached_roles.rb in elasticsearch-xpack-7.6.0 vs lib/elasticsearch/xpack/api/actions/security/clear_cached_roles.rb in elasticsearch-xpack-7.7.0.pre
- old
+ new
@@ -5,30 +5,31 @@
module Elasticsearch
module XPack
module API
module Security
module Actions
- # TODO: Description
-
+ # Evicts roles from the native role cache.
#
# @option arguments [List] :name Role name
-
+ # @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html
#
def clear_cached_roles(arguments = {})
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
+ headers = arguments.delete(:headers) || {}
+
arguments = arguments.clone
_name = arguments.delete(:name)
method = Elasticsearch::API::HTTP_POST
path = "_security/role/#{Elasticsearch::API::Utils.__listify(_name)}/_clear_cache"
params = {}
body = nil
- perform_request(method, path, params, body).body
+ perform_request(method, path, params, body, headers).body
end
end
end
end
end