Sha256: c236afa713b57e5feb0d5dda3f5ce37a703efc58b6a97c2322e65f14862d8c82

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

require 'fog/compute/gridscale/models/paging_collection'

module Fog
  module Compute
    class Gridscale
      class SnapshotSchedules < Fog::Compute::Gridscale::PagingCollection
        model Fog::Compute::Gridscale::SnapshotSchedule

        def all(filters={})
          data = service.snapshot_schedules_get(filters)
          snapshot_schedules = data.body["snapshot_schedules"].values
          load(snapshot_schedules)
        end

        def get(payload)
          snapshot_schedule = service.snapshot_schedule_get(payload).body['snapshot_schedule']
          new(snapshot_schedule) if snapshot_schedule
        rescue Fog::Errors::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-gridscale-0.1.5 lib/fog/compute/gridscale/models/snapshot_schedules.rb
fog-gridscale-0.1.4 lib/fog/compute/gridscale/models/snapshot_schedules.rb
fog-gridscale-0.1.3 lib/fog/compute/gridscale/models/snapshot_schedules.rb
fog-gridscale-0.1.2 lib/fog/compute/gridscale/models/snapshot_schedules.rb