Add events method
parent
a457973702
commit
7e10b38421
|
@ -1,5 +1,16 @@
|
|||
module EventDataProxy
|
||||
|
||||
def events(opts = {})
|
||||
begin
|
||||
self.data_service_operation do |data_service|
|
||||
add_opts_workspace(opts)
|
||||
data_service.events(opts)
|
||||
end
|
||||
rescue => e
|
||||
self.log_error(e, "Problem retrieving events")
|
||||
end
|
||||
end
|
||||
|
||||
def report_event(opts)
|
||||
begin
|
||||
self.data_service_operation do |data_service|
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
require 'metasploit/framework/data_service/remote/http/response_data_helper'
|
||||
|
||||
module RemoteEventDataService
|
||||
include ResponseDataHelper
|
||||
|
||||
EVENT_API_PATH = '/api/v1/events'
|
||||
EVENT_MDM_CLASS = 'Mdm::Event'
|
||||
|
||||
def events(opts)
|
||||
path = get_path_select(opts, EVENT_API_PATH)
|
||||
json_to_mdm_object(self.get_data(path, nil, opts), EVENT_MDM_CLASS, [])
|
||||
end
|
||||
|
||||
def report_event(opts)
|
||||
self.post_data_async(EVENT_API_PATH, opts)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
module EventDataService
|
||||
|
||||
def events(opts)
|
||||
raise 'EventDataService#events is not implemented'
|
||||
end
|
||||
|
||||
def report_event(opts)
|
||||
raise 'EventDataService#report_event is not implemented'
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue