Sha256: 8871a884d4867b1c61a8b782b3dfe864936135cb2cfa8a3b64795740a9d2ae7e

Contents?: true

Size: 799 Bytes

Versions: 27

Compression:

Stored size: 799 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 = service.create_access_key('UserName'=> username).body["AccessKey"]
          merge_attributes(data)
          true
        end

        def destroy
          requires :id
          requires :username

          service.delete_access_key(id,'UserName'=> username)
          true
        end

        def user
          requires :username
          service.users.get(username)
        end

      end
    end
  end
end

Version data entries

27 entries across 27 versions & 6 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/aws/models/iam/access_key.rb
fog-1.16.0 lib/fog/aws/models/iam/access_key.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/aws/models/iam/access_key.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/aws/models/iam/access_key.rb
fog-1.15.0 lib/fog/aws/models/iam/access_key.rb
gapinc-fog-1.14.0 lib/fog/aws/models/iam/access_key.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/models/iam/access_key.rb
fog-1.14.0 lib/fog/aws/models/iam/access_key.rb
fog-1.13.0 lib/fog/aws/models/iam/access_key.rb
gapinc-fog-1.12.1.2 lib/fog/aws/models/iam/access_key.rb
gapinc-fog-1.12.1.1 lib/fog/aws/models/iam/access_key.rb
gapinc-fog-1.12.1a lib/fog/aws/models/iam/access_key.rb
gapinc-fog-1.12.1 lib/fog/aws/models/iam/access_key.rb
fog-1.12.1 lib/fog/aws/models/iam/access_key.rb
fog-1.12.0 lib/fog/aws/models/iam/access_key.rb
hpfog-0.0.20 lib/fog/aws/models/iam/access_key.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/models/iam/access_key.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/models/iam/access_key.rb
fog-1.11.1 lib/fog/aws/models/iam/access_key.rb
fog-1.11.0 lib/fog/aws/models/iam/access_key.rb