I’m adding services to hosts over API. This works fine, but I need to use vars for one of the services and I’d like to add some vars to the dict instead of overriding all vars - something that can be achieved in config by “+=”.
Is there a way to use this operator over API? I just have json like
@Al2Klimov - thanks for reading and your reply. Both approaches - the one I’ve used and your formatting vars.include_regexp and "vars": { "include_regexp": ...} work consistent. They both result in the whole vars dictionary being overwritten and I just want to add one specific veriable creating the service.
When I create a service using the JSON above the command execution fails, because it’s missing -H. If I remove vars from the JSON creating service it works fine, but… for some cases I’d like to have additional argument passed to command.
I was totaly wrong thinking that it’s kind of built-in, defined per host. I realized in services where it works I just have it defined per service. I just replaced it with ‘$host.address$’ and I can confirm it’s not overriden by API call from the first post.
Thanks for your time!
(Edit) The thread can be closed, but I’m not sure if I should mark anything a solution - it’s kind of “invalid ticket” from the beginning.