Sha256: 582febfa357379d27074e82810764685636cb8f6f4e4bddfa6e5e02b8f79d399

Contents?: true

Size: 979 Bytes

Versions: 4

Compression:

Stored size: 979 Bytes

Contents

# Author::        Christopher Brito (cbrito@gmail.com)
# Original Repo:: https://github.com/cbrito/splunk-client

require File.expand_path File.join(File.dirname(__FILE__), 'splunk_results')
require File.expand_path File.join(File.dirname(__FILE__), 'splunk_job')
require File.expand_path File.join(File.dirname(__FILE__), 'splunk_alert_feed_entry')


class SplunkAlertFeed

  def initialize(alertFeedXml, clientPointer=nil)
    @alertFeedXml = alertFeedXml
    @client = clientPointer #SplunkClient object pointer for use with self.results
  end

  def totalResults
    @alertXml.css("*totalResults").text
  end
  
  def itemsPerPage
    @alertXml.css("*itemsPerPage").text
  end

  def startIndex
    @alertXml.css("*startIndex").text
  end
  
  def entries
    alertEntries = Array.new
    
    @alertFeedXml.css("entry").each do |entry|
      alertEntries.push SplunkAlertFeedEntry.new(entry, @client)
    end
    
    return alertEntries
  end
  
end #class SplunkAlertFeed

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
splunk-client-0.10.0 lib/splunk_client/splunk_alert_feed.rb
splunk-client-0.9.0 lib/splunk_client/splunk_alert_feed.rb
splunk-client-0.8.1 lib/splunk_client/splunk_alert_feed.rb
splunk-client-0.8.0 lib/splunk_client/splunk_alert_feed.rb