Forum Discussion
Aasis_162538
Nimbostratus
Jun 29, 2017Add 200 IP to the datagroup list
I came across the scenario where I need to add 200 specific IPs to the datagroup list. Rather than adding it manually, is there a way i can do it via cli? Can you please post the complete command/scr...
kleinsmk
Nimbostratus
Mar 22, 2022In case this helps anyone in the future you can simpy just use a GET on one F5 device and then a PUT or PATCH on the device you want to move the datagroup to. I've used powershell and the existing LTM module to leverage sessions but you can do this in any language.
$add = Invoke-RestMethodOverride -Method GET -URI ($F5Session.BaseURL.Replace('/ltm/',"/ltm/data-group/internal/yourrule")) -WebSession $F5Session.WebSession
$add = $add | convertto-json -depth 5
Invoke-RestMethodOverride -Method PATCH -URI ($F5Session.BaseURL.Replace('/ltm/',"/ltm/data-group/internal/yourrule")) -Body $json -ContentType "application/json" -WebSession $F5Session.WebSession
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects