Sha256: 3142d766a4904b18a22de1467c21d05654eb1f69c9ad92fecef89fa046e29e46

Contents?: true

Size: 855 Bytes

Versions: 13

Compression:

Stored size: 855 Bytes

Contents

module Fog
  module Compute
    class CloudSigma
      class Real
        def stop_server(server_id, graceful_acpi = false)
          action = graceful_acpi ? :shutdown : :stop
          request(:path => "servers/#{server_id}/action/",
                  :method => 'POST',
                  :query => {:do => action},
                  :expects => [200, 202])
        end
      end

      class Mock
        def stop_server(server_id, graceful_acpi = false)
          server = self.data[:servers][server_id]
          server['status'] = 'stopped'

          response = Excon::Response.new
          response.status = 200
          response.body = {
              'action' => graceful_acpi ? 'shutdown' : 'stop',
              'result' => 'success',
              'uuid' => server_id
          }

          response
        end
      end
    end
  end
end

Version data entries

13 entries across 11 versions & 3 rubygems

Version Path
fog-2.3.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-ifeel-2.2.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-2.2.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-2.1.0 lib/fog/cloudsigma/requests/stop_server.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/cloudsigma/requests/stop_server.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/cloudsigma/requests/stop_server.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/cloudsigma/requests/stop_server.rb
fog-1.42.1 lib/fog/cloudsigma/requests/stop_server.rb
fog-2.0.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-1.42.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-1.41.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-1.40.0 lib/fog/cloudsigma/requests/stop_server.rb
fog-1.39.0 lib/fog/cloudsigma/requests/stop_server.rb