Method: Fog::OpenStack::Image::V2::Real#create_image

Defined in:
lib/fog/openstack/image/v2/requests/create_image.rb

#create_image(image) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fog/openstack/image/v2/requests/create_image.rb', line 6

def create_image(image)
  location = image.delete :location
  headers = {}
  headers["Location"] = location if location

  request(
    :headers => headers,
    :expects => [201],
    :method  => 'POST',
    :path    => "images",
    :body    => Fog::JSON.encode(image)
  )
end