Class: Fog::Compute::Google::InstanceTemplate

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/google/models/instance_template.rb

Instance Method Summary collapse

Instance Method Details

#destroy(async = true) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/fog/compute/google/models/instance_template.rb', line 37

def destroy(async = true)
  requires :name
  data = service.delete_instance_template(name)
  operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name)
  operation.wait_for { ready? } unless async
  operation
end

#saveObject



27
28
29
30
31
32
33
34
35
# File 'lib/fog/compute/google/models/instance_template.rb', line 27

def save
  requires :name
  requires :properties

  data = service.insert_instance_template(name, properties, description)
  operation = Fog::Compute::Google::Operations.new(:service => service).get(data.name)
  operation.wait_for { ready? }
  reload
end