Class: OPNsenseAPI::Core::CaptivePortal::Voucher
- Inherits:
-
Object
- Object
- OPNsenseAPI::Core::CaptivePortal::Voucher
- Includes:
- OPNsenseAPI::Core
- Defined in:
- lib/opnsense_api/core/captive_portal/voucher.rb
Constant Summary collapse
- BASE_PATH =
'/captiveportal/voucher'
Instance Method Summary collapse
- #drop_expired_vouchers(provider:, group:, body: {}) ⇒ Object
- #drop_voucher_group(provider:, group:, body: {}) ⇒ Object
- #expire_voucher(provider:, body: {}) ⇒ Object
- #generate_vouchers(provider:, body: {}) ⇒ Object
- #list_providers ⇒ Object
- #list_voucher_groups(provider:) ⇒ Object
- #list_vouchers(provider:, group:) ⇒ Object
Methods included from OPNsenseAPI::Core
Instance Method Details
#drop_expired_vouchers(provider:, group:, body: {}) ⇒ Object
26 27 28 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 26 def drop_expired_vouchers(provider:, group:, body: {}) @client.post("#{BASE_PATH}/dropExpiredVouchers/#{provider}/#{group}", body) end |
#drop_voucher_group(provider:, group:, body: {}) ⇒ Object
30 31 32 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 30 def drop_voucher_group(provider:, group:, body: {}) @client.post("#{BASE_PATH}/dropVoucherGroup/#{provider}/#{group}", body) end |
#expire_voucher(provider:, body: {}) ⇒ Object
34 35 36 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 34 def expire_voucher(provider:, body: {}) @client.post("#{BASE_PATH}/expireVoucher/#{provider}", body) end |
#generate_vouchers(provider:, body: {}) ⇒ Object
38 39 40 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 38 def generate_vouchers(provider:, body: {}) @client.post("#{BASE_PATH}/generateVouchers/#{provider}", body) end |
#list_providers ⇒ Object
42 43 44 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 42 def list_providers @client.get("#{BASE_PATH}/listProviders") end |
#list_voucher_groups(provider:) ⇒ Object
46 47 48 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 46 def list_voucher_groups(provider:) @client.get("#{BASE_PATH}/listVoucherGroups/#{provider}") end |
#list_vouchers(provider:, group:) ⇒ Object
50 51 52 |
# File 'lib/opnsense_api/core/captive_portal/voucher.rb', line 50 def list_vouchers(provider:, group:) @client.get("#{BASE_PATH}/listVouchers/#{provider}/#{group}") end |