Module: RemoteWorkspaceDataService
Constant Summary
collapse
- WORKSPACE_API_PATH =
'/api/v1/workspaces'
- WORKSPACE_MDM_CLASS =
'Mdm::Workspace'
Instance Method Summary
collapse
#json_to_hash, #json_to_mdm_object, #process_file, #to_ar
Instance Method Details
#add_workspace(opts) ⇒ Object
9
10
11
12
|
# File 'lib/metasploit/framework/data_service/remote/http/remote_workspace_data_service.rb', line 9
def add_workspace(opts)
response = self.post_data(WORKSPACE_API_PATH, opts)
json_to_mdm_object(response, WORKSPACE_MDM_CLASS).first
end
|
#default_workspace ⇒ Object
#delete_workspaces(opts) ⇒ Object
37
38
39
|
# File 'lib/metasploit/framework/data_service/remote/http/remote_workspace_data_service.rb', line 37
def delete_workspaces(opts)
json_to_mdm_object(self.delete_data(WORKSPACE_API_PATH, opts), WORKSPACE_MDM_CLASS)
end
|
#update_workspace(opts) ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/metasploit/framework/data_service/remote/http/remote_workspace_data_service.rb', line 41
def update_workspace(opts)
path = WORKSPACE_API_PATH
if opts && opts[:id]
id = opts.delete(:id)
path = "#{WORKSPACE_API_PATH}/#{id}"
end
json_to_mdm_object(self.put_data(path, opts), WORKSPACE_MDM_CLASS).first
end
|
#workspace ⇒ Object
18
19
20
21
22
23
|
# File 'lib/metasploit/framework/data_service/remote/http/remote_workspace_data_service.rb', line 18
def workspace
wlog "[DEPRECATION] Calling workspace from within the RemoteDataService is no longer supported. Please call from WorkspaceDataProxy instead."
caller.each { |line| wlog "#{line}"}
end
|
#workspace=(workspace) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/metasploit/framework/data_service/remote/http/remote_workspace_data_service.rb', line 25
def workspace=(workspace)
wlog "[DEPRECATION] Setting the current workspace from the RemoteDataService is no longer supported. Please call from WorkspaceDataProxy instead."
caller.each { |line| wlog "#{line}"}
end
|
#workspaces(opts) ⇒ Object
32
33
34
35
|
# File 'lib/metasploit/framework/data_service/remote/http/remote_workspace_data_service.rb', line 32
def workspaces(opts)
path = get_path_select(opts, WORKSPACE_API_PATH)
json_to_mdm_object(self.get_data(path, nil, opts), WORKSPACE_MDM_CLASS)
end
|