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 type getType() 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
  • Field Details

  • Constructor Details

    • BlueRun

      public BlueRun()
  • Method Details

    • getOrganization

      @Exported(name="organization") public abstract String getOrganization()
      Specified by:
      getOrganization in interface BlueItemRun
      Returns:
      name of the organization
    • getId

      @Exported(name="id") public abstract String getId()
      Specified by:
      getId in interface BlueItemRun
      Returns:
      BlueRun id - unique within a pipeline
    • getPipeline

      @Exported(name="pipeline") public abstract String getPipeline()
      Specified by:
      getPipeline in interface BlueItemRun
      Returns:
      Pipeline name - unique within an organization
    • getName

      @Exported(name="name") public abstract String getName()
      Specified by:
      getName in interface BlueItemRun
    • getDescription

      @Exported(name="description") public abstract String getDescription()
      Specified by:
      getDescription in interface BlueItemRun
    • 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 interface BlueItemRun
      Returns:
      Gives change set of a run
    • getStartTimeString

      @Exported(name="startTime") public abstract String getStartTimeString()
      Specified by:
      getStartTimeString in interface BlueItemRun
      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 interface BlueItemRun
    • 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 interface BlueItemRun
    • getDurationInMillis

      @Exported(name="durationInMillis") public abstract Long getDurationInMillis()
      Specified by:
      getDurationInMillis in interface BlueItemRun
      Returns:
      Build duration in milli seconds
    • getEstimatedDurtionInMillis

      @Exported(name="estimatedDurationInMillis") public abstract Long getEstimatedDurtionInMillis()
      Specified by:
      getEstimatedDurtionInMillis in interface BlueItemRun
      Returns:
      Estimated Build duration in milli seconds
    • getStateObj

      @Exported(name="state") public abstract BlueRun.BlueRunState getStateObj()
      Specified by:
      getStateObj in interface BlueItemRun
      Returns:
      The state of the run
    • getResult

      @Exported(name="result") public abstract BlueRun.BlueRunResult getResult()
      Specified by:
      getResult in interface BlueItemRun
      Returns:
      The result state of the job (e.g unstable)
    • getRunSummary

      @Exported(name="runSummary") public abstract String getRunSummary()
      Specified by:
      getRunSummary in interface BlueItemRun
      Returns:
      Build summary
    • getType

      @Exported(name="type") public abstract String getType()
      Specified by:
      getType in interface BlueItemRun
      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 interface BlueItemRun
      Returns:
      Uri of artifacts zip file.
    • getArtifacts

      @Navigable public abstract BlueArtifactContainer getArtifacts()
      Specified by:
      getArtifacts in interface BlueItemRun
      Returns:
      Run artifacts
    • getNodes

      public abstract BluePipelineNodeContainer getNodes()
      Returns:
      Serves .../runs/{rundId}/nodes/ and provides pipeline execution nodes
      See Also:
    • getActions

      @Navigable @Exported(name="actions", inline=true) public abstract Collection<BlueActionProxy> getActions()
      Specified by:
      getActions in interface BlueItemRun
      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 interface BlueItemRun
      Returns:
      Gives tests in this run
    • getTestSummary

      @Deprecated public abstract BlueTestSummary getTestSummary()
      Deprecated.
      Specified by:
      getTestSummary in interface BlueItemRun
      Returns:
      Gives the test summary for this run
    • getBlueTestSummary

      @Navigable public abstract BlueTestSummary getBlueTestSummary()
    • getLog

      @Navigable public abstract Object getLog()
      Specified by:
      getLog in interface BlueItemRun
      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 interface BlueItemRun
      Returns:
      cause of the run being created
    • getCauseOfBlockage

      @Exported(name="causeOfBlockage") public abstract String getCauseOfBlockage()
      Specified by:
      getCauseOfBlockage in interface BlueItemRun
      Returns:
      cause of what is blocking this run
    • isReplayable

      @Exported(name="replayable") public abstract boolean isReplayable()
      Specified by:
      isReplayable in interface BlueItemRun
      Returns:
      if the run will allow a replay