class Fog::Compute::Google::Firewall

Represents a Firewall resource

@see developers.google.com/compute/docs/reference/latest/firewalls

Public Instance Methods

create() click to toggle source
# File lib/fog/compute/google/models/firewall.rb, line 34
def create
  data = service.insert_firewall(identity, attributes)
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { !pending? }
  reload
end
destroy(async = true) click to toggle source
# File lib/fog/compute/google/models/firewall.rb, line 62
def destroy(async = true)
  requires :identity

  data = service.delete_firewall(identity)
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { ready? } unless async
  operation
end
patch(diff = {}) click to toggle source
# File lib/fog/compute/google/models/firewall.rb, line 52
def patch(diff = {})
  requires :identity

  data = service.patch_firewall(identity, diff)
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { !pending? }
  reload
end
save() click to toggle source
# File lib/fog/compute/google/models/firewall.rb, line 28
def save
  requires :identity

  id.nil? ? create : update
end
update() click to toggle source
# File lib/fog/compute/google/models/firewall.rb, line 42
def update
  requires :identity, :allowed, :network

  data = service.update_firewall(identity, attributes)
  operation = Fog::Compute::Google::Operations.new(:service => service)
                                              .get(data.name)
  operation.wait_for { !pending? }
  reload
end