-
New Feature
-
Resolution: Done
-
Blocker
I would like to configure influxdb server endpoint from groovy scripts on top of beeing able to do it from the UI
Details:
I would like to put a groovy script in init.groovy.d and load it at jenkins startup in order to configure influxdb target.
example:
import jenkinsci.plugins.influxdb.models.Target
def influxdb = Jenkins.instance.getDescriptorByType(jenkinsci.plugins.influxdb.DescriptorImpl)
def target = new Target()
target.description = 'mydb'
target.url = 'http://10.10.10.10:8086'
target.username = 'admin'
target.password = 'admin'
target.database = 'db0'influxdb.targets = [ target ]
influxdb.save()
There are no method setTargets at this time https://github.com/jenkinsci/influxdb-plugin/blob/master/src/main/java/jenkinsci/plugins/influxdb/DescriptorImpl.java
I submitted PR https://github.com/jenkinsci/influxdb-plugin/pull/31