Search in sources :

Example 6 with Job

use of org.gitlab4j.api.models.Job in project choerodon-starters by open-hand.

the class JobApi method playJob.

/**
 * Play specified job in a project.
 * <p>
 * POST /projects/:id/jobs/:job_id/play
 *
 * @param projectId the project ID to play specified job
 * @param jobId     the ID to play job
 * @return job instance which just played
 * @throws GitLabApiException if any exception occurs during execution
 */
public Job playJob(int projectId, int jobId) throws GitLabApiException {
    GitLabApiForm formData = null;
    Response response = post(Status.OK, formData, "projects", projectId, "jobs", jobId, "play");
    return (response.readEntity(Job.class));
}
Also used : Response(javax.ws.rs.core.Response) Job(org.gitlab4j.api.models.Job)

Example 7 with Job

use of org.gitlab4j.api.models.Job in project choerodon-starters by open-hand.

the class JobApi method cancleJob.

/**
 * Cancel specified job in a project.
 * <p>
 * POST /projects/:id/jobs/:job_id/cancel
 *
 * @param projectId the project ID to cancel specified job
 * @param jobId     the ID to cancel job
 * @return job instance which just canceled
 * @throws GitLabApiException if any exception occurs during execution
 */
public Job cancleJob(int projectId, int jobId) throws GitLabApiException {
    GitLabApiForm formData = null;
    Response response = post(Status.CREATED, formData, "projects", projectId, "jobs", jobId, "cancel");
    return (response.readEntity(Job.class));
}
Also used : Response(javax.ws.rs.core.Response) Job(org.gitlab4j.api.models.Job)

Example 8 with Job

use of org.gitlab4j.api.models.Job in project choerodon-starters by open-hand.

the class JobApi method retryJob.

/**
 * Retry specified job in a project.
 * <p>
 * POST /projects/:id/jobs/:job_id/retry
 *
 * @param projectId the project ID to retry speficied job
 * @param jobId     the ID to retry job
 * @return job instance which just retried
 * @throws GitLabApiException if any exception occurs during execution
 */
public Job retryJob(int projectId, int jobId) throws GitLabApiException {
    GitLabApiForm formData = null;
    Response response = post(Status.CREATED, formData, "projects", projectId, "jobs", jobId, "retry");
    return (response.readEntity(Job.class));
}
Also used : Response(javax.ws.rs.core.Response) Job(org.gitlab4j.api.models.Job)

Aggregations

Job (org.gitlab4j.api.models.Job)8 Response (javax.ws.rs.core.Response)6 PermissionException (com.hp.octane.integrations.exceptions.PermissionException)2 JunitTestResultsProvider (com.microfocus.octane.gitlab.testresults.JunitTestResultsProvider)2 GenericType (javax.ws.rs.core.GenericType)2 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)2 GitLabApiException (org.gitlab4j.api.GitLabApiException)2 CIPluginServices (com.hp.octane.integrations.CIPluginServices)1 OctaneConfiguration (com.hp.octane.integrations.OctaneConfiguration)1 DTOFactory (com.hp.octane.integrations.dto.DTOFactory)1 CIProxyConfiguration (com.hp.octane.integrations.dto.configuration.CIProxyConfiguration)1 CIBuildStatusInfo (com.hp.octane.integrations.dto.general.CIBuildStatusInfo)1 CIJobsList (com.hp.octane.integrations.dto.general.CIJobsList)1 CIPluginInfo (com.hp.octane.integrations.dto.general.CIPluginInfo)1 CIServerInfo (com.hp.octane.integrations.dto.general.CIServerInfo)1 CIParameter (com.hp.octane.integrations.dto.parameters.CIParameter)1 CIParameters (com.hp.octane.integrations.dto.parameters.CIParameters)1 PipelineNode (com.hp.octane.integrations.dto.pipelines.PipelineNode)1 CIBuildResult (com.hp.octane.integrations.dto.snapshots.CIBuildResult)1 CIBuildStatus (com.hp.octane.integrations.dto.snapshots.CIBuildStatus)1