Sha256: 51b236667204c217a3025dc02b81b22fef52a8b52e7efc898ea3bf407e764fa2

Contents?: true

Size: 808 Bytes

Versions: 39

Compression:

Stored size: 808 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::Unauthorized
          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::Unauthorized
          nil
        end
      end
    end
  end
end

Version data entries

39 entries across 37 versions & 6 rubygems

Version Path
fog-rackspace-0.1.6 lib/fog/rackspace/models/identity/users.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/identity/users.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/identity/users.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/identity/users.rb
fog-rackspace-0.1.5 lib/fog/rackspace/models/identity/users.rb
fog-rackspace-0.1.4 lib/fog/rackspace/models/identity/users.rb
fog-rackspace-0.1.3 lib/fog/rackspace/models/identity/users.rb
fog-rackspace-0.1.2 lib/fog/rackspace/models/identity/users.rb
fog-rackspace-0.1.1 lib/fog/rackspace/models/identity/users.rb
fog-rackspace-0.1.0 lib/fog/rackspace/models/identity/users.rb
fog-1.37.0 lib/fog/rackspace/models/identity/users.rb
fog-1.36.0 lib/fog/rackspace/models/identity/users.rb
fog-1.35.0 lib/fog/rackspace/models/identity/users.rb
fog-2.0.0.pre.0 lib/fog/rackspace/models/identity/users.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/rackspace/models/identity/users.rb
fog-1.34.0 lib/fog/rackspace/models/identity/users.rb
fog-1.33.0 lib/fog/rackspace/models/identity/users.rb
fog-1.32.0 lib/fog/rackspace/models/identity/users.rb
fog-1.31.0 lib/fog/rackspace/models/identity/users.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/rackspace/models/identity/users.rb