Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Update an internal Data Group via API?

misch42
Nimbostratus
Nimbostratus

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

 

1 ACCEPTED SOLUTION

gersbah
Cirrostratus
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...

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.

View solution in original post

2 REPLIES 2

gersbah
Cirrostratus
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...

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.

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