Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50962

set influxdb server from groovy

XMLWordPrintable

      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

       

            aleksisimell Aleksi Simell
            zougi Frederic Rousseau
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: