Sha256: b9a21b12090039a629aa48da8c14be8f0ecefef8ff3a076e67c0641cce0fdf47
Contents?: true
Size: 1.14 KB
Versions: 10
Compression:
Stored size: 1.14 KB
Contents
require 'fog/core/model' require 'rackspace-monitoring/monitoring/models/base' module Fog module Monitoring class Rackspace class Alarm < Fog::Monitoring::Rackspace::Base identity :id attribute :entity attribute :entity_id attribute :label attribute :criteria attribute :check_type attribute :check_id attribute :notification_plan_id def prep options = { 'label' => label, 'criteria' => criteria, 'notification_plan_id' => notification_plan_id, } options = options.reject {|key, value| value.nil?} options end def save requires :notification_plan_id options = prep if identity then data = connection.update_alarm(get_entity_id, identity, options) else options['check_type'] = check_type if check_type options['check_id'] = check_id if check_id data = connection.create_alarm(get_entity_id, options) end true end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems