Class: Yao::Resources::Tenant
Instance Attribute Summary
#service
Class Method Summary
collapse
Instance Method Summary
collapse
#server_usage
Methods inherited from Base
#[], #[]=, add_instantiation_name_list, #destroy, friendly_attributes, #id, #initialize, instantiation?, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, map_attributes_to_time, #to_hash, #update
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update
Class Method Details
.accessible ⇒ Object
39
40
41
|
# File 'lib/yao/resources/tenant.rb', line 39
def accessible
as_member { self.list }
end
|
Instance Method Details
19
20
21
|
# File 'lib/yao/resources/tenant.rb', line 19
def meters
@meters ||= Yao::Meter.list({'q.field' => 'project_id', 'q.op' => 'eq', 'q.value' => id})
end
|
29
30
31
|
# File 'lib/yao/resources/tenant.rb', line 29
def meters_by_name(meter_name)
meters.select{|m| m.name == meter_name}
end
|
24
25
26
|
# File 'lib/yao/resources/tenant.rb', line 24
def ports
@ports ||= Yao::Port.list(tenant_id: id)
end
|
34
35
36
|
# File 'lib/yao/resources/tenant.rb', line 34
def role_assignment
Yao::RoleAssignment.get(tenant: id)
end
|
14
15
16
|
# File 'lib/yao/resources/tenant.rb', line 14
def servers
@servers ||= Yao::Server.list(all_tenants: 1, project_id: id)
end
|