Skip to main content

Hi,

I'm new to Centreon (24.04), and I'm probably missing something.

I want to add my host via the API (using Ansible). I managed to do it using this endpoint: /centreon/api/latest/configuration/hosts.

The host creation is successful, and it's linked to the correct template, but no services are created.

How can I achieve this, similar to the option in the host creation GUI that says "Create Services linked to the Template too"?

I've looked everywhere in the API documentation but couldn't find any clues: https://docs-api.centreon.com/api/centreon-web/#tag/Host.

Can someone please help?

Hello,
I had the same problem.
I believe this function is not available in api V2.
I used the api v1 pour this.

Cordialement


@Lionel do you mean this action?

 


ok please try after

/configuration/hosts/{host_id}/services/deploy

Add services to a host based on associated host template

 

Thanks everyone.


Yes it’s what I need. Thanks for the anwser.
Unfortunatly my platform is a 23.10 version. I will have to wait a lot ...
I hope Lionel will be happy with this news.


@cabrilucide you can always upgrade hehehe 😁😎😜

https://docs.centreon.com/docs/upgrade/upgrade-from-23-10/


Reply