Sha256: 2d5bc608a9cb05db1e5a72acb70d279e3a9d4d9bae90b9fe6e3011b93995668c

Contents?: true

Size: 825 Bytes

Versions: 5

Compression:

Stored size: 825 Bytes

Contents

module Fog
  module AWS
    class EC2

      def key_pairs
        Fog::AWS::EC2::KeyPairs.new(:connection => self)
      end

      class KeyPairs < Fog::Collection

        def all(key_name = [])
          data = connection.describe_key_pairs(key_name).body
          key_pairs = Fog::AWS::EC2::KeyPairs.new(:connection => connection)
          data['keySet'].each do |key|
            key_pairs << Fog::AWS::EC2::KeyPair.new({
              :connection => connection
            }.merge!(key))
          end
          key_pairs
        end

        def create(attributes = {})
          bucket = new(attributes)
          bucket.save
          bucket
        end

        def new(attributes = {})
          Fog::AWS::EC2::KeyPair.new(attributes.merge!(:connection => connection))
        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_pairs.rb
fog-0.0.8 lib/fog/aws/models/ec2/key_pairs.rb
fog-0.0.7 lib/fog/aws/models/ec2/key_pairs.rb
fog-0.0.6 lib/fog/aws/models/ec2/key_pairs.rb
fog-0.0.5 lib/fog/aws/models/ec2/key_pairs.rb