Open mdetrano opened 7 years ago
Support for datafields and datalists via the REST API would be very useful. My "dirty" workaround for the missing support was to write the datafields & datalists direct in the director database.
Lending my support for this one. I could have used this during my implementation.
+1 there are commands that needs a f*kton of datafield.
I second the colourful description provided by Koma85
+1 Utilizing TEST and PROD environment it would be nice to have all parts of director objects be REST-able so deployment/sync might be automated Looked into @mcktr 's solution as well before but agree with her/him that this is rather dirty. API access would allow automated changes to be logged in the activity log as well for a cleaner deployment documentation
Related: #1523, #1630
+1
So more than a year past. Are there still any considerations to implement REST API support for Datafields or not?
3 months since @EugenFo's comment and I'm wondering the same
Still no datafields & datalists via REST API?
ref/NC/768900
Currently, the REST API for Director does not support datafield and datalist objects. While these are not "Icinga" objects, technically, it is still very useful to have these fields for viewing/editing vars attached to Icinga objects in Director. Since those objects may be sent from external systems using the API, it would be nice to have the possibility of also setting up datafields with the same API (especially if you'd like to sync up commands and templates among separate Director systems).
I have implemented this and can send a Pull request from my fork if desired. My patch adds datafield(s) and datalist(s) endpoints to the API which function very similarly to other object endpoints, and also modifies the Icinga Object(s) controllers to add a ../fields endpoint under each object (or object collection) to see and modify links between objects and fields in Director (as applicable to the the object and its type).