Forum Discussion
Internal datagroup REST / curl problem
What is the correct format for a file to populate an internal data group with a curl command?
I tried:
curl -vk -u xxxxx:xxxxx -H 'Content-Type:application/json' -X POST -d text.json
And in text.json I have the content of: curl -vk -u xxxxx:xxxxx -H "Content-Type:application/json" -X GET -o text.json
Surely the format of the records from a GET are correct for the format of records for a POST??? (I tried a PUT too, no joy).
Jan
Hi Jan,
the raw GET output can't be used to create or update a given data-group.
To create a new data-group:
curl -k -u "admin:admin" -H "Content-Type: application/json" -X POST -d '{"name":"DG_SOMEVALUES","type":"string","records":[{"name":"123","data":"abc"}]}' https://172.22.17.1/mgmt/tm/ltm/data-group/internal/
To update the records of an existing data-group:
curl -k -u "admin:admin" -H "Content-Type: application/json" -X PATCH -d '{"records":[{"name":"1234","data":"xyz"}]}' https://172.22.17.1/mgmt/tm/ltm/data-group/internal/~Common~DG_SOMEVALUES
Cheers, Kai
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