Sha256: 04a7f7b4616dc7ce63ca3a7b8d9a4f65d22a8a78408834954757b84948cb37e7
Contents?: true
Size: 1.25 KB
Versions: 12
Compression:
Stored size: 1.25 KB
Contents
require 'fog/core/model' module Fog module Rackspace class Identity class User < Fog::Model identity :id attribute :username attribute :password, :alias => 'OS-KSADM:password' attribute :email attribute :enabled attribute :created attribute :updated def save requires :username, :email, :enabled if identity.nil? data = connection.create_user(username, email, enabled, :password => password) else data = connection.update_user(identity, username, email, enabled, :password => password) end merge_attributes(data.body['user']) true end def destroy requires :identity connection.delete_user(identity) true end def roles @roles ||= begin Fog::Rackspace::Identity::Roles.new({ :connection => connection, :user => self }) end end def credentials @credentials ||= begin Fog::Rackspace::Identity::Credentials.new({ :connection => connection, :user => self }) end end end end end end
Version data entries
12 entries across 12 versions & 7 rubygems