1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/models/iam/user.rb

40 lines
825 B
Ruby
Raw Normal View History

require 'fog/core/model'
module Fog
module AWS
class IAM
class User < Fog::Model
identity :id, :aliases => 'UserName'
attribute :path, :aliases => 'Path'
attribute :arn, :aliases => 'Arn'
attribute :user_id, :aliases => 'UserId'
def save
requires :id
data = connection.create_user(id).body['User']
merge_attributes(data)
true
end
def destroy
requires :id
connection.delete_user(id)
true
end
def policies
requires :id
connection.policies(:username => id)
end
2012-06-04 09:24:02 -04:00
def access_keys
requires :id
connection.access_keys(:username => id)
2012-06-04 09:24:02 -04:00
end
end
end
end
end