Sha256: f35c098fda925452d3e736c498e8671addf4c7243df8310896c183664be0bd6c

Contents?: true

Size: 875 Bytes

Versions: 2

Compression:

Stored size: 875 Bytes

Contents

module Fog
  module Compute
    class OpenStack
      class Real
        def evacuate_server(server_id, host = nil, on_shared_storage = nil, admin_password = nil)
          evacuate                    = {}
          evacuate['host']            = host if host

          if !microversion_newer_than?('2.13') && on_shared_storage
            evacuate['onSharedStorage'] = on_shared_storage
          end

          evacuate['adminPass']       = admin_password if admin_password
          body                        = {
            'evacuate' => evacuate
          }
          server_action(server_id, body)
        end
      end

      class Mock
        def evacuate_server(_server_id, _host, _on_shared_storage, _admin_password = nil)
          response        = Excon::Response.new
          response.status = 202
          response
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/compute/openstack/requests/evacuate_server.rb
fog-openstack-0.3.10 lib/fog/compute/openstack/requests/evacuate_server.rb