Forum Discussion
Modify a Data-group with iControl Rest
I'm trying to add a record to an existing data group. I can create the datagroup with records, but I can't figure out the syntax to add a new record to the datagroup w/o overwriting the entire DG.
Here is the command that I've been using to create the DG, how do I modify it to modify/add instead of overwrite?
curl -k -u admin:f5rules -H "Content-Type: application/json" -X PUT -d '{"records":[{"name":"123","data":"435" }]}' https://1.0.1.6/mgmt/tm/ltm/data-group/internal/~Common~TEST_iRule | /var/tmp/jq .
Thanks!
3 Replies
- JRahm
Admin
Hi Townsie. I was searching for something similar and tested this out and it looks like the only option right now is to replace the entire record. Easiest way would be to do a GET to grab the existing record list, append your new record(s), then do a PUT as shown above.
- david78
Nimbostratus
Hi, really there no way to add or edit a single entry in a Datagroup? - JRahm
Admin
unfortunately, no. The reason is that the records in a data-group are not a subcollection like pool members. For more details, please read this article: https://devcentral.f5.com/s/articles/demystifying-icontrol-rest-part-2-understanding-sub-collections-and-how-to-use-them
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
