Class VSphereConnectionConfig

java.lang.Object
hudson.model.AbstractDescribableImpl<VSphereConnectionConfig>
org.jenkinsci.plugins.vsphere.VSphereConnectionConfig
All Implemented Interfaces:
Describable<VSphereConnectionConfig>

public class VSphereConnectionConfig extends AbstractDescribableImpl<VSphereConnectionConfig>
Author:
Oleg Nenashev <o.v.nenashev@gmail.com>
  • Constructor Details

    • VSphereConnectionConfig

      @DataBoundConstructor public VSphereConnectionConfig(String vsHost, String credentialsId, String httpClientClassName)
    • VSphereConnectionConfig

      public VSphereConnectionConfig(String vsHost, boolean allowUntrustedCertificate, String credentialsId)
      Full constructor for internal use, initializes all fields
  • Method Details

    • setupGlobalHttpClientClass

      public static Class<?> setupGlobalHttpClientClass()
    • getHttpClientClassName

      public static String getHttpClientClassName()
    • setHttpClientClassName

      @DataBoundSetter public void setHttpClientClassName(String httpClientClassName)
    • getVsHost

      @CheckForNull public String getVsHost()
    • setAllowUntrustedCertificate

      @DataBoundSetter public void setAllowUntrustedCertificate(boolean allowUntrustedCertificate)
    • getAllowUntrustedCertificate

      public boolean getAllowUntrustedCertificate()
    • getCredentialsId

      @CheckForNull public String getCredentialsId()
    • getCredentials

      @CheckForNull public com.cloudbees.plugins.credentials.common.StandardCredentials getCredentials()
    • getPassword

      @CheckForNull public String getPassword()
    • getUsername

      @CheckForNull public String getUsername()
    • migrateLegacyCredentials

      @CheckForNull public static String migrateLegacyCredentials(@CheckForNull String vsHost, @CheckForNull String username, @CheckForNull String password)
      One-time migration for vSphereCloud instances still persisted in the legacy XML format (plain vsHost/username/password elements predating this class), so they keep working without the admin having to manually create a credential. Creates - or reuses, if this already ran on a previous load - a UsernamePasswordCredentialsImpl in the Jenkins-global credentials store and returns its id; returns null (leaving credentialsId unset) if there is no legacy username to migrate or no credentials store is available yet.