Sha256: 1bf8fee504571773e5ccc031e3d9061f5e96a7a5c87ed789a290b547354ead14

Contents?: true

Size: 848 Bytes

Versions: 1

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true

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

      class Mock
        def reset(_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'     => 'reset',
            'time'       => 12_312_323,
            'taskid'     => 123_123_123_123
          }
          response
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-cloudatcost-0.4.0 lib/fog/cloudatcost/requests/reset.rb