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:
parent
8974ff0de6
commit
e90b4c0757
3 changed files with 84 additions and 0 deletions
28
lib/fog/openstack/requests/compute/get_console_output.rb
Normal file
28
lib/fog/openstack/requests/compute/get_console_output.rb
Normal 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
|
30
lib/fog/openstack/requests/compute/live_migrate_server.rb
Normal file
30
lib/fog/openstack/requests/compute/live_migrate_server.rb
Normal 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
|
26
lib/fog/openstack/requests/compute/migrate_server.rb
Normal file
26
lib/fog/openstack/requests/compute/migrate_server.rb
Normal 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
|
Loading…
Reference in a new issue