Interface ConsoleUrlProvider
- All Superinterfaces:
Describable<ConsoleUrlProvider>
- All Known Implementing Classes:
DefaultConsoleUrlProvider
In order to produce links to console URLs in Jelly templates, use Functions.getConsoleUrl(jenkins.console.WithConsoleUrl)
.
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:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
consoleUrlOf
(Run<?, ?> run) Looks up thegetConsoleUrl(hudson.model.Run<?, ?>)
value from the first provider to offer one.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.default Descriptor<ConsoleUrlProvider>
Gets the descriptor for this instance.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.static boolean
Check whether there are at least twoConsoleUrlProvider
implementations available.
-
Field Details
-
LOGGER
-
-
Method Details
-
getConsoleUrl
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 (should not start with
/
), ornull
if this implementation does not want to serve a special console view for this build.
-
getDescriptor
Description copied from interface:Describable
Gets the descriptor for this instance.Descriptor
is a singleton for every concreteDescribable
implementation, 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:
getDescriptor
in interfaceDescribable<ConsoleUrlProvider>
-
getRedirectUrl
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(jenkins.console.WithConsoleUrl)
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
-
consoleUrlOf
Looks up thegetConsoleUrl(hudson.model.Run<?, ?>)
value from the first provider to offer one.- Since:
- 2.476
-
isEnabled
static boolean isEnabled()Check whether there are at least twoConsoleUrlProvider
implementations available.- Returns:
true
if there are at least twoConsoleUrlProvider
implementations available,false
otherwise.
-