lib/yao/resources/floating_ip.rb in yao-0.6.3 vs lib/yao/resources/floating_ip.rb in yao-0.7.0

- old
+ new

@@ -1,9 +1,26 @@ module Yao::Resources class FloatingIP < Base - friendly_attributes :fixed_ip, :instance_id, :ip, :pool + friendly_attributes :router_id, :description, :dns_domain, :dns_name, + :revision_number, :project_id, :tenant_id, + :floating_network_id, :fixed_ip_address, + :floating_ip_address, :port_id, + :status, :port_details, :tags, :port_forwardings - self.service = "compute" - self.resource_name = "os-floating-ip" - self.resources_name = "os-floating-ips" + self.service = "network" + self.resource_name = "floatingip" + self.resources_name = "floatingips" + + def router + @router ||= Yao::Router.get(router_id) + end + + def project + @project ||= Yao::Tenant.get(project_id) + end + alias :tenant :project + + def port + @port ||= Yao::Port.find(port_id) + end end end