Sha256: b839c06fe2a93009bda6468d178c3b3b94420f42eae37a2cd0465b1a35caafc1

Contents?: true

Size: 647 Bytes

Versions: 15

Compression:

Stored size: 647 Bytes

Contents

module Yao::Resources
  class Port < Base

    include NetworkAssociationable
    include TenantAssociationable

    friendly_attributes :name, :mac_address, :status, :allowed_address_pairs,
                        :device_owner, :fixed_ips, :security_groups, :device_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
      @subnet ||= Yao::Subnet.find fixed_ips.first["subnet_id"]
    end

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/port.rb
yao-0.13.3 lib/yao/resources/port.rb
yao-0.13.2 lib/yao/resources/port.rb
yao-0.13.1 lib/yao/resources/port.rb
yao-0.13.0 lib/yao/resources/port.rb
yao-0.12.0 lib/yao/resources/port.rb
yao-0.11.3 lib/yao/resources/port.rb
yao-0.11.2 lib/yao/resources/port.rb
yao-0.11.1 lib/yao/resources/port.rb
yao-0.11.0 lib/yao/resources/port.rb
yao-0.10.1 lib/yao/resources/port.rb
yao-0.10.0 lib/yao/resources/port.rb
yao-0.9.1 lib/yao/resources/port.rb
yao-0.9.0 lib/yao/resources/port.rb
yao-0.8.0 lib/yao/resources/port.rb