Sha256: f471cf60c84c35dfa1b25d40462a6381ae1bf7ca489aa19f348566560a6e408e

Contents?: true

Size: 623 Bytes

Versions: 11

Compression:

Stored size: 623 Bytes

Contents

def test
  connection = Fog::Compute.new({ :provider => "Google" })

  rawdisk = {
    :source         => nil, # Google Cloud Storage URL pointing to the disk image. (e.g. http://storage.googleapis.com/test/test.tar.gz)
    :container_type => 'TAR',
  }

  # Can't test this unless the 'source' points to a valid URL
  return if rawdisk[:source].nil?

  img = connection.images.create(:name             => 'test-image',
                                :description      => 'Test image (via fog)',
                                :raw_disk         => rawdisk)

  img.reload # will raise if image was not saved correctly
end

Version data entries

11 entries across 9 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-google-0.1.0/examples/image_create.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-google-0.1.0/examples/image_create.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-google-0.1.0/examples/image_create.rb
fog-google-0.1.3 examples/image_create.rb
fog-google-0.1.2 examples/image_create.rb
fog-google-0.1.1 examples/image_create.rb
fog-google-0.1.0 examples/image_create.rb
fog-google-0.0.9 examples/image_create.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-google-0.0.7/examples/image_create.rb
fog-google-0.0.7 examples/image_create.rb
fog-google-0.0.6 examples/image_create.rb