Sha256: 37ca6d4a596073ee25a6302467e1a71eecc0b2166d75d15d9a73f557419381cd

Contents?: true

Size: 1.32 KB

Versions: 3

Compression:

Stored size: 1.32 KB

Contents

require 'fog/core/model'
require 'rackspace-monitoring/monitoring/models/base'

module Fog
  module Monitoring
    class Rackspace
      class Check < Fog::Monitoring::Rackspace::Base

        identity :id
        attribute :entity

        attribute :label
        attribute :metadata
        attribute :target_alias
        attribute :target_resolver
        attribute :target_hostname
        attribute :period
        attribute :timeout
        attribute :type
        attribute :details
        attribute :disabled
        attribute :monitoring_zones_poll

        def save
          raise Fog::Errors::Error.new('Update not implemented yet.') if identity
          requires :type
          requires :entity
          options = {
            'label'       => label,
            'metadata'    => metadata,
            'target_alias'=> target_alias,
            'target_resolver' => target_resolver,
            'target_hostname' => target_hostname,
            'period' => period,
            'timeout'=> timeout,
            'details'=> details,
            'monitoring_zones_poll'=> monitoring_zones_poll,
            'disabled'=> disabled
          }
          options = options.reject {|key, value| value.nil?}
          data = connection.create_check(entity.identity, type, options)
          true
        end

      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rackspace-monitoring-0.1.2 lib/rackspace-monitoring/monitoring/models/check.rb
rackspace-monitoring-0.1.1 lib/rackspace-monitoring/monitoring/models/check.rb
rackspace-monitoring-0.1.0 lib/rackspace-monitoring/monitoring/models/check.rb