Skip to content

Add network management and commit methods#10

Merged
mrqwer88 merged 2 commits into
FastNetMon:mainfrom
fjaeckel:feature/network-management-and-commit
Jun 26, 2026
Merged

Add network management and commit methods#10
mrqwer88 merged 2 commits into
FastNetMon:mainfrom
fjaeckel:feature/network-management-and-commit

Conversation

@fjaeckel

Copy link
Copy Markdown

Summary

This PR adds first-class methods for managing the global networks_list and committing configuration changes via the FastNetMon web API.

New Methods

Method HTTP Endpoint Description
AddNetwork(cidr) PUT /main/networks_list/<cidr> Add a network to the global networks list
RemoveNetwork(cidr) DELETE /main/networks_list/<cidr> Remove a network from the global networks list
Commit() PUT /commit Commit pending configuration changes

Motivation

The existing client exposes GetNetworks() to read the networks list but provides no way to mutate it or commit changes. Callers currently have to construct raw HTTP requests using the client's internal Prefix and Ro fields directly, which breaks encapsulation.

These three methods complete the networks lifecycle and allow callers to manage networks entirely through the client's public API, consistent with how host groups, flow spec rules, and remote blackhole entries are already handled.

Frederic Jung added 2 commits June 26, 2026 11:29
This allows a user to set the `enable_ban_incoming`, `enable_ban_outgoing` as well as the `calculation_method` on hostgroups or alike.
Extend the client with first-class methods for managing the global
networks_list and committing configuration changes:

- AddNetwork(cidr): PUT /main/networks_list/<encoded_cidr>
- RemoveNetwork(cidr): DELETE /main/networks_list/<encoded_cidr>
- Commit(): PUT /commit

These complement the existing GetNetworks() method to provide full
CRUD lifecycle for the networks_list without requiring callers to
construct raw HTTP requests.
@mrqwer88 mrqwer88 merged commit f20577f into FastNetMon:main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants