Sha256: 5f60b77001f4e3a0acebf084b8245de69c615bc09604ff69575c99af26d234aa

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

#
# Author:: Manuel David Franco Barrios (<mafraba@gmail.com>)
# © Copyright IBM Corporation 2015.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#
module Fog
  module Compute
    class Softlayer

      class Mock

        # Starts a BM server
        # @param [Integer] id
        # @return [Excon::Response]
        def power_on_bare_metal_server(id)
          response = Excon::Response.new
          response.status = 200
          found = self.get_bare_metal_servers.body.map{|server| server['id']}.include?(id)
          if not found
            response.status = 404
            response.body = {
              "error" => "Unable to find object with id of '#{id}'.",
              "code" => "SoftLayer_Exception_ObjectNotFound"
            }
          else
            response.body = true
          end
          response
        end
      end

      class Real

        def power_on_bare_metal_server(id)
          request(:hardware_server, "#{id.to_s}/powerOn", :http_method => :GET)
        end

      end
    end
  end
end

Version data entries

21 entries across 19 versions & 3 rubygems

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