Class: Fog::AWS::IAM::User

Inherits:
Model
  • Object
show all
Defined in:
lib/rackspace-fog/aws/models/iam/user.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#access_keysObject



32
33
34
35
# File 'lib/rackspace-fog/aws/models/iam/user.rb', line 32

def access_keys
  requires :id
  connection.access_keys(:username => id)
end

#destroyObject



21
22
23
24
25
# File 'lib/rackspace-fog/aws/models/iam/user.rb', line 21

def destroy
  requires :id
  connection.delete_user(id)
  true
end

#policiesObject



27
28
29
30
# File 'lib/rackspace-fog/aws/models/iam/user.rb', line 27

def policies
  requires :id
  connection.policies(:username => id)
end

#saveObject



14
15
16
17
18
19
# File 'lib/rackspace-fog/aws/models/iam/user.rb', line 14

def save
  requires :id
  data = connection.create_user(id).body['User']
  merge_attributes(data)
  true
end