Module: 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
  "#{HostServlet.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
  "#{HostServlet.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
  "#{HostServlet.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 HostServlet.api_path, &get_host
  app.get HostServlet.api_path_with_id, &get_host
  app.post HostServlet.api_path, &report_host
  app.put HostServlet.api_path_with_id, &update_host
  app.delete HostServlet.api_path, &delete_host
  app.post HostServlet.api_search_path, &search
  app.get HostServlet.api_path_with_id_and_tags, &get_host_tags
  app.post HostServlet.api_path_with_id_and_tags, &add_host_tag
  app.delete HostServlet.api_path_with_id_and_tags, &delete_host_tag
end