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

Allow the deletion/modification of EC2 clouds through groovy

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Major Major
    • ec2-plugin
    • Jenkins version: 2.220
      ec2-plugin version: 1.49.1

      Since it is possible to script the configuration of EC2 clouds using groovy, it would be very useful to implement the functionality to delete/modify existing clouds. In the example provided here: https://github.com/jenkinsci/ec2-plugin

      It shows how to add a configuration using jenkins.clouds.add() method, however no method is specified for deleting/modifying existing clouds. In the scenario where you one wants to scripts this entire configuration, and the configuration changes over time, this is essential. 

      I am unsure if this functionality needs to be implemented in jenkins core or if it is possible through the plugin, so apologies if the labelling is off.

          [JENKINS-61059] Allow the deletion/modification of EC2 clouds through groovy

          John Doe added a comment - - edited

          This is apparently already possible. I was able to delete all existing clouds using the following snippet:

          Jenkins jenkins = Jenkins.getInstance()
          jenkins.clouds.each {
            jenkins.clouds.remove(it)
          }
          

          John Doe added a comment - - edited This is apparently already possible. I was able to delete all existing clouds using the following snippet: Jenkins jenkins = Jenkins.getInstance() jenkins.clouds.each {   jenkins.clouds.remove(it) }

            thoulen FABRIZIO MANFREDI
            palpatine John Doe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: