class Fog::Compute::SakuraCloud::Mock
Public Class Methods
new(options = {})
click to toggle source
# File lib/fog/sakuracloud/compute.rb, line 57 def initialize(options = {}) end
Public Instance Methods
boot_server( id )
click to toggle source
# File lib/fog/sakuracloud/requests/compute/boot_server.rb, line 20 def boot_server( id ) response = Excon::Response.new response.status = 200 response.body = { } response end
create_server(options)
click to toggle source
# File lib/fog/sakuracloud/requests/compute/create_server.rb, line 41 def create_server(options) response = Excon::Response.new response.status = 201 response.body = { } response end
delete_server( id, force = false, disks = [] )
click to toggle source
# File lib/fog/sakuracloud/requests/compute/delete_server.rb, line 22 def delete_server( id, force = false, disks = [] ) response = Excon::Response.new response.status = 200 response.body = { } response end
list_plans(options = {})
click to toggle source
# File lib/fog/sakuracloud/requests/compute/list_plans.rb, line 18 def list_plans(options = {}) response = Excon::Response.new response.status = 200 response.body = { "ServerPlans" => [ {"Index"=>0, "ID"=>1001, "Name"=>"プラン/1Core-1GB", "CPU"=>1, "MemoryMB"=>1024, "ServiceClass"=>"cloud/plan/1core-1gb", "Availability"=>"available"}, {"Index"=>1, "ID"=>2001, "Name"=>"プラン/1Core-2GB", "CPU"=>1, "MemoryMB"=>2048, "ServiceClass"=>"cloud/plan/1core-2gb", "Availability"=>"available"} ] } response end
list_servers(options = {})
click to toggle source
# File lib/fog/sakuracloud/requests/compute/list_servers.rb, line 18 def list_servers(options = {}) response = Excon::Response.new response.status = 200 response.body = { "Servers" => [ {"Index" => 0, "ID"=>112600055376, "Name"=>"foober1", "ServerPlan"=> {}, "Instance"=> {}, "Disks"=> []}, {"Index" => 1, "ID"=>112600055377, "Name"=>"foober2", "ServerPlan"=> {}, "Instance"=> {}, "Disks"=> []} ] } response end
list_ssh_keys(options = {})
click to toggle source
# File lib/fog/sakuracloud/requests/compute/list_ssh_keys.rb, line 18 def list_ssh_keys(options = {}) response = Excon::Response.new response.status = 200 response.body = { "SSHKeys"=> [ {"Index"=>0, "ID"=>"888888888888", "Name"=>"foobar1", "PublicKey"=>"ssh-rsa dummy"}, {"Index"=>1, "ID"=>"999999999999", "Name"=>"foobar2", "PublicKey"=>"ssh-rsa dummy"} ] } response end
list_zones(options = {})
click to toggle source
# File lib/fog/sakuracloud/requests/compute/list_zones.rb, line 18 def list_zones(options = {}) response = Excon::Response.new response.status = 200 response.body = { "Zones" => [ {"Index"=>0, "ID"=>31001, "Name"=>"is1a", "Description"=>"石狩第1ゾーン"}, {"Index"=>1, "ID"=>31002, "Name"=>"is1b", "Description"=>"石狩第2ゾーン"} ] } response end
stop_server( id, force = false )
click to toggle source
# File lib/fog/sakuracloud/requests/compute/stop_server.rb, line 26 def stop_server( id, force = false ) response = Excon::Response.new response.status = 202 response.body = { } response end