Sha256: 7763d92b00133ca8e06315f14b8f84ee995a0162046939582e55623cd871659d

Contents?: true

Size: 670 Bytes

Versions: 35

Compression:

Stored size: 670 Bytes

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

require 'fog/core/collection'
require 'fog/softlayer/models/network/subnet'

module Fog
  module Network
    class Softlayer
      class Subnets < Fog::Collection
        attribute :filters

        model Fog::Network::Softlayer::Subnet

        def all
          load(service.list_subnets.body)
        end

        def get(id)
          if subnet = service.get_subnet(id).body
            new(subnet)
          end
        rescue Fog::Network::Softlayer::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
fog-softlayer-0.4.2.pre lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.4.1 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.4.0 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.30 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.29 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.28 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.27 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.26 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.25 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.24 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.23 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.22 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.21 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.20 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.19 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.18 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.17 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.16 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.15 lib/fog/softlayer/models/network/subnets.rb
fog-softlayer-0.3.14 lib/fog/softlayer/models/network/subnets.rb