Package io.jenkins.blueocean.rest.model
Class BlueRun
- java.lang.Object
-
- io.jenkins.blueocean.rest.model.Resource
-
- io.jenkins.blueocean.rest.model.BlueRun
-
- All Implemented Interfaces:
BlueItemRun
,Reachable
public abstract class BlueRun extends Resource implements BlueItemRun
BlueOCean Run model. Implementers of different Run typegetType()
can add additional data to this model. e.g. A FreeStyle job can expose change log or Pipeline run can add steps and their status etc.- Author:
- Vivek Pandey
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlueRun.BlueCause
static class
BlueRun.BlueRunResult
static class
BlueRun.BlueRunState
-
Field Summary
Fields Modifier and Type Field Description static String
ACTIONS
static String
CAUSE_OF_BLOCKAGE
static String
CAUSES
static String
DATE_FORMAT_STRING
Date String formatstatic int
DEFAULT_BLOCKING_STOP_TIMEOUT_IN_SECS
static String
DESCRIPTION
static String
DURATION_IN_MILLIS
static String
END_TIME
static String
ENQUEUE_TIME
static String
ESTIMATED_DURATION_IN_MILLIS
static String
ID
static String
NAME
static String
ORGANIZATION
static String
PIPELINE
static String
REPLAYABLE
static String
RESULT
static String
RUN_SUMMARY
static String
START_TIME
static String
STATE
static String
TEST_SUMMARY
static String
TYPE
-
Constructor Summary
Constructors Constructor Description BlueRun()
-
Method Summary
-
-
-
Field Detail
-
ORGANIZATION
public static final String ORGANIZATION
- See Also:
- Constant Field Values
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
PIPELINE
public static final String PIPELINE
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
DESCRIPTION
public static final String DESCRIPTION
- See Also:
- Constant Field Values
-
START_TIME
public static final String START_TIME
- See Also:
- Constant Field Values
-
END_TIME
public static final String END_TIME
- See Also:
- Constant Field Values
-
ENQUEUE_TIME
public static final String ENQUEUE_TIME
- See Also:
- Constant Field Values
-
DURATION_IN_MILLIS
public static final String DURATION_IN_MILLIS
- See Also:
- Constant Field Values
-
ESTIMATED_DURATION_IN_MILLIS
public static final String ESTIMATED_DURATION_IN_MILLIS
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
RUN_SUMMARY
public static final String RUN_SUMMARY
- See Also:
- Constant Field Values
-
RESULT
public static final String RESULT
- See Also:
- Constant Field Values
-
STATE
public static final String STATE
- See Also:
- Constant Field Values
-
CAUSE_OF_BLOCKAGE
public static final String CAUSE_OF_BLOCKAGE
- See Also:
- Constant Field Values
-
REPLAYABLE
public static final String REPLAYABLE
- See Also:
- Constant Field Values
-
TEST_SUMMARY
public static final String TEST_SUMMARY
- See Also:
- Constant Field Values
-
ACTIONS
public static final String ACTIONS
- See Also:
- Constant Field Values
-
CAUSES
public static final String CAUSES
- See Also:
- Constant Field Values
-
DEFAULT_BLOCKING_STOP_TIMEOUT_IN_SECS
public static final int DEFAULT_BLOCKING_STOP_TIMEOUT_IN_SECS
- See Also:
- Constant Field Values
-
DATE_FORMAT_STRING
public static final String DATE_FORMAT_STRING
Date String format- See Also:
- Constant Field Values
-
-
Method Detail
-
getOrganization
@Exported(name="organization") public abstract String getOrganization()
- Specified by:
getOrganization
in interfaceBlueItemRun
- Returns:
- name of the organization
-
getId
@Exported(name="id") public abstract String getId()
- Specified by:
getId
in interfaceBlueItemRun
- Returns:
BlueRun
id - unique within a pipeline
-
getPipeline
@Exported(name="pipeline") public abstract String getPipeline()
- Specified by:
getPipeline
in interfaceBlueItemRun
- Returns:
- Pipeline name - unique within an organization
-
getName
@Exported(name="name") public abstract String getName()
- Specified by:
getName
in interfaceBlueItemRun
-
getDescription
@Exported(name="description") public abstract String getDescription()
- Specified by:
getDescription
in interfaceBlueItemRun
-
getStartTime
public abstract Date getStartTime()
- Returns:
- Build execution start time inside executor
-
getChangeSet
@Exported(inline=true) @NonNull @Navigable public abstract Container<BlueChangeSetEntry> getChangeSet()
- Specified by:
getChangeSet
in interfaceBlueItemRun
- Returns:
- Gives change set of a run
-
getStartTimeString
@Exported(name="startTime") public abstract String getStartTimeString()
- Specified by:
getStartTimeString
in interfaceBlueItemRun
- Returns:
- run start time
-
getEnQueueTime
public abstract Date getEnQueueTime()
- Returns:
- Time when build is scheduled and is in queue waiting for executor
-
getEnQueueTimeString
@Exported(name="enQueueTime") public abstract String getEnQueueTimeString()
Description copied from interface:BlueItemRun
Enque time- Specified by:
getEnQueueTimeString
in interfaceBlueItemRun
-
getEndTime
public abstract Date getEndTime()
- Returns:
- Build end time
-
getEndTimeString
@Exported(name="endTime") public abstract String getEndTimeString()
Description copied from interface:BlueItemRun
Run end time- Specified by:
getEndTimeString
in interfaceBlueItemRun
-
getDurationInMillis
@Exported(name="durationInMillis") public abstract Long getDurationInMillis()
- Specified by:
getDurationInMillis
in interfaceBlueItemRun
- Returns:
- Build duration in milli seconds
-
getEstimatedDurtionInMillis
@Exported(name="estimatedDurationInMillis") public abstract Long getEstimatedDurtionInMillis()
- Specified by:
getEstimatedDurtionInMillis
in interfaceBlueItemRun
- Returns:
- Estimated Build duration in milli seconds
-
getStateObj
@Exported(name="state") public abstract BlueRun.BlueRunState getStateObj()
- Specified by:
getStateObj
in interfaceBlueItemRun
- Returns:
- The state of the run
-
getResult
@Exported(name="result") public abstract BlueRun.BlueRunResult getResult()
- Specified by:
getResult
in interfaceBlueItemRun
- Returns:
- The result state of the job (e.g unstable)
-
getRunSummary
@Exported(name="runSummary") public abstract String getRunSummary()
- Specified by:
getRunSummary
in interfaceBlueItemRun
- Returns:
- Build summary
-
getType
@Exported(name="type") public abstract String getType()
- Specified by:
getType
in interfaceBlueItemRun
- Returns:
- Type of Run. Type name to be Jenkins Run.getClass().getSimpleName()
-
stop
@PUT @WebMethod(name="stop") public abstract BlueRun stop(@QueryParameter("blocking") Boolean blocking, @QueryParameter("timeOutInSecs") Integer timeOutInSecs)
Attempt to stop ongoing run.- Parameters:
blocking
- if true then tries to stop till times out.timeOutInSecs
- if blocking is true then defines timeout value in seconds. Default 10 sec. If non-blocking then this parameter is ignored.- Returns:
- Blue run instance. Caller should look at state field to determine if stop was successful. If state is
BlueRun.BlueRunState.FINISHED
then stop was successful or run finished normally.
-
getArtifactsZipFile
@Exported public abstract String getArtifactsZipFile()
- Specified by:
getArtifactsZipFile
in interfaceBlueItemRun
- Returns:
- Uri of artifacts zip file.
-
getArtifacts
@Navigable public abstract BlueArtifactContainer getArtifacts()
- Specified by:
getArtifacts
in interfaceBlueItemRun
- Returns:
- Run artifacts
-
getNodes
public abstract BluePipelineNodeContainer getNodes()
- Returns:
- Serves .../runs/{rundId}/nodes/ and provides pipeline execution nodes
- See Also:
BluePipelineNode
-
getActions
@Navigable @Exported(name="actions", inline=true) public abstract Collection<BlueActionProxy> getActions()
- Specified by:
getActions
in interfaceBlueItemRun
- Returns:
- Gives Actions associated with this Run, if requested via tree
-
getSteps
public abstract BluePipelineStepContainer getSteps()
- Returns:
- Gives steps from pipeline. The list of steps must not include stages, this is because stage could be interpreted as step as its StepAtomNode and implementation of this API must ensure not to include it.
-
getTests
@Navigable public abstract BlueTestResultContainer getTests()
- Specified by:
getTests
in interfaceBlueItemRun
- Returns:
- Gives tests in this run
-
getTestSummary
@Deprecated public abstract BlueTestSummary getTestSummary()
Deprecated.- Specified by:
getTestSummary
in interfaceBlueItemRun
- Returns:
- Gives the test summary for this run
-
getBlueTestSummary
@Navigable public abstract BlueTestSummary getBlueTestSummary()
-
getLog
@Navigable public abstract Object getLog()
- Specified by:
getLog
in interfaceBlueItemRun
- Returns:
- Instance of stapler aware instance that can do the following:
- Must be able to process start query parameter. 'start' parameter is the byte offset in the actual log file
- Must produce following HTTP headers in the response
- X-Text-Size It is the byte offset of the raw log file client should use in the next request as value of start query parameter.
- X-More-Data If its true, then client should repeat the request after some delay. In the repeated request it should use X-TEXT-SIZE header value with *start* query parameter.
-
replay
@POST @WebMethod(name="replay") public abstract BlueRun replay()
Replays a pipeline. The SCM commit/revision used in the existing and new runs should match.- Returns:
- The queued item.
-
getCauses
@Exported(name="causes", inline=true) public abstract Collection<BlueRun.BlueCause> getCauses()
- Specified by:
getCauses
in interfaceBlueItemRun
- Returns:
- cause of the run being created
-
getCauseOfBlockage
@Exported(name="causeOfBlockage") public abstract String getCauseOfBlockage()
- Specified by:
getCauseOfBlockage
in interfaceBlueItemRun
- Returns:
- cause of what is blocking this run
-
isReplayable
@Exported(name="replayable") public abstract boolean isReplayable()
- Specified by:
isReplayable
in interfaceBlueItemRun
- Returns:
- if the run will allow a replay
-
-