Package com.parallels.jenkins
Class PrlDevopsCloud
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.slaves.Cloud
com.parallels.jenkins.PrlDevopsCloud
- All Implemented Interfaces:
ExtensionPoint,Describable<Cloud>,ModelObject,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithContextMenu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classBackground worker that runs every 60 seconds and removes anyPrlDevopsAgentnode whose VM has been deleted outside the plugin (e.g.Nested 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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PrlDevopsApiClientLooks up the configured credentials and constructs aPrlDevopsApiClientpointed at the configured service URL.booleancanProvision(Cloud.CloudState state) intgetTemplateForLabel(Label label) Returns the firstAgentTemplatewhose label set satisfies the given JenkinsLabel, ornullif none match.provision(Cloud.CloudState state, int excessWorkload) voidsetConnectionMode(ConnectionMode connectionMode) voidsetCredentialsId(String credentialsId) voidsetMaxAgents(int maxAgents) voidsetServiceUrl(String serviceUrl) voidsetTemplates(List<AgentTemplate> templates) 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
-
Constructor Details
-
PrlDevopsCloud
-
-
Method Details
-
getServiceUrl
-
getCredentialsId
-
getConnectionMode
-
getMaxAgents
public int getMaxAgents() -
getTemplates
-
setServiceUrl
-
setCredentialsId
-
setConnectionMode
-
setMaxAgents
@DataBoundSetter public void setMaxAgents(int maxAgents) -
setTemplates
-
getTemplateForLabel
Returns the firstAgentTemplatewhose label set satisfies the given JenkinsLabel, ornullif none match. -
canProvision
- Overrides:
canProvisionin classCloud
-
provision
public Collection<NodeProvisioner.PlannedNode> provision(Cloud.CloudState state, int excessWorkload) -
buildApiClient
Looks up the configured credentials and constructs aPrlDevopsApiClientpointed at the configured service URL.StringCredentials— API key mode: sendsX-API-Key: <encoded>.StandardUsernamePasswordCredentials— Bearer mode: exchanges username+password for a JWT viaPOST /api/v1/auth/token.
Protected so tests can override and inject a mock client.
- Throws:
PrlApiException- if credentials cannot be resolved.
-