Package com.veertu.plugin.anka
Class AnkaMgmtCloud
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.slaves.Cloud
com.veertu.plugin.anka.AnkaMgmtCloud
- All Implemented Interfaces:
ExtensionPoint,Describable<Cloud>,ModelObject,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithContextMenu
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudStateNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected int -
Constructor Summary
ConstructorsConstructorDescriptionAnkaMgmtCloud(String ankaMgmtUrl, String cloudName, String credentialsId, String rootCaCredentialsId, boolean skipTLSVerification, List<AnkaCloudSlaveTemplate> templates, int cloudInstanceCap) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDynamicTemplate(DynamicSlaveTemplate template) booleancanProvision(Cloud.CloudState state) copyWithTemplates(List<AnkaCloudSlaveTemplate> newTemplates) Returns a new cloud instance with the same settings as this one but with the staticgetTemplates()list replaced bynewTemplates, including the Labels API token.static AnkaMgmtCloudstatic List<AnkaMgmtCloud>intintfinal Stringstatic AnkaMgmtCloudgetCloudThatHasImage(String masterVMID) intFull Labels API POST URL for this cloud, with the cloud name path-encoded for UI display and client use.Deprecated.Retained for Configuration as Code and older serialized configs that inlined the token.intintintintintbooleanintgetTemplate(Label label) getTemplateTags(String masterVmId) intintintbooleanhasMasterVm(String templateId) booleanbooleanisOnline()Lists node groups for provisioning.static voidLog(Slave slave, TaskListener listener, String msg) static voidLog(SlaveComputer slave, TaskListener listener, String format, Object... args) static voidstatic voidstatic voidmarkFuture(AnkaMgmtCloud cloud, AbstractAnkaSlave abstractAnkaSlave) provision(Cloud.CloudState state, int excessWorkload) protected ObjectvoidremoveDynamicTemplate(AbstractSlaveTemplate template) voidreplaceInJenkinsWith(AnkaMgmtCloud replacement) Atomically replaces this cloud on Jenkins and saves configuration (runs asACL.SYSTEM2).voidsaveImage(AbstractAnkaSlave node) voidsetCloudInstanceCap(int val) voidsetConnectionKeepAliveSeconds(int connectionKeepAliveSeconds) voidsetDurabilityMode(String durabilityMode) voidsetLabelsApiToken(Secret labelsApiToken) Deprecated.Retained for Configuration as Code and older serialized configs that inlined the token.voidsetLabelsApiTokenCredentialsId(String labelsApiTokenCredentialsId) voidsetLaunchRetryWaitTime(int launchRetryWaitTime) voidsetLaunchTimeout(int launchTimeout) voidsetMaxConnections(int maxConnections) voidsetMaxLaunchRetries(int maxLaunchRetries) voidsetMonitorRecurrenceMinutes(int minutes) voidDeprecated.Retained for Configuration as Code and older serialized configs that inlined PEM.voidsetSshLaunchDelaySeconds(int sshLaunchDelaySeconds) voidsetVmIPAssignRetries(int vmIPAssignRetries) voidsetVmIPAssignWaitSeconds(int vmIPAssignWaitSeconds) voidsetVmPollTime(int milliseconds) showInstance(String id) voidvoidterminateVMInstance(String id, AbstractAnkaSlave node) voidupdateInstance(String vmId, String name, String jenkinsNodeLink, String jobIdentifier) Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getDisplayName, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, reconfigure, reconfigure, registerPermissionsMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
Field Details
-
maxConnections
protected int maxConnections -
connectionKeepAliveSeconds
protected int connectionKeepAliveSeconds
-
-
Constructor Details
-
AnkaMgmtCloud
-
-
Method Details
-
setRootCA
Deprecated.Retained for Configuration as Code and older serialized configs that inlined PEM. Configure the cloudrootCaCredentialsId(Secret text credential id) instead. -
markFuture
-
Log
-
Log
-
Log
-
Log
-
getAnkaClouds
-
getCloudThatHasImage
-
get
-
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
-
setDurabilityMode
-
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
-
getCredentialsId
-
getRootCaCredentialsId
-
getCloudName
-
getAnkaMgmtUrl
-
getSkipTLSVerification
public boolean getSkipTLSVerification() -
getCloudInstanceCap
public int getCloudInstanceCap() -
setCloudInstanceCap
public void setCloudInstanceCap(int val) -
getCloudCapacity
public int getCloudCapacity() -
getNumOfRunningNodesPerLabel
-
listVmTemplates
-
getTemplateTags
-
getTemplates
-
getLabelsApiTokenCredentialsId
-
setLabelsApiTokenCredentialsId
-
getLabelsApiToken
Deprecated.Retained for Configuration as Code and older serialized configs that inlined the token. ConfigurelabelsApiTokenCredentialsIdinstead. -
setLabelsApiToken
Deprecated.Retained for Configuration as Code and older serialized configs that inlined the token. ConfigurelabelsApiTokenCredentialsIdinstead. -
isLabelsApiEnabled
public boolean isLabelsApiEnabled()- Returns:
- true if a Labels API token is configured (credential id or legacy inline secret).
-
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;
nullwhen the endpoint is not registered
-
copyWithTemplates
Returns a new cloud instance with the same settings as this one but with the staticgetTemplates()list replaced bynewTemplates, including the Labels API token. To persist, callupdateStaticTemplatesAndSave(List)orreplaceInJenkinsWith(AnkaMgmtCloud)with this return value. -
replaceInJenkinsWith
Atomically replaces this cloud on Jenkins and saves configuration (runs asACL.SYSTEM2).- Throws:
IOException
-
getDynamicTemplates
-
getNodeGroups
-
listNodeGroups
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) -
getTemplate
-
hasMasterVm
-
canProvision
- Overrides:
canProvisionin classCloud
-
getAnkaApi
-
isOnline
public boolean isOnline() -
isPushSupported
-
removeDynamicTemplate
-
addDynamicTemplate
-
saveImage
- Throws:
AnkaMgmtException
-
updateInstance
public void updateInstance(String vmId, String name, String jenkinsNodeLink, String jobIdentifier) throws AnkaMgmtException - Throws:
AnkaMgmtException
-
terminateVMInstance
- Throws:
AnkaMgmtException
-
terminateVMInstance
- Throws:
AnkaMgmtException
-
showInstance
- Throws:
AnkaMgmtException
-
getVmPollTime
public int getVmPollTime() -
setVmPollTime
@DataBoundSetter public void setVmPollTime(int milliseconds) -
getExistingTemplateIds
-
getExistingGroupIds
-
getExistingTags
-