Method: Fog::Compute::IBM::Mock#create_image

Defined in:
lib/fog/ibm/requests/compute/create_image.rb

#create_image(instance_id, name, description) ⇒ Object

[View source]

40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fog/ibm/requests/compute/create_image.rb', line 40

def create_image(instance_id, name, description)
  response = Excon::Response.new
  if instance_exists? instance_id
    image = Fog::IBM::Mock.private_image(name, description)
    self.data[:images][image["id"]] = image
    response.status = 200
    response.body = image
  else
    response.status = 404
  end
  response
end