Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature [set settings] - Firewall Rule updates #52

Open
galaara98 opened this issue Jun 1, 2021 · 6 comments
Open

Feature [set settings] - Firewall Rule updates #52

galaara98 opened this issue Jun 1, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@galaara98
Copy link

You mentioned in the readme that your not against maybe a few functions that set data.

So I have a WAN firewall rule designed to let a certain list of ip addresses in on a certain port.
I'd like to be able to update the source IP addresses programically (if the API can do that)
Technically in my case I use a Firewall ipv4 Group, so I'm looking for a way to actually update the group membership

@davidnewhall
Copy link
Member

Howdy! Do you know what API paths these things live at by chance? If you can point me in a direction I can create the methods to access the stuff.

@davidnewhall
Copy link
Member

I also need to verify you're asking for this Go library to be able to update firewall rules/data. You have the ability to write a Go app that uses this library to make the changes you're interested in?

@galaara98
Copy link
Author

$IdOfGroup = (((Invoke-WebRequest "$controller/api/s/default/rest/firewallgroup" -WebSession $session -Method Get).content | convertfrom-json).data | where-object { $_.name -like "*Player_Addresses"})._id

Invoke-WebRequest "$controller/api/s/default/rest/firewallgroup/$IdOfGroup" -WebSession $session -Method Put -body '{"group_members":["192.168.10.20","207.170.246.248"]}'

@galaara98
Copy link
Author

galaara98 commented Jun 1, 2021

I also need to verify you're asking for this Go library to be able to update firewall rules/data. You have the ability to write a Go app that uses this library to make the changes you're interested in?

Sorry example was powershell, it is my native tongue :)

I know, I'm pondering how to tackle this... I already use your poller for better data/data visualization.. but I could just go separate on this.. i was just coincidentally checking in on your project and saw the readme mention.

@davidnewhall
Copy link
Member

That's sorta why I asked. This repo is a Go library that makes it (slightly) easier for a Go application to interact with a UniFi Controller. Poller uses this library. If you don't program in Go, this library probably isn't very useful to you.

The examples you provided are "perfect" and I could certainly implement the Go methods to expose those API endpoints, but will you use it? I'm afraid if you're not a Go programmer it'll be difficult to get into. I don't want to discourage you though; if you're willing to learn I'm willing to help get you there. I could even provide some initial code to "create an application" and you may be able to get it going.

I don't have a ton of time, but I do enjoy helping folks learn things and this is something I'd put time into if you're up for it.

@davidnewhall
Copy link
Member

And just so it's extra clear: this new code will be part of this library, but will not be part of (used in) poller.

@platinummonkey platinummonkey added the enhancement New feature or request label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants