Method: Fog::Compute::AWS::Real#describe_key_pairs

Defined in:
lib/fog/compute/requests/aws/describe_key_pairs.rb

#describe_key_pairs(filters = {}) ⇒ Object

Describe all or specified key pairs

Parameters

  • filters<~Hash> - List of filters to limit results with

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘keySet’<~Array>:

        • ‘keyName’<~String> - Name of key

        • ‘keyFingerprint’<~String> - Fingerprint of key

Amazon API Reference



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/compute/requests/aws/describe_key_pairs.rb', line 22

def describe_key_pairs(filters = {})
  unless filters.is_a?(Hash)
    Formatador.display_line("[yellow][WARN] describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead[/] [light_black](#{caller.first})[/]")
    filters = {'key-name' => [*filters]}
  end
  params = Fog::AWS.indexed_filters(filters)
  request({
    'Action'    => 'DescribeKeyPairs',
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::DescribeKeyPairs.new
  }.merge!(params))
end