Sha256: dc5a58a8fd671875c96218f24275e68dd808d598a0a3ed7fb92626c3dd83c672

Contents?: true

Size: 541 Bytes

Versions: 41

Compression:

Stored size: 541 Bytes

Contents

module Yao::Resources
  class Subnet < Base
    friendly_attributes :name, :cidr, :gateway_ip, :network_id, :tenant_id, :ip_version,
                        :dns_nameservers, :host_routes, :enable_dhcp

    def allocation_pools
      self["allocation_pools"].map do |pool|
        pool["start"]..pool["end"]
      end
    end

    def network
      Yao::Network.find network_id
    end

    alias dhcp_enabled? enable_dhcp

    self.service        = "network"
    self.resource_name  = "subnet"
    self.resources_name = "subnets"
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

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