Class: OPNsenseAPI::Core::IDS::Settings
- Inherits:
-
Object
- Object
- OPNsenseAPI::Core::IDS::Settings
- Includes:
- OPNsenseAPI::Core
- Defined in:
- lib/opnsense_api/core/ids/settings.rb
Overview
Constant Summary collapse
- BASE_PATH =
'/ids/settings'
Instance Method Summary collapse
- #add_policy(body = {}) ⇒ Object
- #add_policy_rule(body = {}) ⇒ Object
- #add_user_rule(body = {}) ⇒ Object
- #check_policy_rule(params = {}) ⇒ Object
- #del_policy(uuid:) ⇒ Object
- #del_policy_rule(uuid:) ⇒ Object
- #del_user_rule(uuid:) ⇒ Object
- #get(params = {}) ⇒ Object
- #get_policy(uuid: nil) ⇒ Object
- #get_policy_rule(uuid: nil) ⇒ Object
- #get_rule_info(sid: nil) ⇒ Object
- #get_ruleset(id:) ⇒ Object
- #get_ruleset_properties(params = {}) ⇒ Object
- #get_user_rule(uuid: nil) ⇒ Object
- #list_rule_metadata(params = {}) ⇒ Object
- #list_rulesets(params = {}) ⇒ Object
- #search_installed_rules(body = {}) ⇒ Object
- #search_policy(body = {}) ⇒ Object
- #search_policy_rule(body = {}) ⇒ Object
- #search_user_rule(body = {}) ⇒ Object
- #set(body = {}) ⇒ Object
- #set_policy(body = {}, uuid:) ⇒ Object
- #set_policy_rule(body = {}, uuid:) ⇒ Object
- #set_rule(body = {}, sid:) ⇒ Object
- #set_ruleset(body = {}, filename:) ⇒ Object
- #set_ruleset_properties(body = {}) ⇒ Object
- #set_user_rule(body = {}, uuid:) ⇒ Object
- #toggle_policy(uuid:, enabled: nil) ⇒ Object
- #toggle_policy_rule(uuid:, enabled: nil) ⇒ Object
- #toggle_rule(sid:, enabled: nil) ⇒ Object
- #toggle_ruleset(id:, enabled: nil) ⇒ Object
- #toggle_user_rule(uuid:, enabled: nil) ⇒ Object
Methods included from OPNsenseAPI::Core
Instance Method Details
#add_policy(body = {}) ⇒ Object
27 28 29 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 27 def add_policy(body = {}) @client.post("#{BASE_PATH}/addPolicy", body) end |
#add_policy_rule(body = {}) ⇒ Object
31 32 33 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 31 def add_policy_rule(body = {}) @client.post("#{BASE_PATH}/addPolicyRule", body) end |
#add_user_rule(body = {}) ⇒ Object
35 36 37 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 35 def add_user_rule(body = {}) @client.post("#{BASE_PATH}/addUserRule", body) end |
#check_policy_rule(params = {}) ⇒ Object
39 40 41 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 39 def check_policy_rule(params = {}) @client.get("#{BASE_PATH}/checkPolicyRule", params) end |
#del_policy(uuid:) ⇒ Object
43 44 45 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 43 def del_policy(uuid:) @client.post("#{BASE_PATH}/delPolicy/#{uuid}") end |
#del_policy_rule(uuid:) ⇒ Object
47 48 49 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 47 def del_policy_rule(uuid:) @client.post("#{BASE_PATH}/delPolicyRule/#{uuid}") end |
#del_user_rule(uuid:) ⇒ Object
51 52 53 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 51 def del_user_rule(uuid:) @client.post("#{BASE_PATH}/delUserRule/#{uuid}") end |
#get(params = {}) ⇒ Object
55 56 57 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 55 def get(params = {}) @client.get("#{BASE_PATH}/get", params) end |
#get_policy(uuid: nil) ⇒ Object
59 60 61 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 59 def get_policy(uuid: nil) @client.get("#{BASE_PATH}/getPolicy/#{uuid}") end |
#get_policy_rule(uuid: nil) ⇒ Object
63 64 65 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 63 def get_policy_rule(uuid: nil) @client.get("#{BASE_PATH}/getPolicyRule/#{uuid}") end |
#get_rule_info(sid: nil) ⇒ Object
67 68 69 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 67 def get_rule_info(sid: nil) @client.get("#{BASE_PATH}/getRuleInfo/#{sid}") end |
#get_ruleset(id:) ⇒ Object
71 72 73 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 71 def get_ruleset(id:) @client.get("#{BASE_PATH}/getRuleset/#{id}") end |
#get_ruleset_properties(params = {}) ⇒ Object
75 76 77 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 75 def get_ruleset_properties(params = {}) @client.get("#{BASE_PATH}/getRulesetProperties", params) end |
#get_user_rule(uuid: nil) ⇒ Object
79 80 81 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 79 def get_user_rule(uuid: nil) @client.get("#{BASE_PATH}/getUserRule/#{uuid}") end |
#list_rule_metadata(params = {}) ⇒ Object
83 84 85 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 83 def (params = {}) @client.get("#{BASE_PATH}/listRuleMetadata", params) end |
#list_rulesets(params = {}) ⇒ Object
87 88 89 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 87 def list_rulesets(params = {}) @client.get("#{BASE_PATH}/listRulesets", params) end |
#search_installed_rules(body = {}) ⇒ Object
91 92 93 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 91 def search_installed_rules(body = {}) @client.post("#{BASE_PATH}/searchInstalledRules", body) end |
#search_policy(body = {}) ⇒ Object
95 96 97 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 95 def search_policy(body = {}) @client.post("#{BASE_PATH}/searchPolicy", body) end |
#search_policy_rule(body = {}) ⇒ Object
99 100 101 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 99 def search_policy_rule(body = {}) @client.post("#{BASE_PATH}/searchPolicyRule", body) end |
#search_user_rule(body = {}) ⇒ Object
103 104 105 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 103 def search_user_rule(body = {}) @client.post("#{BASE_PATH}/searchUserRule", body) end |
#set(body = {}) ⇒ Object
107 108 109 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 107 def set(body = {}) @client.post("#{BASE_PATH}/set", body) end |
#set_policy(body = {}, uuid:) ⇒ Object
111 112 113 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 111 def set_policy(body = {}, uuid:) @client.post("#{BASE_PATH}/setPolicy/#{uuid}", body) end |
#set_policy_rule(body = {}, uuid:) ⇒ Object
115 116 117 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 115 def set_policy_rule(body = {}, uuid:) @client.post("#{BASE_PATH}/setPolicyRule/#{uuid}", body) end |
#set_rule(body = {}, sid:) ⇒ Object
119 120 121 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 119 def set_rule(body = {}, sid:) @client.post("#{BASE_PATH}/setRule/#{sid}", body) end |
#set_ruleset(body = {}, filename:) ⇒ Object
123 124 125 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 123 def set_ruleset(body = {}, filename:) @client.post("#{BASE_PATH}/setRuleset/#{filename}", body) end |
#set_ruleset_properties(body = {}) ⇒ Object
127 128 129 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 127 def set_ruleset_properties(body = {}) @client.post("#{BASE_PATH}/setRulesetProperties", body) end |
#set_user_rule(body = {}, uuid:) ⇒ Object
131 132 133 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 131 def set_user_rule(body = {}, uuid:) @client.post("#{BASE_PATH}/setUserRule/#{uuid}", body) end |
#toggle_policy(uuid:, enabled: nil) ⇒ Object
135 136 137 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 135 def toggle_policy(uuid:, enabled: nil) @client.post("#{BASE_PATH}/togglePolicy/#{uuid}/#{enabled}") end |
#toggle_policy_rule(uuid:, enabled: nil) ⇒ Object
139 140 141 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 139 def toggle_policy_rule(uuid:, enabled: nil) @client.post("#{BASE_PATH}/togglePolicyRule/#{uuid}/#{enabled}") end |
#toggle_rule(sid:, enabled: nil) ⇒ Object
143 144 145 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 143 def toggle_rule(sid:, enabled: nil) @client.post("#{BASE_PATH}/toggleRule/#{sid}/#{enabled}") end |
#toggle_ruleset(id:, enabled: nil) ⇒ Object
147 148 149 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 147 def toggle_ruleset(id:, enabled: nil) @client.post("#{BASE_PATH}/toggleRuleset/#{id}/#{enabled}") end |
#toggle_user_rule(uuid:, enabled: nil) ⇒ Object
151 152 153 |
# File 'lib/opnsense_api/core/ids/settings.rb', line 151 def toggle_user_rule(uuid:, enabled: nil) @client.post("#{BASE_PATH}/toggleUserRule/#{uuid}/#{enabled}") end |