Sha256: f6c4837f55764b0cd37f2e4ebea706200c9ae898a890588bc87d921edf0b6b7b

Contents?: true

Size: 925 Bytes

Versions: 8

Compression:

Stored size: 925 Bytes

Contents

require 'rackspace-fog/core/collection'
require 'rackspace-monitoring/monitoring/models/check'

module Fog
  module Monitoring
    class Rackspace
      class Checks < Fog::Collection

        attribute :entity

        model Fog::Monitoring::Rackspace::Check

        def all
          requires :entity
          data = connection.list_checks(entity.identity).body['values']
          load(data)
        end

        def get(check_id)
          requires :entity
          data = connection.get_check(entity.identity, check_id).body
          new(data)
        rescue Fog::Monitoring::Rackspace::NotFound
          nil
        end

        def new(attributes = {})
          requires :entity
          super({ :entity => entity }.merge!(attributes))
        end

        def create(attributes = {})
          requires :entity
          super({ :entity => entity }.merge!(attributes))
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rackspace-monitoring-0.2.18 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.15 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.14 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.13 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.12 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.11 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.10 lib/rackspace-monitoring/monitoring/models/checks.rb
rackspace-monitoring-0.2.9 lib/rackspace-monitoring/monitoring/models/checks.rb