Class: PassiveTotal::Client::Host

Inherits:
Base
  • Object
show all
Defined in:
lib/passivetotal/clients/host.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST, Base::VERSION

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassiveTotal::Client::Base

Instance Method Details

#components(query, start_at: nil, end_at: nil) ⇒ Hash

Retrieves the host attribute components of a query. api.passivetotal.org/api/docs/#api-Host_Attributes-GetV2HostAttributesComponents

Parameters:

  • query (String)
  • start_at (String, nil) (defaults to: nil)
  • end_at (String, nil) (defaults to: nil)

Returns:

  • (Hash)


16
17
18
19
20
21
22
23
24
# File 'lib/passivetotal/clients/host.rb', line 16

def components(query, start_at: nil, end_at: nil)
  params = {
    query: query,
    start: start_at,
    end: end_at,
  }.compact

  _get("/host-attributes/components", params) { |json| json }
end

#pairs(query, direction: "children", start_at: nil, end_at: nil) ⇒ Hash

Retrieves the host attribute pairs related to the query. api.passivetotal.org/api/docs/#api-Host_Attributes-GetV2HostAttributesComponents

Parameters:

  • query (String)
  • direction (String) (defaults to: "children")
  • start_at (String) (defaults to: nil)
  • end_at (String) (defaults to: nil)

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
# File 'lib/passivetotal/clients/host.rb', line 37

def pairs(query, direction: "children", start_at: nil, end_at: nil)
  params = {
    query: query,
    direction: direction,
    start: start_at,
    end: end_at,
  }.compact

  _get("/host-attributes/pairs", params) { |json| json }
end

#trackers(query, start_at: nil, end_at: nil) ⇒ Hash

Parameters:

  • query (String)
  • start_at (String, nil) (defaults to: nil)
  • end_at (String, nil) (defaults to: nil)

Returns:

  • (Hash)


58
59
60
61
62
63
64
65
66
# File 'lib/passivetotal/clients/host.rb', line 58

def trackers(query, start_at: nil, end_at: nil)
  params = {
    query: query,
    start: start_at,
    end: end_at,
  }.compact

  _get("/host-attributes/trackers", params) { |json| json }
end