Class: OpsviewRest::Timeperiod
- Inherits:
-
Object
- Object
- OpsviewRest::Timeperiod
- Includes:
- Mixin
- Defined in:
- lib/opsview_rest/timeperiod.rb
Instance Attribute Summary collapse
-
#opsview ⇒ Object
Returns the value of attribute opsview.
-
#options ⇒ Object
Returns the value of attribute options.
-
#resource_type ⇒ Object
Returns the value of attribute resource_type.
Instance Method Summary collapse
-
#initialize(opsview, options = {}) ⇒ Timeperiod
constructor
A new instance of Timeperiod.
Methods included from Mixin
#resource_path, #save, #to_json
Constructor Details
#initialize(opsview, options = {}) ⇒ Timeperiod
Returns a new instance of Timeperiod.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/opsview_rest/timeperiod.rb', line 10 def initialize(opsview, = {}) = { :name => "nonworkhours", :monday => "00:00-09:00,17:00-24:00", :tuesday => "00:00-09:00,17:00-24:00", :wednesday => "00:00-09:00,17:00-24:00", :thursday => "00:00-09:00,17:00-24:00", :friday => "00:00-09:00,17:00-24:00", :saturday => "00:00-24:00", :sunday => "00:00-24:00", :servicecheck_notification_periods => [], :servicecheck_check_periods => [], :host_check_periods => [], :alias => "Non-work hours", :host_notification_periods => [], :save => true, :replace => false }.update @opsview = opsview @resource_type = [:type] @option[:servicecheck_notification_periods] = @option[:servicecheck_notification_periods].map { |x| { "name" => x } } @option[:servicecheck_check_periods] = @option[:servicecheck_check_periods].map { |x| { "name" => x } } @option[:host_check_periods] = @option[:host_check_periods].map { |x| { "name" => x } } @option[:host_notification_periods] = @option[:host_notification_periods].map { |x| { "name" => x } } save([:replace]) if [:save] end |
Instance Attribute Details
#opsview ⇒ Object
Returns the value of attribute opsview.
8 9 10 |
# File 'lib/opsview_rest/timeperiod.rb', line 8 def opsview @opsview end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/opsview_rest/timeperiod.rb', line 8 def end |
#resource_type ⇒ Object
Returns the value of attribute resource_type.
8 9 10 |
# File 'lib/opsview_rest/timeperiod.rb', line 8 def resource_type @resource_type end |