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

       

          [JENKINS-50962] set influxdb server from groovy

          Frederic Rousseau added a comment - I submitted PR https://github.com/jenkinsci/influxdb-plugin/pull/31  

          I created PR on branch dev as asked: https://github.com/jenkinsci/influxdb-plugin/pull/35

           

          Frederic Rousseau added a comment - I created PR on branch dev as asked: https://github.com/jenkinsci/influxdb-plugin/pull/35  

          Frederic Rousseau added a comment - - edited

          Issue is not resolved! why was this closed!? It's been 21 days PR https://github.com/jenkinsci/influxdb-plugin/pull/35 is waiting to be merged

          Frederic Rousseau added a comment - - edited Issue is not resolved! why was this closed!? It's been 21 days PR https://github.com/jenkinsci/influxdb-plugin/pull/35  is waiting to be merged

          Aleksi Simell added a comment -

          zougi It was resolved 2 days ago by now an inactive user (so probably a bot). Thanks for reopening the issue.

          As to the speed of merging the PR. I know it's been a few weeks already without any progress and I apologize for that. I've been extremely busy the last few months, but now the project I work on went on hold for the Summer, so now I should have more time to look into the open issues and PRs.

          Aleksi Simell added a comment - zougi It was resolved 2 days ago by now an inactive user (so probably a bot). Thanks for reopening the issue. As to the speed of merging the PR. I know it's been a few weeks already without any progress and I apologize for that. I've been extremely busy the last few months, but now the project I work on went on hold for the Summer, so now I should have more time to look into the open issues and PRs.

          Scott Hebert added a comment -

          Scott Hebert added a comment - I created https://github.com/jenkinsci/influxdb-plugin/pull/44  to address the concerns of PR   https://github.com/jenkinsci/influxdb-plugin/pull/35

          Aleksi Simell added a comment -

          This feature is implemented by Pull requests 35 and 46.

          Aleksi Simell added a comment - This feature is implemented by Pull requests 35 and 46.

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

              Created:
              Updated:
              Resolved: