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 class
BaremetalCloud.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 String
INSTANCE_NAME_PREFIX
The prefix to add to the names of created instances.static 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.
-
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 boolean
canProvision(Label label)
org.kohsuke.stapler.HttpResponse
doIndex()
The breadcrumb on theprovisionArguments.jelly
page contains a link to this object.void
doProvision(int numberOfComputers, int templateId, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Called byprovisionArguments.jelly
when explicitly provisioning a new node via the nodes page.void
doProvisionArguments(int templateId, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Called bycomputerSet.jelly
when explicitly provisioning a new node via the nodes page.BaremetalCloudClient
getClient()
String
getCloudName()
String
getCredentialsId()
String
getDisplayName()
String
getMaxAsyncThreads()
int
getNextTemplateId()
Class<?>
getProvisionSidePanelClass()
Called byprovisionArguments.jelly
andprovision.jelly
to show a sidepanel.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)
.BaremetalCloudAgentTemplate
getTemplate(Label label)
int
getTemplateId(javax.servlet.http.HttpServletRequest req)
Called byprovisionArguments.jelly
to pass templateId to doProvision()protected int
getTemplateNodeCount(int templateId)
List<? extends BaremetalCloudAgentTemplate>
getTemplates()
Retry<String>
getTerminationRetry(Callable<String> task)
static com.cloudbees.plugins.credentials.Credentials
matchCredentials(Class c, String id)
Collection<NodeProvisioner.PlannedNode>
provision(Label label, int excessWorkload)
void
recycleCloudResources(String instanceId)
void
stopCloudResources(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:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in 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, IOException
Called bycomputerSet.jelly
when 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, IOException
Called byprovisionArguments.jelly
when 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.jelly
to pass templateId to doProvision()- Parameters:
req
- request- Returns:
- template id
-
getProvisionSidePanelClass
public Class<?> getProvisionSidePanelClass()
Called byprovisionArguments.jelly
andprovision.jelly
to 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 IOException
The breadcrumb on theprovisionArguments.jelly
page 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:
canProvision
in classCloud
-
-