opn_api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +10 -0
- data/LICENSE +25 -0
- data/README.md +979 -0
- data/bin/opn-api +7 -0
- data/lib/opn_api/cli/commands/api.rb +57 -0
- data/lib/opn_api/cli/commands/backup.rb +38 -0
- data/lib/opn_api/cli/commands/base.rb +50 -0
- data/lib/opn_api/cli/commands/device.rb +53 -0
- data/lib/opn_api/cli/commands/plugin.rb +67 -0
- data/lib/opn_api/cli/commands/reconfigure.rb +40 -0
- data/lib/opn_api/cli/commands/resource.rb +248 -0
- data/lib/opn_api/cli/formatter.rb +198 -0
- data/lib/opn_api/cli/main.rb +160 -0
- data/lib/opn_api/client.rb +204 -0
- data/lib/opn_api/config.rb +111 -0
- data/lib/opn_api/errors.rb +45 -0
- data/lib/opn_api/id_resolver.rb +222 -0
- data/lib/opn_api/logger.rb +29 -0
- data/lib/opn_api/normalize.rb +47 -0
- data/lib/opn_api/resource.rb +142 -0
- data/lib/opn_api/resource_registry.rb +377 -0
- data/lib/opn_api/service_reconfigure.rb +293 -0
- data/lib/opn_api/version.rb +5 -0
- data/lib/opn_api.rb +32 -0
- metadata +73 -0
data/lib/opn_api.rb
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'opn_api/version'
|
|
4
|
+
require_relative 'opn_api/errors'
|
|
5
|
+
require_relative 'opn_api/logger'
|
|
6
|
+
require_relative 'opn_api/client'
|
|
7
|
+
require_relative 'opn_api/config'
|
|
8
|
+
require_relative 'opn_api/normalize'
|
|
9
|
+
require_relative 'opn_api/id_resolver'
|
|
10
|
+
require_relative 'opn_api/service_reconfigure'
|
|
11
|
+
require_relative 'opn_api/resource'
|
|
12
|
+
require_relative 'opn_api/resource_registry'
|
|
13
|
+
|
|
14
|
+
# Ruby client library for the OPNsense REST API.
|
|
15
|
+
#
|
|
16
|
+
# Provides HTTP client, UUID resolution, service reconfigure orchestration,
|
|
17
|
+
# and OPNsense selection-hash normalization. Usable as a library or via
|
|
18
|
+
# the opn-api CLI.
|
|
19
|
+
module OpnApi
|
|
20
|
+
class << self
|
|
21
|
+
# Returns the module-level logger instance.
|
|
22
|
+
# @return [OpnApi::Logger]
|
|
23
|
+
def logger
|
|
24
|
+
@logger ||= OpnApi::Logger.new
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Sets a custom logger (e.g. for Puppet integration).
|
|
28
|
+
# Any object responding to #debug, #info, #notice, #warning, #error.
|
|
29
|
+
# @param logger [#debug, #info, #notice, #warning, #error]
|
|
30
|
+
attr_writer :logger
|
|
31
|
+
end
|
|
32
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: opn_api
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- markt-de
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-03-16 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: |
|
|
14
|
+
A standalone Ruby library and command-line tool for communicating with
|
|
15
|
+
OPNsense firewalls via their REST API. Features include UUID resolution
|
|
16
|
+
for ModelRelationField references, service reconfigure orchestration,
|
|
17
|
+
and OPNsense selection-hash normalization.
|
|
18
|
+
email:
|
|
19
|
+
- github-oss-noreply@markt.de
|
|
20
|
+
executables:
|
|
21
|
+
- opn-api
|
|
22
|
+
extensions: []
|
|
23
|
+
extra_rdoc_files: []
|
|
24
|
+
files:
|
|
25
|
+
- CHANGELOG.md
|
|
26
|
+
- LICENSE
|
|
27
|
+
- README.md
|
|
28
|
+
- bin/opn-api
|
|
29
|
+
- lib/opn_api.rb
|
|
30
|
+
- lib/opn_api/cli/commands/api.rb
|
|
31
|
+
- lib/opn_api/cli/commands/backup.rb
|
|
32
|
+
- lib/opn_api/cli/commands/base.rb
|
|
33
|
+
- lib/opn_api/cli/commands/device.rb
|
|
34
|
+
- lib/opn_api/cli/commands/plugin.rb
|
|
35
|
+
- lib/opn_api/cli/commands/reconfigure.rb
|
|
36
|
+
- lib/opn_api/cli/commands/resource.rb
|
|
37
|
+
- lib/opn_api/cli/formatter.rb
|
|
38
|
+
- lib/opn_api/cli/main.rb
|
|
39
|
+
- lib/opn_api/client.rb
|
|
40
|
+
- lib/opn_api/config.rb
|
|
41
|
+
- lib/opn_api/errors.rb
|
|
42
|
+
- lib/opn_api/id_resolver.rb
|
|
43
|
+
- lib/opn_api/logger.rb
|
|
44
|
+
- lib/opn_api/normalize.rb
|
|
45
|
+
- lib/opn_api/resource.rb
|
|
46
|
+
- lib/opn_api/resource_registry.rb
|
|
47
|
+
- lib/opn_api/service_reconfigure.rb
|
|
48
|
+
- lib/opn_api/version.rb
|
|
49
|
+
homepage: https://github.com/markt-de/opn-api
|
|
50
|
+
licenses:
|
|
51
|
+
- BSD-2-Clause
|
|
52
|
+
metadata:
|
|
53
|
+
rubygems_mfa_required: 'true'
|
|
54
|
+
post_install_message:
|
|
55
|
+
rdoc_options: []
|
|
56
|
+
require_paths:
|
|
57
|
+
- lib
|
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '3.1'
|
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '0'
|
|
68
|
+
requirements: []
|
|
69
|
+
rubygems_version: 3.4.20
|
|
70
|
+
signing_key:
|
|
71
|
+
specification_version: 4
|
|
72
|
+
summary: Ruby client library and CLI for the OPNsense REST API
|
|
73
|
+
test_files: []
|