@Extension @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class Api extends Object implements hudson.model.RootAction
| Constructor and Description |
|---|
Api() |
| Modifier and Type | Method and Description |
|---|---|
void |
doDiscover(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Initial request to test the connection/compatibility.
|
void |
doReportWorkload(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Report workload to be executed on orchestrator for particular executor master.
|
void |
doReturnNode(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Return node to orchestrator when no longer needed.
|
String |
getDisplayName() |
String |
getIconFileName() |
static Api |
getInstance() |
String |
getUrlName() |
Boolean |
isUtilized(ExecutorJenkins owner,
ShareableNode node)
Determine whether the host is still used by particular executor.
|
NodeStatusResponse.Status |
nodeStatus(ExecutorJenkins jenkins,
String nodeName) |
ReportUsageResponse |
reportUsage(ExecutorJenkins owner)
Query executor Jenkins to report shared hosts it uses.
|
boolean |
utilizeNode(ExecutorJenkins executor,
ShareableNode node)
Signal to Executor Jenkins to start using particular node.
|
public String getIconFileName()
getIconFileName in interface hudson.model.Actionpublic String getDisplayName()
getDisplayName in interface hudson.model.ActiongetDisplayName in interface hudson.model.ModelObjectpublic String getUrlName()
getUrlName in interface hudson.model.Actionpublic boolean utilizeNode(@Nonnull ExecutorJenkins executor, @Nonnull ShareableNode node)
executor - Jenkins instance the node is reserved for.node - Node to be reserved.@Nonnull public ReportUsageResponse reportUsage(@Nonnull ExecutorJenkins owner)
owner - Jenkins instance to query.public Boolean isUtilized(@Nonnull ExecutorJenkins owner, @Nonnull ShareableNode node)
utilizeNode(ExecutorJenkins, ShareableNode) was send and
doReturnNode(StaplerRequest, StaplerResponse) was received but in case of any of the requests failed to
be delivered for some reason, there is this way to recheck. Note this has to recognise Jenkins was stopped or
plugin was uninstalled so we can not rely on node-sharing API on Executor end.owner - Jenkins instance to query.node - The node to query.@Nonnull public NodeStatusResponse.Status nodeStatus(@Nonnull ExecutorJenkins jenkins, @Nonnull String nodeName)
public void doDiscover(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
IOExceptionpublic void doReportWorkload(@Nonnull org.kohsuke.stapler.StaplerRequest req, @Nonnull org.kohsuke.stapler.StaplerResponse rsp) throws IOException
IOExceptionpublic void doReturnNode(@Nonnull org.kohsuke.stapler.StaplerRequest req, @Nonnull org.kohsuke.stapler.StaplerResponse rsp) throws IOException
IOExceptionCopyright © 2016–2020. All rights reserved.