Class: Shodan::Clients::Alert

Inherits:
Base
  • Object
show all
Defined in:
lib/shodan/clients/alert.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST

Instance Attribute Summary

Attributes inherited from Base

#key

Instance Method Summary collapse

Methods inherited from Base

#initialize, #key?

Constructor Details

This class inherits a constructor from Shodan::Clients::Base

Instance Method Details

#create(name:, ip:) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/shodan/clients/alert.rb', line 6

def create(name:, ip:)
  params = {
    name: name,
    filters: {
      ip: ip
    }
  }
  post("/shodan/alert", params)
end

#delete_by_id(id) ⇒ Object



16
17
18
# File 'lib/shodan/clients/alert.rb', line 16

def delete_by_id(id)
  delete("/shodan/alert/#{id}")
end

#get_by_id(id) ⇒ Object



20
21
22
# File 'lib/shodan/clients/alert.rb', line 20

def get_by_id(id)
  get("/shodan/alert/#{id}/info")
end

#infoObject



24
25
26
# File 'lib/shodan/clients/alert.rb', line 24

def info
  get("/shodan/alert/info")
end

#triggersObject



28
29
30
# File 'lib/shodan/clients/alert.rb', line 28

def triggers
  get("/shodan/alert/triggers")
end