Class BaremetalCloud
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.slaves.Cloud
-
- hudson.slaves.AbstractCloudImpl
-
- com.oracle.cloud.baremetal.jenkins.BaremetalCloud
-
- All Implemented Interfaces:
ExtensionPoint,Describable<Cloud>,ModelObject,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithContextMenu
public class BaremetalCloud extends AbstractCloudImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaremetalCloud.DescriptorImpl-
Nested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudState
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static StringINSTANCE_NAME_PREFIXThe prefix to add to the names of created instances.static StringNAME_PREFIXThe prefix to add to names provided by the user in the UI to ensure that names of clouds in different plugins do not conflict.
-
Constructor Summary
Constructors Constructor Description BaremetalCloud(String cloudName, String credentialsId, String instanceCapStr, String maxAsyncThreads, int nextTemplateId, List<? extends BaremetalCloudAgentTemplate> templates)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProvision(Label label)org.kohsuke.stapler.HttpResponsedoIndex()The breadcrumb on theprovisionArguments.jellypage contains a link to this object.voiddoProvision(int numberOfComputers, int templateId, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Called byprovisionArguments.jellywhen explicitly provisioning a new node via the nodes page.voiddoProvisionArguments(int templateId, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Called bycomputerSet.jellywhen explicitly provisioning a new node via the nodes page.BaremetalCloudClientgetClient()StringgetCloudName()StringgetCredentialsId()StringgetDisplayName()StringgetMaxAsyncThreads()intgetNextTemplateId()Class<?>getProvisionSidePanelClass()Called byprovisionArguments.jellyandprovision.jellyto show a sidepanel.StringgetProvisionStartedMessage(javax.servlet.http.HttpServletRequest req)Display a provisioning message based on request attributes set bydoProvision(int, int, org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse).BaremetalCloudAgentTemplategetTemplate(Label label)intgetTemplateId(javax.servlet.http.HttpServletRequest req)Called byprovisionArguments.jellyto pass templateId to doProvision()protected intgetTemplateNodeCount(int templateId)List<? extends BaremetalCloudAgentTemplate>getTemplates()Retry<String>getTerminationRetry(Callable<String> task)static com.cloudbees.plugins.credentials.CredentialsmatchCredentials(Class c, String id)Collection<NodeProvisioner.PlannedNode>provision(Label label, int excessWorkload)voidrecycleCloudResources(String instanceId)voidstopCloudResources(String instanceId)-
Methods inherited from class hudson.slaves.AbstractCloudImpl
getInstanceCap, getInstanceCapStr, setInstanceCap, setInstanceCapStr
-
Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, reconfigure, registerPermissions
-
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
-
-
-
Field Detail
-
NAME_PREFIX
public static final String NAME_PREFIX
The prefix to add to names provided by the user in the UI to ensure that names of clouds in different plugins do not conflict. We use the term "name" to mean the full name with a prefix (to match Cloud.name), and we use the term "cloud name" to be the short name without a prefix.
-
INSTANCE_NAME_PREFIX
public static final String INSTANCE_NAME_PREFIX
The prefix to add to the names of created instances.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein interfaceModelObject- Overrides:
getDisplayNamein classCloud
-
getCloudName
public String getCloudName()
-
getCredentialsId
public String getCredentialsId()
-
getMaxAsyncThreads
public String getMaxAsyncThreads()
-
getNextTemplateId
public int getNextTemplateId()
-
getTemplates
public List<? extends BaremetalCloudAgentTemplate> getTemplates()
-
provision
public Collection<NodeProvisioner.PlannedNode> provision(Label label, int excessWorkload)
-
recycleCloudResources
public void recycleCloudResources(String instanceId) throws IOException
- Throws:
IOException
-
stopCloudResources
public void stopCloudResources(String instanceId) throws IOException
- Throws:
IOException
-
getTemplate
public BaremetalCloudAgentTemplate getTemplate(Label label)
-
doProvisionArguments
public void doProvisionArguments(@QueryParameter int templateId, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOExceptionCalled bycomputerSet.jellywhen explicitly provisioning a new node via the nodes page.- Parameters:
templateId- template idreq- requestrsp- response- Throws:
javax.servlet.ServletException- if a servlet exception occursIOException- if a IO error occurs
-
doProvision
public void doProvision(@QueryParameter int numberOfComputers, @QueryParameter int templateId, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOExceptionCalled byprovisionArguments.jellywhen explicitly provisioning a new node via the nodes page.- Parameters:
numberOfComputers- a number of agentstemplateId- template idreq- requestrsp- response- Throws:
javax.servlet.ServletException- if a servlet exception occursIOException- if a IO error occurs
-
getTemplateId
public int getTemplateId(javax.servlet.http.HttpServletRequest req)
Called byprovisionArguments.jellyto pass templateId to doProvision()- Parameters:
req- request- Returns:
- template id
-
getProvisionSidePanelClass
public Class<?> getProvisionSidePanelClass()
Called byprovisionArguments.jellyandprovision.jellyto show a sidepanel.- Returns:
- provision side panel class
-
getProvisionStartedMessage
public String getProvisionStartedMessage(javax.servlet.http.HttpServletRequest req)
Display a provisioning message based on request attributes set bydoProvision(int, int, org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse).- Parameters:
req- request- Returns:
- provision started message
-
doIndex
public org.kohsuke.stapler.HttpResponse doIndex() throws IOExceptionThe breadcrumb on theprovisionArguments.jellypage contains a link to this object. We have no data to display, so redirect the user to the computer set page.- Returns:
- the http response
- Throws:
IOException- if an IO error occurs
-
getClient
public BaremetalCloudClient getClient()
-
getTemplateNodeCount
protected int getTemplateNodeCount(int templateId)
-
canProvision
public boolean canProvision(Label label)
- Overrides:
canProvisionin classCloud
-
-