Class: ForemanProbing::Scan
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ForemanProbing::Scan
- Includes:
- Taxonomix
- Defined in:
- app/models/foreman_probing/scan.rb
Instance Attribute Summary collapse
-
#direct ⇒ Object
Returns the value of attribute direct.
-
#search_query ⇒ Object
Returns the value of attribute search_query.
-
#subnet_id ⇒ Object
Returns the value of attribute subnet_id.
-
#target_kind ⇒ Object
Returns the value of attribute target_kind.
Instance Method Summary collapse
Instance Attribute Details
#direct ⇒ Object
Returns the value of attribute direct.
17 18 19 |
# File 'app/models/foreman_probing/scan.rb', line 17 def direct @direct end |
#search_query ⇒ Object
Returns the value of attribute search_query.
17 18 19 |
# File 'app/models/foreman_probing/scan.rb', line 17 def search_query @search_query end |
#subnet_id ⇒ Object
Returns the value of attribute subnet_id.
17 18 19 |
# File 'app/models/foreman_probing/scan.rb', line 17 def subnet_id @subnet_id end |
#target_kind ⇒ Object
Returns the value of attribute target_kind.
17 18 19 |
# File 'app/models/foreman_probing/scan.rb', line 17 def target_kind @target_kind end |
Instance Method Details
#available_scan_types ⇒ Object
33 34 35 |
# File 'app/models/foreman_probing/scan.rb', line 33 def available_scan_types ['TCP', 'UDP', 'ICMP'] end |
#ports ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/foreman_probing/scan.rb', line 19 def ports if @ports.nil? return [] if raw_ports.nil? ranges = raw_ports.split(',') ports = ranges.map do |range| range.split('-').map do |from, to| to.nil? ? from : (from..to).entries end end @ports = ports.flatten.map(&:chomp).map(&:to_i) end @ports end |
#target_kinds ⇒ Object
37 38 39 |
# File 'app/models/foreman_probing/scan.rb', line 37 def target_kinds ['Direct', 'Subnet', 'Host', 'Proxy'] end |