What do you use for automation of icinga2 director? REST API vs. CLI

director
(Dmitry) #1

Hello everyone!

Just wanted to rise a discussion about the tools available.

  1. What do you prefer to use for automation?

  2. Are there any features that available using CLI and not available in API or vice versa? Another way around: are both of the ways have equal functionality?

  3. Which procs and cons have one method over another?

Best,
-Dmitry

(Dmitry) #2

I can start.

  1. I use both of them.
  2. I cannot be sure about this, since I’m attempting to automate icinga director just about one month. What I’ve noticed is that it is much easier to create serviceset over CLI and not over API (is that even possible to do?) recently added question about kickstart over API got an answer - over CLI. I can assume that functionality is different, but can anyone to state clear: API is for this and CLI is for that?

procs of CLI:

  • it has help messages which sometimes easier to interpret than fighting with API URLs

cons of CLI:

  • command will be executed locally, so the user must have access to the machine and enough rights to run the command. (is that cons? )
  • sometimes return messages must be parsed.

procs: API:

  • most of the times status code can be clearly interpreted.

cons API:

  • poor documentation
  • I believe it has security consideration if the server with icinga does not run https (but this is in any way)