Module: Nessus::Client::Policy
- Included in:
- Nessus::Client
- Defined in:
- lib/nessus/client/policy.rb
Overview
Policy Auxiliary Methods collapse
-
#policies ⇒ Array<Array<String>>
and their policy IDs.
-
#policy_id_by_name(name) ⇒ String
Looks up policy ID by policy name.
-
#policy_name_by_id(id) ⇒ String
Looks up policy name by policy ID.
Instance Method Summary collapse
-
#policy_list ⇒ Object
GET /policy/list.
Instance Method Details
#policies ⇒ Array<Array<String>>
and their policy IDs
15 16 17 18 19 |
# File 'lib/nessus/client/policy.rb', line 15 def policies policy_list.map do |policy| [policy['policyname'], policy['policyid']] end end |
#policy_id_by_name(name) ⇒ String
Returns looks up policy ID by policy name.
22 23 24 25 26 |
# File 'lib/nessus/client/policy.rb', line 22 def policy_id_by_name(name) policy_list.find{|policy| policy['policyname'].eql? name}['policyid'] rescue nil end |
#policy_list ⇒ Object
GET /policy/list
6 7 8 9 |
# File 'lib/nessus/client/policy.rb', line 6 def policy_list response = get '/policy/list' response['reply']['contents']['policies']['policy'] end |
#policy_name_by_id(id) ⇒ String
Returns looks up policy name by policy ID.
29 30 31 32 33 |
# File 'lib/nessus/client/policy.rb', line 29 def policy_name_by_id(id) policy_list.find{|policy| policy['policyid'].eql? id}['policyname'] rescue nil end |