Sha256: bc0be09f4045d821d998384db4a320fc7b84fb8f30113c7653bb16b9ec6fe035

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

# Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information

module Elasticsearch
  module XPack
    module API
      module Security
        module Actions

          # Retrieve one or more roles from the native realm
          #
          # @option arguments [String] :name Role name
          #
          # @see https://www.elastic.co/guide/en/x-pack/current/security-api-roles.html#security-api-get-role
          #
          def get_role(arguments={})
            method = Elasticsearch::API::HTTP_GET
            path   = Elasticsearch::API::Utils.__pathify "_xpack/security/role", Elasticsearch::API::Utils.__listify(arguments[:name])
            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

4 entries across 4 versions & 1 rubygems

Version Path
elasticsearch-xpack-6.8.3 lib/elasticsearch/xpack/api/actions/security/get_role.rb
elasticsearch-xpack-6.8.2 lib/elasticsearch/xpack/api/actions/security/get_role.rb
elasticsearch-xpack-7.4.0 lib/elasticsearch/xpack/api/actions/security/get_role.rb
elasticsearch-xpack-7.3.0 lib/elasticsearch/xpack/api/actions/security/get_role.rb