mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import { BaseService, RequestHelper } from '../infrastructure';
|
|
|
|
class Pipelines extends BaseService {
|
|
all(projectId, options = {}) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/pipelines`, options);
|
|
}
|
|
|
|
create(projectId, ref) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.post(this, `projects/${pId}/pipeline`, { ref });
|
|
}
|
|
|
|
show(projectId, pipelineId) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/pipelines/${pipelineId}`);
|
|
}
|
|
|
|
retry(projectId, pipelineId) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.post(this, `projects/${pId}/pipelines/${pipelineId}/retry`);
|
|
}
|
|
|
|
cancel(projectId, pipelineId) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.post(this, `projects/${pId}/pipelines/${pipelineId}/cancel`);
|
|
}
|
|
|
|
showJobs(projectId, pipelineId, options) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/pipelines/${pipelineId}/jobs`, options);
|
|
}
|
|
}
|
|
|
|
export default Pipelines;
|