Class: Fog::Compute::Gridscale::Firewall

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

Instance Method Summary collapse

Instance Method Details

#destroyObject



35
36
37
38
39
# File 'lib/fog/compute/gridscale/models/firewall.rb', line 35

def destroy
  requires :object_uuid
  response = service.firewall_delete object_uuid
  response.body
end

#saveObject

Raises:

  • (Fog::Errors::Error)


20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/compute/gridscale/models/firewall.rb', line 20

def save
  raise Fog::Errors::Error.new('Re-saving an existing object may create a duplicate') if persisted?
  requires :name, :rules
  options = {}


  if attributes[:labels]
    options[:labels] = labels
  end

  data = service.firewall_create(name, rules, options)
  merge_attributes(data.body)
  true
end