Forum Discussion
REST API add records to data group (v14.1.)
- Jun 05, 2019
I would try this
https://dzavy.net/software/f5/how-to-add-or-remove-datagroup-records-using-icontrol-rest-api
KR,
Dario.
Thanks, Dario
That was very useful
I managed to get the records to add using the PATCH method described in the article
To add a string record I had to use the following querystring, where test is the name of the record and stuff being the value
/mgmt/tm/ltm/data-group/internal/~Common~testdg?options=records add { test { data stuff } }
That returned the expected result
{
"kind": "tm:ltm:data-group:internal:internalstate",
"name": "testdg",
"partition": "Common",
"fullPath": "/Common/testdg",
"generation": 184,
"selfLink": "https://localhost/mgmt/tm/ltm/data-group/internal/~Common~testdg?options=records+add+%7B+test+%7B+data+stuff+%7D+%7D&ver=14.1.0.3",
"type": "string",
"records": [
{
"name": "test",
"data": "stuff"
}
]
}
Would still be interested to hear if using the PUT method is a known issue??
Cheers,
Simon
The behavior of PUT/PATCH was changed lastly (new releases).
The relation between tmsh and icontrol is similar to this:
GET - list/show
POST - create
PUT - update
PATCH - modify
DELETE - delete
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