Class: PassiveTotal::Client::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/passivetotal/clients/account.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

#classifications(classification) ⇒ Hash

Retrieve items with the specified classification. api.passivetotal.org/api/docs/#api-Account-GetV2AccountClassifications

Parameters:

  • classification (String)

    classification for which to retrieve items for

Returns:

  • (Hash)


112
113
114
115
116
117
118
# File 'lib/passivetotal/clients/account.rb', line 112

def classifications(classification)
  params = {
    classification: classification
  }.compact

  _get("/account/classifications", params) { |json| json }
end

#getHash

Read current account metadata and settings. api.passivetotal.org/api/docs/#api-Account-GetV2Account

Returns:

  • (Hash)


13
14
15
# File 'lib/passivetotal/clients/account.rb', line 13

def get
  _get("/account") { |json| json }
end

#history(source = nil) ⇒ Hash

Parameters:

  • source (String, nil) (defaults to: nil)

    history type (api/ui), defaults to both

Returns:

  • (Hash)


25
26
27
28
29
30
31
# File 'lib/passivetotal/clients/account.rb', line 25

def history(source = nil)
  params = {
    source: source
  }.compact

  _get("/account/history", params) { |json| json }
end

#monitorsHash

Returns:

  • (Hash)


40
41
42
# File 'lib/passivetotal/clients/account.rb', line 40

def monitors
  _get("/account/monitors") { |json| json }
end

#organizationHash

Returns:

  • (Hash)


51
52
53
# File 'lib/passivetotal/clients/account.rb', line 51

def organization
  _get("/account/organization") { |json| json }
end

#quotasHash

Read current account and organization quotas. api.passivetotal.org/api/docs/#api-Account-GetV2AccountQuotas

Returns:

  • (Hash)


62
63
64
# File 'lib/passivetotal/clients/account.rb', line 62

def quotas
  _get("/account/quota") { |json| json }
end

#sources(source: nil) ⇒ Hash

Parameters:

  • source (String, nil) (defaults to: nil)

    the source to filter on

Returns:

  • (Hash)


74
75
76
77
78
79
80
# File 'lib/passivetotal/clients/account.rb', line 74

def sources(source: nil)
  params = {
    source: source
  }.compact

  _get("/account/sources", params) { |json| json }
end

#teamstream(source: nil, dt: nil, type: nil, focus: nil) ⇒ Hash

Parameters:

  • source (String, nil) (defaults to: nil)

    filter to this source

  • dt (String, nil) (defaults to: nil)

    filter to this datetime

  • type (String, nil) (defaults to: nil)

    filter by type field

  • focus (String, nil) (defaults to: nil)

    filter by focus (domain, ip, etc)

Returns:

  • (Hash)


93
94
95
96
97
98
99
100
101
102
# File 'lib/passivetotal/clients/account.rb', line 93

def teamstream(source: nil, dt: nil, type: nil, focus: nil)
  params = {
    source: source,
    dt: dt,
    type: type,
    focus: focus,
  }.compact

  _get("/account/organization/teamstream", params) { |json| json }
end