2010-11-08 12:21:31 +00:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 20:31:12 -05:00
|
|
|
require 'fog/brightbox/models/compute/user'
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Brightbox
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
class Users < Fog::Collection
|
|
|
|
|
2011-06-16 16:28:54 -07:00
|
|
|
model Fog::Compute::Brightbox::User
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
def all
|
2012-12-22 23:29:21 +00:00
|
|
|
data = service.list_users
|
2010-11-08 12:21:31 +00:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
2012-09-14 22:00:15 +05:30
|
|
|
def get(identifier = nil)
|
2012-12-22 23:29:21 +00:00
|
|
|
data = service.get_user(identifier)
|
2010-11-08 12:21:31 +00:00
|
|
|
new(data)
|
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2012-12-22 23:29:21 +00:00
|
|
|
end
|