Commits


Trim const type prefix Not needed and easier to read when exposed in UI.


Store notes and notes_url object attributes Used to document, explain stuff. Useful!


Support icinga 2.12 acknowledgement, state, statetype field On Debian 11 these fields are floats, not ints (or boolean) for some reason. This patch allows unmarshalling either floats or integers depending on what the icinga API sends us.


Store last Host check result and time Includes tests and simplified unmarshal test.


Use default MarshalJSON method There's no point doing so much manual work and testing just to keep fields under a "attrs" key when marshalling to JSON. When creating the object we can just: 1. Marshal the object to JSON 2. Put it all under a "attrs" key. Now it's easier to imagine the mapping of the structs to JSON, since they follow the same rules as everything else in Go.


Catch all HostStates and ServiceStates This is closer to the Icinga spec, anything greater than 2 or 3 is unknown.


Marshal using struct tags rather than a custom map I was excluding some struct fields so I thought I'd need to do some custom marshalling . But you don't need to do this as you can use struct tags to optionally exclude things from being put into JSON. Now there's no longer duplicate code between struct tags and keys in a map when marshalling. Handy!


Store acknowledgement status of hosts, services


Correctly marshal Hosts into JSON We were missing some attributes, like not adding any groups or display names. This also adds a test which checks whether we are marshalling hosts into JSON correctly.


Store host state type


deduplicate new test client code This adds a newTestClient option so that we aren't constantly creating new http transports clients and all that


Support Icinga2 hostgroups Tests of hostgroup operations are done in TestFilter


Remove unused attrs() method It was required to satisfty the object interface but the interface changed because it wasn't used anywhere.


Generate CRUD code using go generate Explanation for use is in the README


Merge Hosts and FilterHosts Getting all Hosts is the same as calling FilterHosts with an empty filter anyway.


Merge filter and all objects methods Getting all objects is the same as getting objects with a zero filter.


I learned how to do some generic programming New type "object" is an interface to represent an Icinga2 object. I added heaps of other stuff! On our way to 1000 lines of code!


more docs


dump