Page 1 of 1

Adding Host via API with Template

Posted: Mon Sep 21, 2020 8:42 am
by UWBernie
I'm looking if there is a better way to solve adding a host via api with a template for use in an automation script when deploying new hosts.

Currently the POST config/host is limited to a number of required parameters that are already handled by our template. If I use the POST config/import I can add a host with a template using the following request body
define host {
host_name ******
address *****
use windows-server
contact_groups *****
notification_period win_wed_0300
register 1
}

then I need to apply the config using POST applyconfig as POST config/import does not respect the applyconfig=1 parameter.

Is there a better way?

Re: Adding Host via API with Template

Posted: Mon Sep 21, 2020 2:19 pm
by lmiltchev
Have you tried using "force=1"?
example-01.jpg