Class AnkaMgmtCloud

All Implemented Interfaces:
ExtensionPoint, Describable<Cloud>, ModelObject, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithContextMenu

public class AnkaMgmtCloud extends Cloud
  • Field Details

    • maxConnections

      protected int maxConnections
    • connectionKeepAliveSeconds

      protected int connectionKeepAliveSeconds
  • Constructor Details

  • Method Details

    • setRootCA

      @Deprecated @DataBoundSetter public void setRootCA(String rootCA)
      Deprecated.
      Retained for Configuration as Code and older serialized configs that inlined PEM. Configure the cloud rootCaCredentialsId (Secret text credential id) instead.
    • markFuture

      public static void markFuture(AnkaMgmtCloud cloud, AbstractAnkaSlave abstractAnkaSlave)
    • Log

      public static void Log(String msg)
    • Log

      public static void Log(String format, Object... args)
    • Log

      public static void Log(Slave slave, TaskListener listener, String msg)
    • Log

      public static void Log(SlaveComputer slave, TaskListener listener, String format, Object... args)
    • getAnkaClouds

      public static List<AnkaMgmtCloud> getAnkaClouds()
    • getCloudThatHasImage

      public static AnkaMgmtCloud getCloudThatHasImage(String masterVMID)
    • get

      public static AnkaMgmtCloud get(String cloudName)
    • getLaunchTimeout

      public int getLaunchTimeout()
    • setLaunchTimeout

      @DataBoundSetter public void setLaunchTimeout(int launchTimeout)
    • getMaxLaunchRetries

      public int getMaxLaunchRetries()
    • setMaxLaunchRetries

      @DataBoundSetter public void setMaxLaunchRetries(int maxLaunchRetries)
    • getLaunchRetryWaitTime

      public int getLaunchRetryWaitTime()
    • setLaunchRetryWaitTime

      @DataBoundSetter public void setLaunchRetryWaitTime(int launchRetryWaitTime)
    • getSshLaunchDelaySeconds

      public int getSshLaunchDelaySeconds()
    • setSshLaunchDelaySeconds

      @DataBoundSetter public void setSshLaunchDelaySeconds(int sshLaunchDelaySeconds)
    • getVmIPAssignWaitSeconds

      public int getVmIPAssignWaitSeconds()
    • setVmIPAssignWaitSeconds

      @DataBoundSetter public void setVmIPAssignWaitSeconds(int vmIPAssignWaitSeconds)
    • getVmIPAssignRetries

      public int getVmIPAssignRetries()
    • setVmIPAssignRetries

      @DataBoundSetter public void setVmIPAssignRetries(int vmIPAssignRetries)
    • getDurabilityMode

      public String getDurabilityMode()
    • setDurabilityMode

      @DataBoundSetter public void setDurabilityMode(String durabilityMode)
    • getMonitorRecurrenceMinutes

      public int getMonitorRecurrenceMinutes()
    • setMonitorRecurrenceMinutes

      @DataBoundSetter public void setMonitorRecurrenceMinutes(int minutes)
    • getMaxConnections

      public int getMaxConnections()
    • setMaxConnections

      @DataBoundSetter public void setMaxConnections(int maxConnections)
    • getConnectionKeepAliveSeconds

      public int getConnectionKeepAliveSeconds()
    • setConnectionKeepAliveSeconds

      @DataBoundSetter public void setConnectionKeepAliveSeconds(int connectionKeepAliveSeconds)
    • readResolve

      protected Object readResolve()
    • getCredentialsId

      public String getCredentialsId()
    • getRootCaCredentialsId

      public String getRootCaCredentialsId()
    • getCloudName

      public final String getCloudName()
    • getAnkaMgmtUrl

      public String getAnkaMgmtUrl()
    • getSkipTLSVerification

      public boolean getSkipTLSVerification()
    • getCloudInstanceCap

      public int getCloudInstanceCap()
    • setCloudInstanceCap

      public void setCloudInstanceCap(int val)
    • getCloudCapacity

      public int getCloudCapacity()
    • getNumOfRunningNodesPerLabel

      public NodeCountResponse getNumOfRunningNodesPerLabel(Label label)
    • listVmTemplates

      public List<AnkaVmTemplate> listVmTemplates()
    • getTemplateTags

      public List<String> getTemplateTags(String masterVmId)
    • getTemplates

      public List<AnkaCloudSlaveTemplate> getTemplates()
    • getLabelsApiTokenCredentialsId

      public String getLabelsApiTokenCredentialsId()
    • setLabelsApiTokenCredentialsId

      @DataBoundSetter public void setLabelsApiTokenCredentialsId(String labelsApiTokenCredentialsId)
    • getLabelsApiToken

      @Deprecated public Secret getLabelsApiToken()
      Deprecated.
      Retained for Configuration as Code and older serialized configs that inlined the token. Configure labelsApiTokenCredentialsId instead.
    • setLabelsApiToken

      @Deprecated @DataBoundSetter public void setLabelsApiToken(Secret labelsApiToken)
      Deprecated.
      Retained for Configuration as Code and older serialized configs that inlined the token. Configure labelsApiTokenCredentialsId instead.
    • isLabelsApiEnabled

      public boolean isLabelsApiEnabled()
      Returns:
      true if a Labels API token is configured (credential id or legacy inline secret).
    • getLabelsApiEndpointUrl

      @Nullable public String getLabelsApiEndpointUrl()
      Full Labels API POST URL for this cloud, with the cloud name path-encoded for UI display and client use.
      Returns:
      the URL when a Labels API token is configured; null when the endpoint is not registered
    • copyWithTemplates

      public AnkaMgmtCloud copyWithTemplates(List<AnkaCloudSlaveTemplate> newTemplates)
      Returns a new cloud instance with the same settings as this one but with the static getTemplates() list replaced by newTemplates, including the Labels API token. To persist, call updateStaticTemplatesAndSave(List) or replaceInJenkinsWith(AnkaMgmtCloud) with this return value.
    • replaceInJenkinsWith

      public void replaceInJenkinsWith(AnkaMgmtCloud replacement) throws IOException
      Atomically replaces this cloud on Jenkins and saves configuration (runs as ACL.SYSTEM2).
      Throws:
      IOException
    • getDynamicTemplates

      public List<DynamicSlaveTemplate> getDynamicTemplates()
    • getNodeGroups

      public List<NodeGroup> getNodeGroups()
    • listNodeGroups

      public List<NodeGroup> listNodeGroups() throws AnkaMgmtException
      Lists node groups for provisioning. Propagates failures so callers can fail closed instead of treating errors as an empty group list.
      Throws:
      AnkaMgmtException
    • provision

      public Collection<NodeProvisioner.PlannedNode> provision(Cloud.CloudState state, int excessWorkload)
      Overrides:
      provision in class Cloud
    • getTemplate

      public AnkaCloudSlaveTemplate getTemplate(Label label)
    • hasMasterVm

      public boolean hasMasterVm(String templateId)
    • canProvision

      public boolean canProvision(Cloud.CloudState state)
      Overrides:
      canProvision in class Cloud
    • getAnkaApi

      public AnkaAPI getAnkaApi()
    • isOnline

      public boolean isOnline()
    • isPushSupported

      public Boolean isPushSupported()
    • removeDynamicTemplate

      public void removeDynamicTemplate(AbstractSlaveTemplate template)
    • addDynamicTemplate

      public void addDynamicTemplate(DynamicSlaveTemplate template)
    • saveImage

      public void saveImage(AbstractAnkaSlave node) throws AnkaMgmtException
      Throws:
      AnkaMgmtException
    • updateInstance

      public void updateInstance(String vmId, String name, String jenkinsNodeLink, String jobIdentifier) throws AnkaMgmtException
      Throws:
      AnkaMgmtException
    • terminateVMInstance

      public void terminateVMInstance(String id) throws AnkaMgmtException
      Throws:
      AnkaMgmtException
    • terminateVMInstance

      public void terminateVMInstance(String id, AbstractAnkaSlave node) throws AnkaMgmtException
      Throws:
      AnkaMgmtException
    • showInstance

      public AnkaVmInstance showInstance(String id) throws AnkaMgmtException
      Throws:
      AnkaMgmtException
    • getVmPollTime

      public int getVmPollTime()
    • setVmPollTime

      @DataBoundSetter public void setVmPollTime(int milliseconds)
    • getExistingTemplateIds

      public Set<String> getExistingTemplateIds()
    • getExistingGroupIds

      public Set<String> getExistingGroupIds()
    • getExistingTags

      public Set<String> getExistingTags()