Module: Msf::WebServices::HostServlet

Defined in:
lib/msf/core/web_services/servlet/host_servlet.rb

Class Method Summary collapse

Class Method Details

.api_pathObject



3
4
5
# File 'lib/msf/core/web_services/servlet/host_servlet.rb', line 3

def self.api_path
  '/api/v1/hosts'
end

.api_path_with_idObject



7
8
9
# File 'lib/msf/core/web_services/servlet/host_servlet.rb', line 7

def self.api_path_with_id
  "#{self.api_path}/?:id?"
end

.api_path_with_id_and_tagsObject



11
12
13
# File 'lib/msf/core/web_services/servlet/host_servlet.rb', line 11

def self.api_path_with_id_and_tags
  "#{self.api_path_with_id}/tags"
end

.api_search_pathObject



15
16
17
# File 'lib/msf/core/web_services/servlet/host_servlet.rb', line 15

def self.api_search_path
  "#{self.api_path}/search"
end

.registered(app) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msf/core/web_services/servlet/host_servlet.rb', line 19

def self.registered(app)
  app.get self.api_path, &get_host
  app.get self.api_path_with_id, &get_host
  app.post self.api_path, &report_host
  app.put self.api_path_with_id, &update_host
  app.delete self.api_path, &delete_host
  app.post self.api_search_path, &search
  app.get self.api_path_with_id_and_tags, &get_host_tags
  app.post self.api_path_with_id_and_tags, &add_host_tag
  app.delete self.api_path_with_id_and_tags, &delete_host_tag
end