Class: OPNsenseAPI::Core::IPSec::Tunnel
- Inherits:
-
Object
- Object
- OPNsenseAPI::Core::IPSec::Tunnel
- Includes:
- OPNsenseAPI::Core
- Defined in:
- lib/opnsense_api/core/ipsec/tunnel.rb
Overview
Constant Summary collapse
- BASE_PATH =
'/ipsec/tunnel'
Instance Method Summary collapse
- #del_phase_1(body = {}, ikeid:) ⇒ Object
- #del_phase_2(body = {}, seqid:) ⇒ Object
- #search_phase_1(params = {}) ⇒ Object
- #search_phase_2(params = {}) ⇒ Object
- #toggle(body = {}, enabled: nil) ⇒ Object
- #toggle_phase_1(body = {}, ikeid:, enabled: nil) ⇒ Object
- #toggle_phase_2(body = {}, seqid:, enabled: nil) ⇒ Object
Methods included from OPNsenseAPI::Core
Instance Method Details
#del_phase_1(body = {}, ikeid:) ⇒ Object
27 28 29 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 27 def del_phase_1(body = {}, ikeid:) @client.post("#{BASE_PATH}/delPhase1/#{ikeid}", body) end |
#del_phase_2(body = {}, seqid:) ⇒ Object
31 32 33 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 31 def del_phase_2(body = {}, seqid:) @client.post("#{BASE_PATH}/delPhase2/#{seqid}", body) end |
#search_phase_1(params = {}) ⇒ Object
35 36 37 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 35 def search_phase_1(params = {}) @client.get("#{BASE_PATH}/searchPhase1", params) end |
#search_phase_2(params = {}) ⇒ Object
39 40 41 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 39 def search_phase_2(params = {}) @client.get("#{BASE_PATH}/searchPhase2", params) end |
#toggle(body = {}, enabled: nil) ⇒ Object
43 44 45 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 43 def toggle(body = {}, enabled: nil) @client.post("#{BASE_PATH}/toggle/#{enabled}", body) end |
#toggle_phase_1(body = {}, ikeid:, enabled: nil) ⇒ Object
47 48 49 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 47 def toggle_phase_1(body = {}, ikeid:, enabled: nil) @client.post("#{BASE_PATH}/togglePhase1/#{ikeid}/#{enabled}", body) end |
#toggle_phase_2(body = {}, seqid:, enabled: nil) ⇒ Object
51 52 53 |
# File 'lib/opnsense_api/core/ipsec/tunnel.rb', line 51 def toggle_phase_2(body = {}, seqid:, enabled: nil) @client.post("#{BASE_PATH}/togglePhase2/#{seqid}/#{enabled}", body) end |