Sha256: 01f806afa3679b8f77e987e53b508febe886796296e57f28ddccb66ba13da638

Contents?: true

Size: 892 Bytes

Versions: 54

Compression:

Stored size: 892 Bytes

Contents

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

module Fog
  module Network
    class Softlayer

      class Mock

        def get_network(id)
          response = Excon::Response.new
          response.status = 200
          response.body = @networks.select { |vlan| vlan['id'] == id }.first
          if response.body.nil?
            response.status = 404
            response.body = "{\"error\":\"Unable to find object with id of '#{id}'.\",\"code\":\"SoftLayer_Exception_ObjectNotFound\"}"
          end
          response
        end

      end

      class Real
        def get_network(id)
          self.request(:network_vlan, "#{id}/get_object", :query => 'objectMask=mask[subnets,tagReferences,type,primaryRouter.datacenter,networkSpace]')
        end
      end
    end
  end
end

Version data entries

54 entries across 52 versions & 3 rubygems

Version Path
fog-softlayer-0.3.12 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.11 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.10 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.9 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.8 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.7 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.6 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.6.pre.f82ffe9 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.6.pre.f7e3358 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.5 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.4.pre lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.3.pre lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.2 lib/fog/softlayer/requests/network/get_network.rb
fog-softlayer-0.3.1 lib/fog/softlayer/requests/network/get_network.rb