Forum Discussion
Update an internal Data Group via API?
Hi,
I want to update a Data Group via an IP call. I can list the contents of the group with:
curl -sk -u "user:pass" -H "Content-Type: application/json" -X GET https://192.2.0.1/mgmt/tm/ltm/data-group/internal/myDataGroup | jq
The command
curl -sk -u "user:pass" -H "Content-Type: application/json" -X PATCH -d '{"records": [ {"name": "1.2.3.4" }]}' https://192.2.0.1/mgmt/tm/ltm/data-group/internal/myDataGroup |jq
will replace (!) the contents of the data group.
How can I add an entry to the data group?
The same command but with POST instead of PATCH, results in a
{
"code": 400,
"message": "one or more configuration identifiers must be provided",
"errorStack": [],
"apiError": 26214401
}
Any ideas how to deal?
Michael
Here's an older discussion about this topic:
https://community.f5.com/t5/technical-forum/add-new-key-into-data-group-without-updating-entire-list-using/td-p/272699
By default PATCH is not properly supported for data groups, but apparently there's a workaround available, adding an options parameter to the API url.
2 Replies
- gersbah
Cirrostratus
Here's an older discussion about this topic:
https://community.f5.com/t5/technical-forum/add-new-key-into-data-group-without-updating-entire-list-using/td-p/272699
By default PATCH is not properly supported for data groups, but apparently there's a workaround available, adding an options parameter to the API url.- misch42
Nimbostratus
Thanks,
that is what I also found already. Thanks for your comfirmation that the data group API resource is, well, not working as documented.
Michael
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
