Sha256: 73359fafd43efaedaee71edd703362f9a0bf21b2488e89e6049d93875e7f2fdd

Contents?: true

Size: 1.05 KB

Versions: 54

Compression:

Stored size: 1.05 KB

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_tags(id)
          response = Excon::Response.new

          response.status = self.get_network(id).status

          net = self.get_network(id).body
          unless net['error']
            tags = @tags.map do |tag|
              tag if tag['resourceTableId'] == id
            end.compact
          end

          net['tagReferences'] = tags if net.is_a?(Hash)
          response.body = net

          if 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_tags(id)
          self.request(:network_vlan, id, :query => 'objectMask=mask[tagReferences]')
        end
      end
    end
  end
end

Version data entries

54 entries across 52 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/network/get_network_tags.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/network/get_network_tags.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.1.4 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.1.3 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.1.2 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.1.1 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.1.0 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.0.3 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.0.2 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.0.1 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-1.0.0 lib/fog/softlayer/requests/network/get_network_tags.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.7 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.6 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.5 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.4 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.3 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.2 lib/fog/softlayer/requests/network/get_network_tags.rb
fog-softlayer-0.4.2.pre lib/fog/softlayer/requests/network/get_network_tags.rb