Class: Fog::Compute::Google::Firewall
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Google::Firewall
- Defined in:
- lib/fog/compute/google/models/firewall.rb
Overview
Represents a Firewall resource
Instance Method Summary collapse
Instance Method Details
#destroy(async = true) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/fog/compute/google/models/firewall.rb', line 40 def destroy(async = true) requires :identity data = service.delete_firewall(identity) operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"]) operation.wait_for { ready? } unless async operation end |
#save ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/fog/compute/google/models/firewall.rb', line 22 def save requires :identity, :allowed, :network data = service.insert_firewall(identity, allowed, network, attributes) operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"]) operation.wait_for { !pending? } reload end |
#update ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/fog/compute/google/models/firewall.rb', line 31 def update requires :identity, :allowed, :network data = service.update_firewall(identity, allowed, network, attributes) operation = Fog::Compute::Google::Operations.new(:service => service).get(data.body["name"]) operation.wait_for { !pending? } reload end |