Hello,
I try to add a host parameter with the api, but the value is always empty.
The curl command is:
curl -X POST -H “Content-Type: application/json” -u api_user:password -d ‘{“parameter”:{“parameter_type”:“json”,“name”: “Foobar”, “value”:{“test”:{“foo”:“bar”,“id”:12345}}}}’ https:///api/hosts/797/parameters
The result is:
{“priority”:70,“created_at”:“2019-09-17 09:42:44 UTC”,“updated_at”:“2019-09-17 09:42:44 UTC”,“id”:260,“name”:“Foobar”,“parameter_type”:“json”,“value”:null}
The host parameter is created successful, but the value is empty.
If I add the JSON string ({“test”:{“foo”:“bar”,“id”:12345}}) via the WebUI with type ‘json’, the value is filled correct and I can access the values with puppet.
Can somebody help me or give me a hint?
We use Foreman 1.22 with Katello 3.12 on CentOS 7.
Many thanks, Stefan.