class Anvil::VulnerabilityTemplate
Attributes
args[R]
client[R]
Public Class Methods
new(client)
click to toggle source
# File lib/anvil/vulnerability_template.rb, line 7 def initialize(client) if client.class != Anvil::Client raise ArgumentError, "client param must be a Client class" end @client = client end
Public Instance Methods
create!(params)
click to toggle source
# File lib/anvil/vulnerability_template.rb, line 21 def create!(params) conn = Faraday.new(:url => "#{@client.base_url}") conn.post '/api/v2/vulnerability_templates', vulnerability_template: params end
search(value)
click to toggle source
# File lib/anvil/vulnerability_template.rb, line 14 def search(value) url = URI.parse("#{@client.base_url}/api/v2/vulnerability_templates/?value=#{value}") req = Net::HTTP::Get.new(url.to_s) res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) } JSON.parse(res.body) end