Sha256: 13ed69b6a0d9a5f619720e2e347b5056f9238891ae58c89f94183a52b07be7f1

Contents?: true

Size: 974 Bytes

Versions: 29

Compression:

Stored size: 974 Bytes

Contents

module Fog
  module AWS
    module EC2
      class Real

        # Delete a key pair that you own
        #
        # ==== Parameters
        # * key_name<~String> - Name of the key pair.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'requestId'<~String> id of request
        #     * 'return'<~Boolean> - success?
        def delete_key_pair(key_name)
          request(
            'Action'  => 'DeleteKeyPair',
            'KeyName' => key_name,
            :parser   => Fog::Parsers::AWS::EC2::Basic.new
          )
        end

      end

      class Mock

        def delete_key_pair(key_name)
          response = Excon::Response.new
          @data[:key_pairs].delete(key_name)
          response.status = 200
          response.body = {
            'requestId' => Fog::AWS::Mock.request_id,
            'return'    => true
          }
          response
        end

      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
fog-0.1.0 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.100 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.99 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.98 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.97 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.96 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.95 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.94 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.93 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.92 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.91 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.90 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.89 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.88 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.87 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.86 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.85 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.84 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.83 lib/fog/aws/requests/ec2/delete_key_pair.rb
fog-0.0.82 lib/fog/aws/requests/ec2/delete_key_pair.rb