Sha256: 0293c64243138dd904a7e988be438ee87ec8fb13110f90df4f144f0571d52e40

Contents?: true

Size: 570 Bytes

Versions: 6

Compression:

Stored size: 570 Bytes

Contents

module Yao::Resources
  class Subnet < Base

    include NetworkAssociationable
    include ProjectAssociationable

    friendly_attributes :name, :cidr, :gateway_ip, :network_id, :ip_version,
                        :dns_nameservers, :host_routes, :enable_dhcp

    # @return [Array<Range>]
    def allocation_pools
      self["allocation_pools"].map do |pool|
        pool["start"]..pool["end"]
      end
    end

    alias dhcp_enabled? enable_dhcp

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yao-0.21.0 lib/yao/resources/subnet.rb
yao-0.20.0 lib/yao/resources/subnet.rb
yao-0.19.0 lib/yao/resources/subnet.rb
yao-0.18.0 lib/yao/resources/subnet.rb
yao-0.17.0 lib/yao/resources/subnet.rb
yao-0.16.0 lib/yao/resources/subnet.rb