Class: Yao::Resources::Port
Instance Attribute Summary
#service
Instance Method Summary
collapse
included, #project
included, #network
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
Instance Method Details
#floating_ip ⇒ Yao::FloatingIP
23
24
25
26
27
28
29
30
31
|
# File 'lib/yao/resources/port.rb', line 23
def floating_ip
if defined?(@floating_ip)
@floating_ip
else
@floating_ip = Yao::FloatingIP.list(port_id: id).first
end
end
|
#has_floating_ip? ⇒ Bool
34
35
36
|
# File 'lib/yao/resources/port.rb', line 34
def has_floating_ip?
!!floating_ip
end
|
#primary_ip ⇒ String
13
14
15
|
# File 'lib/yao/resources/port.rb', line 13
def primary_ip
fixed_ips.first["ip_address"]
end
|
18
19
20
|
# File 'lib/yao/resources/port.rb', line 18
def primary_subnet
@subnet ||= Yao::Subnet.find fixed_ips.first["subnet_id"]
end
|