60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/fog/ibm/requests/compute/create_instance.rb', line 60
def create_instance(name, image_id, instance_type, location, options={})
response = Excon::Response.new
case name
when /FAIL:\ (\d{3})/
response.status = $1.to_i
raise Excon::Errors.status_error({:expects => 200}, response)
else
instance = Fog::IBM::Mock.create_instance(name, image_id, instance_type, location, options)
self.data[:instances][instance['id']] = instance
response.status = 200
response.body = {"instances" => [ instance ]}
response
end
end
|