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.2.12 lib/yao/resources/subnet.rb
yao-0.2.11 lib/yao/resources/subnet.rb
yao-0.2.10 lib/yao/resources/subnet.rb
yao-0.2.9 lib/yao/resources/subnet.rb
yao-0.2.8 lib/yao/resources/subnet.rb
yao-0.2.7 lib/yao/resources/subnet.rb
yao-0.2.6 lib/yao/resources/subnet.rb
yao-0.2.5 lib/yao/resources/subnet.rb
yao-0.2.4 lib/yao/resources/subnet.rb
yao-0.2.2 lib/yao/resources/subnet.rb
yao-0.2.1 lib/yao/resources/subnet.rb
yao-0.2.0 lib/yao/resources/subnet.rb
yao-0.2.0.rc1 lib/yao/resources/subnet.rb
yao-0.1.1 lib/yao/resources/subnet.rb
yao-0.1.0 lib/yao/resources/subnet.rb
yao-0.0.6 lib/yao/resources/subnet.rb
yao-0.0.5 lib/yao/resources/subnet.rb
yao-0.0.4 lib/yao/resources/subnet.rb
yao-0.0.3 lib/yao/resources/subnet.rb
yao-0.0.2 lib/yao/resources/subnet.rb