Hi,
Maybe I haven’t searched enough but I can’t find how one would add a host template to a host using the v2 API.
CLAPI (and thus, the v1 REST API) has a ADDTEMPLATE action for objects of type HOST that can do that easily. But all I can see in the v2 API is the /centreon/api/{version}/configuration/hosts/{host_id} endpoint. Is it possible to add a template (ie: keeping the already present ones) from there? All I can think of would be to make a first request to list the already present templates to be able to use this endpoint to add an additional template. Or, in case it would add the template(s) to the already configured ones, then how one would do to set another set of templates (ie: SETTEMPLATE)?
In addition, it looks it is required to use the template ID, which is, imo, less practical than using the name of the template as CLAPI permits.
Be the first to reply!
Reply
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.