class OwaspZap::Alert
Public Class Methods
new(params = {})
click to toggle source
# File lib/owasp_zap/alert.rb, line 3 def initialize(params = {}) #handle params @base = params[:base] @target = params[:target] end
Public Instance Methods
view(format = "JSON")
click to toggle source
the API has an option to give an offset (start) and the amount of alerts (count) as parameter
# File lib/owasp_zap/alert.rb, line 11 def view(format = "JSON") raise OwaspZap::WrongFormatException,"Output format not accepted" unless ["JSON","HTML","XML"].include?(format) #http://localhost:8080/JSON/core/view/alerts/?zapapiformat=JSON&baseurl=http%3A%2F%2F192.168.1.113&start=&count= url = Addressable::URI.parse "#{@base}/#{format}/core/view/alerts/" url.query_values = {:zapapiformat=>format,:baseurl=>@target} RestClient::get url.normalize.to_str end