public interface JobService
Modifier and Type | Method and Description |
---|---|
@NotNull ImmutableJob |
addJob(@NotNull PlanKey chainKey,
long stageId,
@NotNull String jobKey,
@NotNull String name,
@Nullable String description,
boolean suspended)
Add a job to an existing stage in the plan
|
@NotNull ImmutableJob |
cloneJob(@NotNull String sourceJobKey,
@NotNull PlanKey chainKey,
long stageId,
@NotNull String newJobKey,
@NotNull String name,
@Nullable String description,
boolean suspended)
Copy the given job and give the copy the key, name, description and suspended state provided.
|
void |
deleteJob(@NotNull PlanKey jobKey,
BambooClosures.Throwing1<ImmutableJob,WebValidationException>... runBefore)
Remove a job.
|
@NotNull ImmutableJob |
getJob(@NotNull PlanKey jobKey)
Get an individual job
|
@NotNull List<ImmutableJob> |
getJobsForPlan(@NotNull PlanKey planKey)
Get all jobs in a plan, ordered alphabetically
|
@NotNull List<ImmutableJob> |
getJobsForStage(@NotNull PlanKey planKey,
long stageId)
Get all jobs in a particular stage, ordered alphabetically
|
@NotNull ImmutableJob |
updateJob(@NotNull PlanKey jobKey,
@NotNull String name,
@Nullable String description,
boolean suspended,
long stageId,
BambooClosures.Throwing1<ImmutableJob,WebValidationException>... runBefore)
Update the details of a job
|
@NotNull ErrorCollection |
validateJobForAdd(@NotNull PlanKey chainKey,
long stageId,
@Nullable String jobKey,
@Nullable String name,
@Nullable String description,
boolean suspended)
Validates the parameters for adding a job.
|
@NotNull ErrorCollection |
validateJobForClone(@Nullable String sourceJobKey,
@NotNull PlanKey chainKey,
long stageId,
@Nullable String newJobKey,
@Nullable String name,
@Nullable String description,
@Nullable Boolean suspended)
Validates the parameters for cloning a job.
|
@NotNull ErrorCollection |
validateJobForUpdate(@NotNull PlanKey jobKey,
@NotNull String name,
@Nullable String description,
boolean suspended,
long stageId)
Validate editing of a job
|
@NotNull @NotNull List<ImmutableJob> getJobsForPlan(@NotNull @NotNull PlanKey planKey)
planKey
- of planNotFoundException
- if the plan does not exist@NotNull @NotNull List<ImmutableJob> getJobsForStage(@NotNull @NotNull PlanKey planKey, long stageId)
planKey
- of planstageId
- id of the stageNotFoundException
- if plan or stage does not exist@NotNull @NotNull ErrorCollection validateJobForAdd(@NotNull @NotNull PlanKey chainKey, long stageId, @Nullable @Nullable String jobKey, @Nullable @Nullable String name, @Nullable @Nullable String description, boolean suspended) throws WebValidationException
chainKey
- of the plan to add job to.stageId
- of the stage to add the job to.jobKey
- key of the job to add. May be full or partial job key.name
- name of the job to add.description
- description of the job.suspended
- sets the job's suspended status.NotFoundException
- if the plan or stage can't be foundWebValidationException
@NotNull @NotNull ImmutableJob getJob(@NotNull @NotNull PlanKey jobKey)
jobKey
- of the job to getNotFoundException
- if the job doesn't existorg.acegisecurity.AccessDeniedException
- if user has no WRITE access to the job@NotNull @NotNull ImmutableJob addJob(@NotNull @NotNull PlanKey chainKey, long stageId, @NotNull @NotNull String jobKey, @NotNull @NotNull String name, @Nullable @Nullable String description, boolean suspended) throws WebValidationException
chainKey
- of the plan to add the jobstageId
- of the stage to add the jobjobKey
- of the job to add. May be full or partial job key.name
- name of the jobdescription
- description of the jobsuspended
- sets the job suspended statusNotFoundException
- if the plan or stage can't be foundWebValidationException
@NotNull @NotNull ErrorCollection validateJobForClone(@Nullable @Nullable String sourceJobKey, @NotNull @NotNull PlanKey chainKey, long stageId, @Nullable @Nullable String newJobKey, @Nullable @Nullable String name, @Nullable @Nullable String description, @Nullable @Nullable Boolean suspended) throws WebValidationException
sourceJobKey
- key of the job to clone. Must be full job key.chainKey
- key of the plan to add the new job to.stageId
- id of the stage to add the new job to.newJobKey
- key of the new job. May be full or partial job key.name
- name of the new job.description
- description of the new job.suspended
- suspended state of the new job.WebValidationException
@NotNull @NotNull ImmutableJob cloneJob(@NotNull @NotNull String sourceJobKey, @NotNull @NotNull PlanKey chainKey, long stageId, @NotNull @NotNull String newJobKey, @NotNull @NotNull String name, @Nullable @Nullable String description, boolean suspended) throws WebValidationException
sourceJobKey
- key of the source job to copy. Must be full job key.chainKey
- of the plan to add the new job.stageId
- of the stage to add the new job.newJobKey
- key to give to the new job. May be full or partial job key.name
- The name of the cloned job.description
- The description of the cloned job.suspended
- The suspended state of the cloned job.WebValidationException
@NotNull @NotNull ErrorCollection validateJobForUpdate(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull String name, @Nullable @Nullable String description, boolean suspended, long stageId)
jobKey
- of the job to updatename
- new name of the jobdescription
- new description of the jobsuspended
- sets the job suspended statusNotFoundException
- if the job doesn't exist@NotNull @NotNull ImmutableJob updateJob(@NotNull @NotNull PlanKey jobKey, @NotNull @NotNull String name, @Nullable @Nullable String description, boolean suspended, long stageId, @NotNull BambooClosures.Throwing1<ImmutableJob,WebValidationException>... runBefore) throws WebValidationException
jobKey
- of the job to updatename
- new name of the jobdescription
- new description of the jobsuspended
- sets the job suspended statusstageId
- new stage for the jobrunBefore
- code to execute after security and validation has passed but before the update occurs.WebValidationException
void deleteJob(@NotNull @NotNull PlanKey jobKey, @NotNull BambooClosures.Throwing1<ImmutableJob,WebValidationException>... runBefore) throws WebValidationException
jobKey
- of jobrunBefore
- code to execute after security and validation has passed but before the deletion occurs.org.acegisecurity.AccessDeniedException
- when user has no ADMINISTRATION permission to the jobWebValidationException
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.