lib/fog/openstack/models/identity/tenant.rb in fog-1.8.0 vs lib/fog/openstack/models/identity/tenant.rb in fog-1.9.0
- old
+ new
@@ -13,49 +13,49 @@
def to_s
self.name
end
def roles_for(user)
- connection.roles(
+ service.roles(
:tenant => self,
:user => user)
end
def users
requires :id
- connection.users(:tenant => self)
+ service.users(:tenant_id => self.id)
end
def destroy
requires :id
- connection.delete_tenant(self.id)
+ service.delete_tenant(self.id)
true
end
def update(attr = nil)
requires :id
merge_attributes(
- connection.update_tenant(self.id, attr || attributes).body['tenant'])
+ service.update_tenant(self.id, attr || attributes).body['tenant'])
self
end
def save
requires :name
identity ? update : create
end
def create
merge_attributes(
- connection.create_tenant(attributes).body['tenant'])
+ service.create_tenant(attributes).body['tenant'])
self
end
def grant_user_role(user_id, role_id)
- connection.add_user_to_tenant(self.id, user_id, role_id)
+ service.add_user_to_tenant(self.id, user_id, role_id)
end
def revoke_user_role(user_id, role_id)
- connection.remove_user_from_tenant(self.id, user_id, role_id)
+ service.remove_user_from_tenant(self.id, user_id, role_id)
end
end # class Tenant
end # class OpenStack
end # module Identity
end # module Fog