Sha256: 1a0c07e2d5b9aa33676a340d8f87cce814dddf65e3655bfa2e994f20f58840e5

Contents?: true

Size: 877 Bytes

Versions: 27

Compression:

Stored size: 877 Bytes

Contents

# coding: utf-8

module Fog
  module Compute
    class SakuraCloud
      class Real
        def stop_server( id, force = false )
          if force
            body = { "Force" => true }
          else
            body = {}
          end
          request(
            :headers => {
              'Authorization' => "Basic #{@auth_encord}"
            },
            :expects  => [200,202],
            :method => 'DELETE',
            :path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/server/#{id}/power",
            :body => Fog::JSON.encode(body)
          )
          true
        end
      end # Real

      class Mock
        def stop_server( id, force = false )
          response = Excon::Response.new
          response.status = 202
          response.body = {
          }
          response
        end
      end
    end # SakuraCloud
  end # Volume
end # Fog

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
fog-sakuracloud-1.3.2 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.3.1 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.3.0 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.2.0 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.1.1 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.1.0 lib/fog/sakuracloud/requests/compute/stop_server.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-sakuracloud-1.0.1/lib/fog/sakuracloud/requests/compute/stop_server.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.0.1 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-1.0.0 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-0.1.2 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-0.1.1 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-0.1.0 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-0.0.4 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-0.0.3 lib/fog/sakuracloud/requests/compute/stop_server.rb
fog-sakuracloud-0.0.1 lib/fog/sakuracloud/requests/compute/stop_server.rb
ns-fog-1.22.11 lib/fog/sakuracloud/requests/compute/stop_server.rb
ns-fog-1.22.10 lib/fog/sakuracloud/requests/compute/stop_server.rb
ns-fog-1.22.9 lib/fog/sakuracloud/requests/compute/stop_server.rb
ns-fog-1.22.8 lib/fog/sakuracloud/requests/compute/stop_server.rb