Sha256: b3c45d76eb850488e93bec0982301d132493950efa487d580e85c4bcf5118bf0

Contents?: true

Size: 806 Bytes

Versions: 11

Compression:

Stored size: 806 Bytes

Contents

def test
  connection = Fog::Compute.new({ :provider => "Google" })
  time = Time.now.utc.to_i
  disk = connection.disks.create({
    :name => "foggydisk-#{time}",
    :size_gb => 10,
    :zone_name => 'us-central1-a',
    :source_image => 'centos-6-v20131120',
  })

  disk.wait_for { disk.ready? }
  params = {
    :name => "fog-smoke-test-#{Time.now.to_i}",
    :machine_type => "f1-micro",
    :zone_name => "us-central1-a",
    :disks => [ disk.get_as_boot_disk(true) ],
    :username => ENV['USER']
  }

  server = connection.servers.bootstrap params

  begin
    raise "Could not bootstrap sshable server." unless server.ssh("whoami")
    raise "Could not delete server." unless server.destroy
    raise "Could not delete disk." unless disk.destroy
  rescue Exception => e
    p e.message
  end
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/launch_micro_instance.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-google-0.1.0/examples/launch_micro_instance.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-google-0.1.0/examples/launch_micro_instance.rb
fog-google-0.1.3 examples/launch_micro_instance.rb
fog-google-0.1.2 examples/launch_micro_instance.rb
fog-google-0.1.1 examples/launch_micro_instance.rb
fog-google-0.1.0 examples/launch_micro_instance.rb
fog-google-0.0.9 examples/launch_micro_instance.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-google-0.0.7/examples/launch_micro_instance.rb
fog-google-0.0.7 examples/launch_micro_instance.rb
fog-google-0.0.6 examples/launch_micro_instance.rb