Interface ConsoleUrlProvider
-
- All Superinterfaces:
Describable<ConsoleUrlProvider>
- All Known Implementing Classes:
DefaultConsoleUrlProvider
public interface ConsoleUrlProvider extends Describable<ConsoleUrlProvider>
Extension point that allows implementations to redirect build console links to a specified URL.In order to produce links to console URLs in Jelly templates, use
Functions.getConsoleUrl(hudson.model.Queue.Executable).Note: If you implement this API, consider providing a link to the classic console from within your console visualization as a fallback, particularly if your visualization is not as general as the classic console, has limitations that might be relevant in some cases, or requires advanced data that may be not exist for failed or corrupted builds. For example, if you visualize Pipeline build logs using only
LogStorage.stepLog, there will be log lines that will never show up in your visualization, or if your visualization traverses the Pipeline flow graph, there may be various edge cases where your visualization does not work at all, but the classic console view is unaffected.- Since:
- 2.433
- See Also:
Functions.getConsoleUrl(hudson.model.Queue.Executable)
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetConsoleUrl(Run<?,?> run)Get a URL relative to the context path of Jenkins which should be used to link to the console for the specified build.default Descriptor<ConsoleUrlProvider>getDescriptor()Gets the descriptor for this instance.static StringgetRedirectUrl(Run<?,?> run)Get a URL relative to the web server root which should be used to link to the console for the specified build.static booleanisEnabled()Check whether there are at least twoConsoleUrlProviderimplementations available.
-
-
-
Field Detail
-
LOGGER
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) static final Logger LOGGER
-
-
Method Detail
-
getConsoleUrl
@CheckForNull String getConsoleUrl(Run<?,?> run)
Get a URL relative to the context path of Jenkins which should be used to link to the console for the specified build.Should only be used in the context of serving an HTTP request.
- Parameters:
run- the build- Returns:
- the URL for the console for the specified build, relative to the context of Jenkins, or
nullif this implementation does not want to server a special console view for this build.
-
getDescriptor
default Descriptor<ConsoleUrlProvider> getDescriptor()
Description copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<ConsoleUrlProvider>
-
getRedirectUrl
@NonNull static String getRedirectUrl(Run<?,?> run)
Get a URL relative to the web server root which should be used to link to the console for the specified build.Should only be used in the context of serving an HTTP request.
Use
Functions.getConsoleUrl(hudson.model.Queue.Executable)to obtain this link in a Jelly template.- Parameters:
run- the build- Returns:
- the URL for the console for the specified build, relative to the web server root
-
isEnabled
static boolean isEnabled()
Check whether there are at least twoConsoleUrlProviderimplementations available.- Returns:
trueif there are at least twoConsoleUrlProviderimplementations available,falseotherwise.
-
-