Sha256: cb79fa123ed2689a525eb08ea31b61261df990be089833be4e687d3e721a0f02

Contents?: true

Size: 994 Bytes

Versions: 5

Compression:

Stored size: 994 Bytes

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
      	def create_image (account, name, no_upload, file, sizes)
          # Just in case it's already set
          name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
          body_data     = {
            'name'             		=> "/Compute-#{@identity_domain}/#{@username}/#{name}",
            'account'					    => account,
            'no_upload'					  => no_upload,
            'file'                => file,
            'sizes'               => sizes
          }
          body_data = body_data.reject {|key, value| value.nil?}

          request(
            :method   => 'POST',
            :expects  => 201,
            :path     => "/imagelist/Compute-#{@identity_domain}/#{@username}/#{name}",
            :body     => Fog::JSON.encode(body_data),
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json'
            }
          )
      	end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/requests/compute/create_image.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/compute/create_image.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/requests/compute/create_image.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/requests/compute/create_image.rb
fog-oraclecloud-0.1.13 lib/fog/oraclecloud/requests/compute/create_image.rb