These examples for the Icinga 2 API should help you get started with your own projects.
Please read the API documentation thoroughly before looking into the scripting details.
These examples remain generally unsupported, you should not put them in production without your own review and knowledge.
Discuss your questions on the community channels.