Class: OPNsenseAPI::Core::Diagnostics::PacketCapture
- Inherits:
-
Object
- Object
- OPNsenseAPI::Core::Diagnostics::PacketCapture
- Includes:
- OPNsenseAPI::Core
- Defined in:
- lib/opnsense_api/core/diagnostics/packet_capture.rb
Constant Summary collapse
- BASE_PATH =
'/diagnostics/packet_capture'
Instance Method Summary collapse
- #download(jobid:) ⇒ Object
- #get(params = {}) ⇒ Object
- #mac_info(macaddr:) ⇒ Object
- #remove(jobid:) ⇒ Object
- #search_jobs(params = {}) ⇒ Object
- #set(params: {}, body: {}) ⇒ Object
- #start(jobid:) ⇒ Object
- #stop(jobid:) ⇒ Object
- #view(jobid:, detail: 'normal') ⇒ Object
Methods included from OPNsenseAPI::Core
Instance Method Details
#download(jobid:) ⇒ Object
26 27 28 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 26 def download(jobid:) @client.get("#{BASE_PATH}/download/#{jobid}") end |
#get(params = {}) ⇒ Object
30 31 32 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 30 def get(params = {}) @client.get("#{BASE_PATH}/get", params) end |
#mac_info(macaddr:) ⇒ Object
34 35 36 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 34 def mac_info(macaddr:) @client.get("#{BASE_PATH}/mac_info/#{macaddr}") end |
#remove(jobid:) ⇒ Object
38 39 40 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 38 def remove(jobid:) @client.post("#{BASE_PATH}/remove/#{jobid}") end |
#search_jobs(params = {}) ⇒ Object
42 43 44 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 42 def search_jobs(params = {}) @client.get("#{BASE_PATH}/searchJobs", params) end |
#set(params: {}, body: {}) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 46 def set(params: {}, body: {}) if body.any? @client.post("#{BASE_PATH}/set", body) else @client.get("#{BASE_PATH}/set", params) end end |
#start(jobid:) ⇒ Object
54 55 56 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 54 def start(jobid:) @client.post("#{BASE_PATH}/start/#{jobid}") end |
#stop(jobid:) ⇒ Object
58 59 60 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 58 def stop(jobid:) @client.post("#{BASE_PATH}/stop/#{jobid}") end |
#view(jobid:, detail: 'normal') ⇒ Object
62 63 64 |
# File 'lib/opnsense_api/core/diagnostics/packet_capture.rb', line 62 def view(jobid:, detail: 'normal') @client.get("#{BASE_PATH}/view/#{jobid}/#{detail}") end |