Class: Conduit4R

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/conduit4r.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(host, user, pass) ⇒ Conduit4R

# API returned 401 Unauthorized class UnauthorizedException < Exception end

# API could not find record class RecordNotFound < Exception end



14
15
16
17
18
# File 'lib/conduit4r.rb', line 14

def initialize(host, user, pass)
  self.class.base_uri host
  self.class.basic_auth user, pass
  self.class.format :json
end

Instance Method Details

#assets(query = {}) ⇒ Object

Get assets

Parameters

  • :per_page – OPTIONAL, how many results to return per page

  • :start_index – OPTIONAL, the index of the result to start with. If :per_page = 10, setting :start_index = 10 will

give you the second page of results, :start_index = 20 will give you the third page of results, etc.



36
37
38
# File 'lib/conduit4r.rb', line 36

def assets(query = {})
  self.class.get("/assets.json", :query => query)
end

#vulnerabilities(query = {}) ⇒ Object

Get vulnerabilities

Parameters

  • :per_page – OPTIONAL, how many results to return per page

  • :start_index – OPTIONAL, the index of the result to start with. If :per_page = 10, setting :start_index = 10 will

give you the second page of results, :start_index = 20 will give you the third page of results, etc.



26
27
28
# File 'lib/conduit4r.rb', line 26

def vulnerabilities(query = {})
  self.class.get("/vulnerabilities.json", :query => query)
end