Package io.jenkins.blueocean.rest.model
Class BluePipeline
- java.lang.Object
-
- io.jenkins.blueocean.rest.model.Resource
-
- io.jenkins.blueocean.rest.model.BluePipeline
-
- All Implemented Interfaces:
BlueManagedSource
,BluePipelineItem
,BlueRunnableItem
,Reachable
- Direct Known Subclasses:
BluePipelineFolder
public abstract class BluePipeline extends Resource implements BluePipelineItem, BlueRunnableItem, BlueManagedSource
Defines pipeline state and its routing- Author:
- Vivek Pandey
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACTIONS
static String
CONFIGURE_PERMISSION
configure pipeline permissionstatic String
CREATE_PERMISSION
Create pipelinestatic String
DISABLED
static String
DISPLAY_NAME
static String
ESTIMATED_DURATION
static String
FULL_DISPLAY_NAME
static String
FULL_NAME
static String
LATEST_RUN
static String
NAME
static String
ORGANIZATION
static String
PERMISSIONS
static String
READ_PERMISSION
Read pipeline permissionstatic String
START_PERMISSION
start pipeline runstatic String
STOP_PERMISSION
stop pipeline runstatic String
WEATHER_SCORE
-
Constructor Summary
Constructors Constructor Description BluePipeline()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
disable()
abstract void
enable()
abstract BlueFavorite
favorite(BlueFavoriteAction favoriteAction)
abstract Collection<BlueActionProxy>
getActions()
abstract Boolean
getDisabled()
abstract String
getDisplayName()
abstract Long
getEstimatedDurationInMillis()
abstract String
getFullDisplayName()
abstract String
getFullName()
abstract BlueRun
getLatestRun()
abstract String
getName()
abstract BlueOrganization
getOrganization()
abstract String
getOrganizationName()
abstract List<Object>
getParameters()
List of build parametersabstract Map<String,Boolean>
getPermissions()
Gives permissions of user in context for a given pipeline.abstract BlueQueueContainer
getQueue()
abstract BlueRunContainer
getRuns()
abstract BluePipelineScm
getScm()
abstract BlueTrendContainer
getTrends()
abstract Integer
getWeatherScore()
-
-
-
Field Detail
-
ORGANIZATION
public static final String ORGANIZATION
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
DISPLAY_NAME
public static final String DISPLAY_NAME
- See Also:
- Constant Field Values
-
FULL_NAME
public static final String FULL_NAME
- See Also:
- Constant Field Values
-
FULL_DISPLAY_NAME
public static final String FULL_DISPLAY_NAME
- See Also:
- Constant Field Values
-
WEATHER_SCORE
public static final String WEATHER_SCORE
- See Also:
- Constant Field Values
-
LATEST_RUN
public static final String LATEST_RUN
- See Also:
- Constant Field Values
-
ESTIMATED_DURATION
public static final String ESTIMATED_DURATION
- See Also:
- Constant Field Values
-
ACTIONS
public static final String ACTIONS
- See Also:
- Constant Field Values
-
PERMISSIONS
public static final String PERMISSIONS
- See Also:
- Constant Field Values
-
DISABLED
public static final String DISABLED
- See Also:
- Constant Field Values
-
CREATE_PERMISSION
public static final String CREATE_PERMISSION
Create pipeline- See Also:
- Constant Field Values
-
READ_PERMISSION
public static final String READ_PERMISSION
Read pipeline permission- See Also:
- Constant Field Values
-
START_PERMISSION
public static final String START_PERMISSION
start pipeline run- See Also:
- Constant Field Values
-
STOP_PERMISSION
public static final String STOP_PERMISSION
stop pipeline run- See Also:
- Constant Field Values
-
CONFIGURE_PERMISSION
public static final String CONFIGURE_PERMISSION
configure pipeline permission- See Also:
- Constant Field Values
-
-
Method Detail
-
getOrganization
@NonNull public abstract BlueOrganization getOrganization()
- Specified by:
getOrganization
in interfaceBluePipelineItem
- Returns:
- the organization that this pipeline is a child of
-
getOrganizationName
@Exported(name="organization") public abstract String getOrganizationName()
- Specified by:
getOrganizationName
in interfaceBluePipelineItem
- Returns:
- name of the organization
-
getName
@Exported(name="name") public abstract String getName()
- Specified by:
getName
in interfaceBluePipelineItem
- Returns:
- name of the pipeline
-
getDisplayName
@Exported(name="displayName") public abstract String getDisplayName()
- Specified by:
getDisplayName
in interfaceBluePipelineItem
- Returns:
- human readable name of this pipeline
-
getFullName
@Exported(name="fullName") public abstract String getFullName()
- Specified by:
getFullName
in interfaceBluePipelineItem
- Returns:
- Includes parent folders names if any. For example folder1/folder2/p1
-
getFullDisplayName
@Exported(name="fullDisplayName") public abstract String getFullDisplayName()
- Specified by:
getFullDisplayName
in interfaceBluePipelineItem
- Returns:
- Includes display names of parent folders if any. For example folder1/myFolder2/p1
-
getWeatherScore
@Exported(name="weatherScore") public abstract Integer getWeatherScore()
- Specified by:
getWeatherScore
in interfaceBlueRunnableItem
- Returns:
- weather health score percentile
-
getLatestRun
@Exported(name="latestRun", inline=true) public abstract BlueRun getLatestRun()
- Specified by:
getLatestRun
in interfaceBlueRunnableItem
- Returns:
- The Latest Run for the branch
-
getDisabled
@Exported(name="disabled", inline=true) public abstract Boolean getDisabled()
- Returns:
- If the pipeline is disabled or not
-
getEstimatedDurationInMillis
@Exported(name="estimatedDurationInMillis") public abstract Long getEstimatedDurationInMillis()
- Specified by:
getEstimatedDurationInMillis
in interfaceBlueRunnableItem
- Returns:
- Estimated duration based on last pipeline runs. -1 is returned if there is no estimate available.
-
getRuns
@Navigable @CheckForNull public abstract BlueRunContainer getRuns()
- Specified by:
getRuns
in interfaceBlueRunnableItem
- Returns:
- Gives Runs in this pipeline
-
getActions
@Navigable @Exported(name="actions", inline=true) public abstract Collection<BlueActionProxy> getActions()
- Specified by:
getActions
in interfaceBluePipelineItem
- Returns:
- Gives Actions associated with this Run
-
getQueue
@Navigable public abstract BlueQueueContainer getQueue()
- Specified by:
getQueue
in interfaceBlueRunnableItem
- Returns:
- Gives
BlueQueueContainer
-
getParameters
@Exported(name="parameters", inline=true) public abstract List<Object> getParameters()
List of build parameters- Specified by:
getParameters
in interfaceBlueRunnableItem
-
favorite
@PUT @WebMethod(name="favorite") public abstract BlueFavorite favorite(@JsonBody BlueFavoriteAction favoriteAction)
-
enable
@PUT @WebMethod(name="enable") public abstract void enable() throws IOException
- Throws:
IOException
-
disable
@PUT @WebMethod(name="disable") public abstract void disable() throws IOException
- Throws:
IOException
-
getPermissions
@Exported(name="permissions") public abstract Map<String,Boolean> getPermissions()
Gives permissions of user in context for a given pipeline. Following permissions are returned as key to the permission map: create, start, stop, read for a pipeline job:create: User can create a pipeline
start: User can start a run of this pipeline. If not applicable to certain pipeline then can be false or null.
stop: User can stop a run of this pipeline. If not applicable to certain pipeline then can be false or null.
read: User has permission to view this pipeline
For example for anonymous user with security enabled and only read permission, the permission map for a pipeline job is:
"permissions":{ "start": false, "stop": false, "create":false, "read": true }
Implementation of BluePipeline can provide their own set of permissions in addition to the ones defined- Returns:
- permission map
-
getScm
public abstract BluePipelineScm getScm()
- Specified by:
getScm
in interfaceBlueManagedSource
- Returns:
- Gives scm resource attached to this pipeline
-
getTrends
@Navigable public abstract BlueTrendContainer getTrends()
- Specified by:
getTrends
in interfaceBlueRunnableItem
- Returns:
- trend data related to this pipeline
-
-