Class: Yao::Resources::Project

Inherits:
Base
  • Object
show all
Includes:
ServerUsageAssociationable
Defined in:
lib/yao/resources/project.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#service

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ServerUsageAssociationable

#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

Methods included from RestfullyAccessible

#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #find_next_link, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update

Constructor Details

This class inherits a constructor from Yao::Resources::Base

Class Method Details

.accessibleObject



35
36
37
# File 'lib/yao/resources/project.rb', line 35

def accessible
  as_member { self.list }
end

Instance Method Details

#domain?Bool

Returns:

  • (Bool)


14
15
16
# File 'lib/yao/resources/project.rb', line 14

def domain?
  @data["is_domain"]
end

#portsYao::Resources::Port



24
25
26
# File 'lib/yao/resources/project.rb', line 24

def ports
  @ports ||= Yao::Port.list(tenant_id: id)
end

#role_assignmentYao::Resources::RoleAssignment



29
30
31
# File 'lib/yao/resources/project.rb', line 29

def role_assignment
  Yao::RoleAssignment.get(project: id)
end

#serversArray<Yao::Resources::Server>

Returns:



19
20
21
# File 'lib/yao/resources/project.rb', line 19

def servers
  @servers ||= Yao::Server.list(all_tenants: 1, project_id: id)
end