Class: Fog::Compute::Gridscale::PaasSecurityZone

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

Instance Method Summary collapse

Instance Method Details

#deleteObject



21
22
23
24
25
# File 'lib/fog/compute/gridscale/models/paas_security_zone.rb', line 21

def delete
  requires :object_uuid
  response = service.paas_security_zone_delete object_uuid
  response.body
end

#destroyObject



27
28
29
30
31
# File 'lib/fog/compute/gridscale/models/paas_security_zone.rb', line 27

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

#saveObject

Raises:

  • (Fog::Errors::Error)


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/compute/gridscale/models/paas_security_zone.rb', line 33

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

  options = {}

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



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

  data = service.paas_security_zone_create(name, options)

  merge_attributes(data.body)
  true
end

#updateObject



55
56
57
58
59
60
# File 'lib/fog/compute/gridscale/models/paas_security_zone.rb', line 55

def update
  requires :object_uuid
  data = service.paas_security_zone_update(object_uuid)
  merge_attributes(data.body)
  true
end