lib/elasticsearch/xpack/api/actions/security/clear_cached_roles.rb in elasticsearch-xpack-7.4.0 vs lib/elasticsearch/xpack/api/actions/security/clear_cached_roles.rb in elasticsearch-xpack-7.5.0.pre.pre

- old
+ new

@@ -5,27 +5,32 @@ module Elasticsearch module XPack module API module Security module Actions + # TODO: Description - # Clears the internal caches for specified roles # - # @option arguments [String] :name Role name (*Required*) + # @option arguments [List] :name Role name + # - # @see https://www.elastic.co/guide/en/x-pack/current/security-api-roles.html#security-api-clear-role-cache + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html # - def clear_cached_roles(arguments={}) + def clear_cached_roles(arguments = {}) raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] - method = Elasticsearch::API::HTTP_PUT - path = "_xpack/security/role/#{arguments[:name]}/_clear_cache" + 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 + body = nil perform_request(method, path, params, body).body end - end end + end end end end