Sha256: 58a36c03053a666780979ac80b86eaff724a3664a2b2c0c9ef2d4bcb7ad59cf1

Contents?: true

Size: 589 Bytes

Versions: 5

Compression:

Stored size: 589 Bytes

Contents

module Fog
  module AWS
    class EC2

      class KeyPair < Fog::Model

        attribute :fingerprint, 'keyFingerprint'
        attribute :material,    'keyMaterial'
        attribute :name,        'keyName'

        def delete
          connection.delete_key_pair(@name)
          true
        end

        def save
          data = connection.create_key_pair(@name).body
          new_attributes = data.reject {|key,value| !['keyFingerprint', 'keyMaterial', 'keyName'].include?(key)}
          update_attributes(new_attributes)
          true
        end

      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-0.0.9 lib/fog/aws/models/ec2/key_pair.rb
fog-0.0.8 lib/fog/aws/models/ec2/key_pair.rb
fog-0.0.7 lib/fog/aws/models/ec2/key_pair.rb
fog-0.0.6 lib/fog/aws/models/ec2/key_pair.rb
fog-0.0.5 lib/fog/aws/models/ec2/key_pair.rb