1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[Openstack|Compute] Migration and Console output

This commit is contained in:
Hunter Nield 2012-02-23 16:40:52 +08:00 committed by Nelvin Driz
parent 8974ff0de6
commit e90b4c0757
3 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,28 @@
module Fog
module Compute
class OpenStack
class Real
def get_console_output(server_id, log_length)
body = { 'os-getConsoleOutput' => {
'length' => log_length
}}
server_action(server_id, body)
end
end
class Mock
def get_console_output(server_id, log_length)
response = Excon::Response.new
response.status = 202
response
end
end
end
end
end

View file

@ -0,0 +1,30 @@
module Fog
module Compute
class OpenStack
class Real
def live_migrate_server(server_id, host, block_migration, disk_over_commit)
body = { 'os-migrateLive' => {
'host' => host,
'block_migration' => block_migration,
'disk_over_commit' => disk_over_commit,
}}
server_action(server_id, body)
end
end
class Mock
def live_migrate_server(server_id, host, block_migration, disk_over_commit)
response = Excon::Response.new
response.status = 202
response
end
end
end
end
end

View file

@ -0,0 +1,26 @@
module Fog
module Compute
class OpenStack
class Real
def migrate_server(server_id)
body = { 'migrate' => nil }
server_action(server_id, body)
end
end
class Mock
def migrate_server(server_id)
response = Excon::Response.new
response.status = 202
response
end
end
end
end
end