lib/fog/octocloud/models/compute/cube.rb
# Create a new local cube from a local/remote source.
#
# Requires :name and :source attributes.
#
# :source can be either a local or remote (HTTP) box/ova
#
# @example
#     octoc = Fog::Compute.new( :provider => 'octocloud' )
#     octoc.cubes.create :name => 'test-cube',
#                        :source => "https://foo.bar/my-remote.ova",
#                        :extra_opts => { :show_progress => false }
#
Create a new local cube from a local/remote source.
Requires :name and :source attributes.

:source can be either a local or remote (HTTP) box/ova
Create a new local cube from a local / remote source . Requires : name and : source attributes . : source can be either a local or remote ( HTTP ) box / ova
def save
          requires :name, :source
          source_md5 = file_md5(source)
          if exist_cube = service.cubes.get(name)
            if exist_cube.md5 == source_md5
              return
            else
              exist_cube.destroy
            end
          end
          if File.extname(source) == '.vmdk'
            service.local_import_vmdk(name, source, source_md5, attributes)
          else
            service.local_import_box(name, source, source_md5, attributes[:extra_opts])
          end
        end
def save requires :name , :source source_md5 = file_md5 ( source ) if exist_cube = service . cubes . get ( name ) if exist_cube . md5 == source_md5 return else exist_cube . destroy end end if File . extname ( source ) == '.vmdk' service . local_import_vmdk ( name , source , source_md5 , attributes ) else service . local_import_box ( name , source , source_md5 , attributes [ :extra_opts ] ) end end
Create a new local cube from a local/remote source.
Create a new local cube from a local / remote source .
# Nothing has changed, bail # Kill it, so we can re-import
example
None