class OpsviewRest::Hosttemplate

Attributes

opsview[RW]
options[RW]
resource_type[RW]

Public Class Methods

new(opsview, options = {}) click to toggle source
# File lib/opsview_rest/hosttemplate.rb, line 9
def initialize(opsview, options = {})
  @options = {
    name: 'Unknown',
    description: 'Unknown',
    servicechecks: [],
    managementurls: [],
    save: true,
    replace: false
  }.update options

  @opsview = opsview
  @resource_type = @options[:type]

  @options[:servicechecks] = @options[:servicechecks].map { |x| { 'name' => x } }

  save(@options[:replace]) if @options[:save]
end