Class: Fog::Compute::Gridscale::Cas

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

Instance Method Summary collapse

Instance Method Details

#destroyObject



42
43
44
45
46
# File 'lib/fog/compute/gridscale/models/cas.rb', line 42

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

#saveObject

Raises:

  • (Fog::Errors::Error)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/fog/compute/gridscale/models/cas.rb', line 23

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

  options ={}

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

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

  data = service.cas_create(name, action_payload,filters, event_type, action_type, options)
  merge_attributes(data.body)
  true
end