Sha256: aeeac77f8af09a9940f6469c389e91ceaf7ef96cea0cc8355a58c8bec5c54451

Contents?: true

Size: 649 Bytes

Versions: 41

Compression:

Stored size: 649 Bytes

Contents

module Yao::Resources
  class Port < Base
    friendly_attributes :name, :mac_address, :status, :allowed_address_pairs,
                        :device_owner, :fixed_ips, :security_groups, :device_id,
                        :network_id, :tenant_id, :admin_state_up
    map_attribute_to_attribute "binding:host_id" => :host_id

    def primary_ip
      fixed_ips.first["ip_address"]
    end

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

    def network
      Yao::Network.find network_id
    end

    self.service        = "network"
    self.resource_name  = "port"
    self.resources_name = "ports"
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
yao-0.7.0 lib/yao/resources/port.rb
yao-0.6.3 lib/yao/resources/port.rb
yao-0.6.2 lib/yao/resources/port.rb
yao-0.6.1 lib/yao/resources/port.rb
yao-0.6.0 lib/yao/resources/port.rb
yao-0.5.0 lib/yao/resources/port.rb
yao-0.4.3 lib/yao/resources/port.rb
yao-0.4.2 lib/yao/resources/port.rb
yao-0.4.1 lib/yao/resources/port.rb
yao-0.4.0 lib/yao/resources/port.rb
yao-0.3.8 lib/yao/resources/port.rb
yao-0.3.7 lib/yao/resources/port.rb
yao-0.3.6 lib/yao/resources/port.rb
yao-0.3.5 lib/yao/resources/port.rb
yao-0.3.4 lib/yao/resources/port.rb
yao-0.3.3 lib/yao/resources/port.rb
yao-0.3.2 lib/yao/resources/port.rb
yao-0.3.1 lib/yao/resources/port.rb
yao-0.3.0 lib/yao/resources/port.rb
yao-0.2.13 lib/yao/resources/port.rb