Class BaremetalCloud

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

public class BaremetalCloud extends AbstractCloudImpl
  • Field Details

    • 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.
      See Also:
    • INSTANCE_NAME_PREFIX

      public static final String INSTANCE_NAME_PREFIX
      The prefix to add to the names of created instances.
      See Also:
  • Constructor Details

  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class Cloud
    • 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)
      Overrides:
      provision in class Cloud
    • recycleCloudResources

      public void recycleCloudResources(String instanceId) throws IOException
      Throws:
      IOException
    • stopCloudResources

      public void stopCloudResources(String instanceId) throws IOException
      Throws:
      IOException
    • getTerminationRetry

      public Retry<String> getTerminationRetry(Callable<String> task)
    • 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 by computerSet.jelly when explicitly provisioning a new node via the nodes page.
      Parameters:
      templateId - template id
      req - request
      rsp - response
      Throws:
      javax.servlet.ServletException - if a servlet exception occurs
      IOException - 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 by provisionArguments.jelly when explicitly provisioning a new node via the nodes page.
      Parameters:
      numberOfComputers - a number of agents
      templateId - template id
      req - request
      rsp - response
      Throws:
      javax.servlet.ServletException - if a servlet exception occurs
      IOException - if a IO error occurs
    • getTemplateId

      public int getTemplateId(javax.servlet.http.HttpServletRequest req)
      Called by provisionArguments.jelly to pass templateId to doProvision()
      Parameters:
      req - request
      Returns:
      template id
    • getProvisionSidePanelClass

      public Class<?> getProvisionSidePanelClass()
      Called by provisionArguments.jelly and provision.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 by doProvision(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 the provisionArguments.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 class Cloud
    • matchCredentials

      public static com.cloudbees.plugins.credentials.Credentials matchCredentials(Class c, String id)