Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/ns-monitoring.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_PACKAGE_ns-monitoring=y
6 changes: 4 additions & 2 deletions packages/ns-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=ns-api
PKG_VERSION:=3.5.1
PKG_RELEASE:=2
PKG_VERSION:=3.5.1-beta
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/ns-api-$(PKG_VERSION)

Expand Down Expand Up @@ -164,6 +164,8 @@ define Package/ns-api/install
$(INSTALL_DATA) ./files/ns.wizard.json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_BIN) ./files/ns.ha $(1)/usr/libexec/rpcd/
$(INSTALL_DATA) ./files/ns.ha.json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_BIN) ./files/ns.flows $(1)/usr/libexec/rpcd/
$(INSTALL_DATA) ./files/ns.flows.json $(1)/usr/share/rpcd/acl.d/
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_CONF) files/msmtp.keep $(1)/lib/upgrade/keep.d/msmtp
$(INSTALL_CONF) files/nat-helpers.keep $(1)/lib/upgrade/keep.d/nat-helpers
Expand Down
36 changes: 34 additions & 2 deletions packages/ns-api/files/ns.dpi
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,45 @@ if cmd == 'list':
'list-popular': {
'limit': 32,
'page': 32
}
},
'list-application-categories': {},
'list-application-catalog': {},
'list-protocol-categories': {},
'list-protocol-catalog': {}
}))
elif cmd == 'call':
action = sys.argv[2]
e_uci = EUci()
try:
if action == 'list-applications':
if action == 'list-application-categories':
try:
with open('/etc/netifyd/netify-application-categories.json', 'r') as f:
content = json.load(f)
print(json.dumps({'values': content}))
except Exception:
print(json.dumps({}))
elif action == 'list-application-catalog':
try:
with open('/etc/netifyd/netify-application-catalog.json', 'r') as f:
content = json.load(f)
print(json.dumps({'values': content}))
except Exception:
print(json.dumps({}))
elif action == 'list-protocol-categories':
try:
with open('/etc/netifyd/netify-protocol-categories.json', 'r') as f:
content = json.load(f)
print(json.dumps({'values': content}))
except Exception:
print(json.dumps({}))
elif action == 'list-protocol-catalog':
try:
with open('/etc/netifyd/netify-protocol-catalog.json', 'r') as f:
content = json.load(f)
print(json.dumps({'values': content}))
except Exception:
print(json.dumps({}))
elif action == 'list-applications':
data = json.JSONDecoder().decode(sys.stdin.read())
result = dpi.list_applications(data.get('search', None), data.get('limit', None), data.get('page', 1))
print(json.dumps({'values': result}))
Expand Down
Loading
Loading