Sha256: 76721bd52d71a726bd527dc77103703a9536cb78d7266d339323445549d8fb5c

Contents?: true

Size: 1.03 KB

Versions: 39

Compression:

Stored size: 1.03 KB

Contents

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

module Fog
  module Rackspace
    class Monitoring
      class Checks < Fog::Collection
        attribute :entity
        attribute :marker

        model Fog::Rackspace::Monitoring::Check

        def all(options={})
          requires :entity
          data = service.list_checks(entity.identity, options).body
          self.marker = data['metadata']['next_marker']

          load(data['values'])
        end

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

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

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

Version data entries

39 entries across 37 versions & 6 rubygems

Version Path
fog-rackspace-0.1.6 lib/fog/rackspace/models/monitoring/checks.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/monitoring/checks.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/monitoring/checks.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/monitoring/checks.rb
fog-rackspace-0.1.5 lib/fog/rackspace/models/monitoring/checks.rb
fog-rackspace-0.1.4 lib/fog/rackspace/models/monitoring/checks.rb
fog-rackspace-0.1.3 lib/fog/rackspace/models/monitoring/checks.rb
fog-rackspace-0.1.2 lib/fog/rackspace/models/monitoring/checks.rb
fog-rackspace-0.1.1 lib/fog/rackspace/models/monitoring/checks.rb
fog-rackspace-0.1.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-1.37.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-1.36.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-1.35.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-2.0.0.pre.0 lib/fog/rackspace/models/monitoring/checks.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/rackspace/models/monitoring/checks.rb
fog-1.34.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-1.33.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-1.32.0 lib/fog/rackspace/models/monitoring/checks.rb
fog-1.31.0 lib/fog/rackspace/models/monitoring/checks.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/rackspace/models/monitoring/checks.rb