Class: Fog::Compute::Google::Network

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

Overview

Represents a Network resource

Instance Method Summary collapse

Instance Method Details

#destroy(async = true) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/google/models/compute/network.rb', line 30

def destroy(async=true)
  requires :identity

  data = service.delete_network(identity)
  operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body['name'])
  unless async
    operation.wait_for { ready? }
  end
  operation
end

#saveObject



21
22
23
24
25
26
27
28
# File 'lib/fog/google/models/compute/network.rb', line 21

def save
  requires :identity, :ipv4_range

  data = service.insert_network(identity, self.ipv4_range, self.attributes)
  operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body['name'])
  operation.wait_for { !pending? }
  reload
end