Forum Discussion
Will_97818
Jul 07, 2015Nimbostratus
Modify Region table via REST
We are trying to modify(add/delete entries) of a region table. This can be done via tmsh as
modify gtm region test_region region-members add { subnet 1.1.1.1/32}
modify gtm region test_regi...
- Jul 23, 2015
Yep, you have to supply the entire region member list each time, so if you want to delete one, you have to basically send the entire list again without the member you wish to remove.
Another option is to use a CLI script to do this:
cli script addRegionMemberSubnet { proc script::init {} { } proc script::run {} { if { $tmsh::argc != 3 } { puts "a region name and a subnet must be provided" exit 123 } set zero [lindex $tmsh::argv 0] set RegionName [lindex $tmsh::argv 1] set Subnet [lindex $tmsh::argv 2] puts "tmsh::modify gtm region $RegionName region-members add { subnet $Subnet }" tmsh::modify gtm region $RegionName region-members add { subnet $Subnet } exit 0 } proc script::help {} { } proc script::tabc {} { } total-signing-status not-all-signed }
You can then run this from REST using the payload format of
{"command":"run","utilCmdArgs":"addRegionMemberSubnet Test_Region 1.1.1.1/32"}
on the URL of
https://192.168.1.1/mgmt/tm/cli/script
I hope that helps.
Greg_Robinson_1
Jul 23, 2015Cirrus
Can you include the syntax of the full REST call you're making? That'd be helpful.
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