Sha256: 468aefa48c2a5d09aa55ca7ce76a571b3f7c981b4753ffc743c29e533a63e77a

Contents?: true

Size: 839 Bytes

Versions: 13

Compression:

Stored size: 839 Bytes

Contents

require 'fog/core/model'

module Fog
  module AWS
    class IAM

      class AccessKey < Fog::Model

        identity  :id, :aliases => 'AccessKeyId'
        attribute :username, :aliases => 'UserName'
        attribute :secret_access_key, :aliases => 'SecretAccessKey'
        attribute :status, :aliases => 'Status'
        
        def save
          requires :username

          data = connection.create_access_key('UserName'=> username).body["AccessKey"]
          merge_attributes(data)
          true
        end
        
        def destroy
          requires :id
          requires :username

          connection.delete_access_key(id,'UserName'=> username)
          true
        end
        
        def user
          requires :username
          connection.users.get(username)
        end
        
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/aws/models/iam/access_key.rb
fog-nirvanix-1.8.1 lib/fog/aws/models/iam/access_key.rb
fog-parser-fix-1.6.1 lib/fog/aws/models/iam/access_key.rb
fog-test-again-1.6.0 lib/fog/aws/models/iam/access_key.rb
fog-parser-fix-1.6.0 lib/fog/aws/models/iam/access_key.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/aws/models/iam/access_key.rb
fog-sgonyea-1.8.1 lib/fog/aws/models/iam/access_key.rb
fog-1.8.0 lib/fog/aws/models/iam/access_key.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/models/iam/access_key.rb
fog-1.7.0 lib/fog/aws/models/iam/access_key.rb
fog-1.6.0 lib/fog/aws/models/iam/access_key.rb
fog-1.5.0 lib/fog/aws/models/iam/access_key.rb
fog-1.4.0 lib/fog/aws/models/iam/access_key.rb