Sha256: bbaa39319e32386267c01f92fab75a3a4fee3a200851716b9772f99af62b7e41

Contents?: true

Size: 811 Bytes

Versions: 17

Compression:

Stored size: 811 Bytes

Contents

require 'fog/core/collection'
require 'fog/rackspace/models/identity/user'

module Fog
  module Rackspace
    class Identity
      class Users < Fog::Collection

        model Fog::Rackspace::Identity::User

        def all
          data = service.list_users.body['users']
          load(data)
        end

        def get(user_id)
          data = service.get_user_by_id(user_id).body['user']
          new(data)
        rescue Excon::Errors::NotFound
          nil
        rescue Excon::Errors::NotAuthorized
          nil
        end

        def get_by_name(user_name)
          data = service.get_user_by_name(user_name).body['user']
          new(data)
        rescue Excon::Errors::NotFound
          nil
        rescue Excon::Errors::NotAuthorized
          nil
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
gapinc-fog-1.12.1.1 lib/fog/rackspace/models/identity/users.rb
gapinc-fog-1.12.1a lib/fog/rackspace/models/identity/users.rb
gapinc-fog-1.12.1 lib/fog/rackspace/models/identity/users.rb
fog-1.12.1 lib/fog/rackspace/models/identity/users.rb
fog-1.12.0 lib/fog/rackspace/models/identity/users.rb
hpfog-0.0.20 lib/fog/rackspace/models/identity/users.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/rackspace/models/identity/users.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/rackspace/models/identity/users.rb
fog-1.11.1 lib/fog/rackspace/models/identity/users.rb
fog-1.11.0 lib/fog/rackspace/models/identity/users.rb
fog-1.10.1 lib/fog/rackspace/models/identity/users.rb
fog-test-me-1.10.0 lib/fog/rackspace/models/identity/users.rb
fog-1.10.0 lib/fog/rackspace/models/identity/users.rb
fog-1.9.0 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/rackspace/models/identity/users.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/rackspace/models/identity/users.rb