Class: Fog::Compute::Gridscale::SnapshotSchedule

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

Instance Method Summary collapse

Instance Method Details

#deleteObject



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

def delete
  requires :object_uuid
  response = service.ip_delete storage_uuid
  response.body
end

#destroyObject



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

def destroy
  response = service.snapshot_schedule_delete(object_uuid)
  response.body
end

#saveObject

Raises:

  • (Fog::Errors::Error)


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

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

  options = {}

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

  data = service.snapshot_schedule_create(storage_uuid, name, run_interval, keep_snapshots, options)
  merge_attributes(data.body)
  true
end