Forum Discussion

Townsie_105233's avatar
Townsie_105233
Historic F5 Account
Apr 14, 2014

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

  • 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.

     

  • Hi, really there no way to add or edit a single entry in a Datagroup?
  • 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