When I try to modify the host object with the director API, all the vars properties are crushed. I want just add new vars property to existing host object. Is this a or bug?
I think it’s expected as your API call sets the variable vars to value { “event”: [ “Icinga”, “Camp” ] } and this overwrites the old content of vars.
Maybe you could try to address vars.event directly with -d '{"vars.event": [ "Icinga", "Camp" ] }'?
It should work this way according to the documentation.
The response always returns the full object on modification. This way you can immediately investigate the merged result. As you can see, POST requests only touch the parameters you passed - the rest remains untouched.