Sha256: e7192804c1fefc9b873fd009050133567f180c277a95b000353eea55dc4f2c9a
Contents?: true
Size: 1.13 KB
Versions: 25
Compression:
Stored size: 1.13 KB
Contents
require 'fog/openstack/models/collection' require 'fog/identity/openstack/v2/models/user' module Fog module Identity class OpenStack class V2 class Users < Fog::OpenStack::Collection model Fog::Identity::OpenStack::V2::User attribute :tenant_id def all(options = {}) options[:tenant_id] = tenant_id load_response(service.list_users(options), 'users') end def find_by_id(id) find { |user| user.id == id } || Fog::Identity::OpenStack::V2::User.new( service.get_user_by_id(id).body['user'].merge( 'service' => service ) ) end def find_by_name(name) find { |user| user.name == name } || Fog::Identity::OpenStack::V2::User.new( service.get_user_by_name(name).body['user'].merge( 'service' => service ) ) end def destroy(id) user = find_by_id(id) user.destroy end end end end end end
Version data entries
25 entries across 23 versions & 3 rubygems