Class: OPNsenseAPI::Core::Firewall::Alias

Inherits:
Object
  • Object
show all
Includes:
OPNsenseAPI::Core
Defined in:
lib/opnsense_api/core/firewall/alias.rb

Overview

Constant Summary collapse

BASE_PATH =
'/firewall/alias'

Instance Method Summary collapse

Methods included from OPNsenseAPI::Core

#initialize

Instance Method Details

#add_item(body = {}) ⇒ Object



28
29
30
# File 'lib/opnsense_api/core/firewall/alias.rb', line 28

def add_item(body = {})
  @client.post("#{BASE_PATH}/addItem", body)
end

#del_item(uuid:) ⇒ Object



32
33
34
# File 'lib/opnsense_api/core/firewall/alias.rb', line 32

def del_item(uuid:)
  @client.post("#{BASE_PATH}/delItem/#{uuid}")
end

#export(params = {}) ⇒ Object



36
37
38
# File 'lib/opnsense_api/core/firewall/alias.rb', line 36

def export(params = {})
  @client.get("#{BASE_PATH}/export", params)
end

#get(params = {}) ⇒ Object



40
41
42
# File 'lib/opnsense_api/core/firewall/alias.rb', line 40

def get(params = {})
  @client.get("#{BASE_PATH}/get", params)
end

#get_alias_uuid(name:) ⇒ Object



44
45
46
# File 'lib/opnsense_api/core/firewall/alias.rb', line 44

def get_alias_uuid(name:)
  @client.get("#{BASE_PATH}/getAliasUUID/#{name}")
end

#get_geo_ip(params = {}) ⇒ Object



48
49
50
# File 'lib/opnsense_api/core/firewall/alias.rb', line 48

def get_geo_ip(params = {})
  @client.get("#{BASE_PATH}/getGeoIP", params)
end

#get_item(uuid:) ⇒ Object



52
53
54
# File 'lib/opnsense_api/core/firewall/alias.rb', line 52

def get_item(uuid:)
  @client.get("#{BASE_PATH}/getItem/#{uuid}")
end

#get_table_size(params = {}) ⇒ Object



56
57
58
# File 'lib/opnsense_api/core/firewall/alias.rb', line 56

def get_table_size(params = {})
  @client.get("#{BASE_PATH}/getTableSize", params)
end

#import(body = {}) ⇒ Object



60
61
62
# File 'lib/opnsense_api/core/firewall/alias.rb', line 60

def import(body = {})
  @client.post("#{BASE_PATH}/import", body)
end

#list_categories(params = {}) ⇒ Object



64
65
66
# File 'lib/opnsense_api/core/firewall/alias.rb', line 64

def list_categories(params = {})
  @client.get("#{BASE_PATH}/listCategories", params)
end

#list_countries(params = {}) ⇒ Object



68
69
70
# File 'lib/opnsense_api/core/firewall/alias.rb', line 68

def list_countries(params = {})
  @client.get("#{BASE_PATH}/listCountries", params)
end

#list_network_aliases(params = {}) ⇒ Object



72
73
74
# File 'lib/opnsense_api/core/firewall/alias.rb', line 72

def list_network_aliases(params = {})
  @client.get("#{BASE_PATH}/listNetworkAliases", params)
end

#reconfigure(body = {}) ⇒ Object



76
77
78
# File 'lib/opnsense_api/core/firewall/alias.rb', line 76

def reconfigure(body = {})
  @client.post("#{BASE_PATH}/reconfigure", body)
end

#search_item(body = {}) ⇒ Object



80
81
82
# File 'lib/opnsense_api/core/firewall/alias.rb', line 80

def search_item(body = {})
  @client.post("#{BASE_PATH}/searchItem", body)
end

#set(body = {}) ⇒ Object



84
85
86
# File 'lib/opnsense_api/core/firewall/alias.rb', line 84

def set(body = {})
  @client.post("#{BASE_PATH}/set", body)
end

#set_item(uuid:, body: {}) ⇒ Object



88
89
90
# File 'lib/opnsense_api/core/firewall/alias.rb', line 88

def set_item(uuid:, body: {})
  @client.post("#{BASE_PATH}/setItem/#{uuid}", body)
end

#toggle_item(uuid:, enabled: nil) ⇒ Object



92
93
94
# File 'lib/opnsense_api/core/firewall/alias.rb', line 92

def toggle_item(uuid:, enabled: nil)
  @client.post("#{BASE_PATH}/toggleItem/#{uuid}/#{enabled}")
end