Sha256: 58536f3f0f4d0c76aec2b5eb6e7bef07849b1a5685c7124f71103dda728da40a

Contents?: true

Size: 802 Bytes

Versions: 25

Compression:

Stored size: 802 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) ],
    :user => 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

25 entries across 25 versions & 5 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/google/examples/launch_micro_instance.rb
fog-google-0.0.5 examples/launch_micro_instance.rb
fog-google-0.0.4 examples/launch_micro_instance.rb
fog-google-0.0.3 examples/launch_micro_instance.rb
fog-google-0.0.2 examples/launch_micro_instance.rb
fog-1.29.0 lib/fog/google/examples/launch_micro_instance.rb
fog-1.28.0 lib/fog/google/examples/launch_micro_instance.rb
fog-1.27.0 lib/fog/google/examples/launch_micro_instance.rb
fog-1.26.0 lib/fog/google/examples/launch_micro_instance.rb
fog-1.25.0 lib/fog/google/examples/launch_micro_instance.rb
nsidc-fog-1.24.1 lib/fog/google/examples/launch_micro_instance.rb
fog-1.24.0 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.11 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.10 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.9 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.8 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.7 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.6 lib/fog/google/examples/launch_micro_instance.rb
fog-1.23.0 lib/fog/google/examples/launch_micro_instance.rb
ns-fog-1.22.4 lib/fog/google/examples/launch_micro_instance.rb