Class: Yao::Resources::Port

Inherits:
Base
  • Object
show all
Defined in:
lib/yao/resources/port.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#api_version, #service

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #updated

Methods included from RestfullyAccessible

#admin=, #as_member, #client, #create, #destroy, extended, #get, #list, #list_detail, #resources_path, #resources_path=, #return_single_on_querying=, #update, #with_resources_path

Constructor Details

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

Instance Method Details

#networkObject



16
17
18
# File 'lib/yao/resources/port.rb', line 16

def network
  Yao::Network.find network_id
end

#primary_ipObject



8
9
10
# File 'lib/yao/resources/port.rb', line 8

def primary_ip
  fixed_ips.first["ip_address"]
end

#primary_subnetObject



12
13
14
# File 'lib/yao/resources/port.rb', line 12

def primary_subnet
  Yao::Subnet.find fixed_ips.first["subnet_id"]
end