gitbeaker/src/services/Pipelines.js
2018-04-24 11:44:01 -04:00

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;