Sha256: 368efe84496bb22a24a618fb663c763eaa67c696fa8222a7cbdf39b362294ccc

Contents?: true

Size: 865 Bytes

Versions: 10

Compression:

Stored size: 865 Bytes

Contents

module Fog
  module Compute
    class CloudAtCost
      class Real
        def power_off(id)
          body = { :sid => "#{id}", :action => 'poweroff' }
          request(
            :expects => [200],
            :method  => 'POST',
            :path    => 'api/v1/powerop.php',
            :body    => body,
          )
        end
      end

      class Mock
        def power_off(id)
          response         = Excon::Response.new
          response.status  = 200
          response.body    = {
            'server_id'   => Fog::Mock.random_numbers(1).to_i,
            'api'        => 'v1',
            'status'     => 'ok',
            'result'     => 'successful',
            'action'     => 'poweroff',
            'time'       => 12312323,
            'taskid'     => 123123123123
          }
          response
        end
      end
    end
  end
end

Version data entries

10 entries across 8 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-cloudatcost-0.1.2/lib/fog/cloudatcost/requests/power_off.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-cloudatcost-0.1.2/lib/fog/cloudatcost/requests/power_off.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-cloudatcost-0.1.2/lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.2.3 lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.2.2 lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.2.1 lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.2.0 lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.1.2 lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.1.1 lib/fog/cloudatcost/requests/power_off.rb
fog-cloudatcost-0.1.0 lib/fog/cloudatcost/requests/power_off.rb