Commit 0028f476 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'add-job-commands'

31fb1336 add jobs apis
Acked-by: Kitware Robot's avatarKitware Robot <>
Acked-by: Ben Boeckel's avatarBen Boeckel <>
Merge-request: !213
parents ddb2c675 31fb1336
......@@ -1571,6 +1571,38 @@ impl Gitlab {
/// Get a list of jobs for a pipeline.
pub fn pipeline_jobs<I, K, V>(
project: ProjectId,
pipeline_id: PipelineId,
params: I,
) -> GitlabResult<Vec<Job>>
I: IntoIterator,
I::Item: Borrow<(K, V)>,
K: AsRef<str>,
V: AsRef<str>,
format!("projects/{}/pipelines/{}/jobs", project, pipeline_id),
/// Get a log for a specific job of a project.
pub fn job_log(&self, project: ProjectId, job_id: JobId) -> GitlabResult<Vec<u8>> {
let full_url = self.create_url(format!("projects/{}/jobs/{}/trace", project, job_id))?;
let req = self.client.get(full_url);
let rsp = self.send_impl(req)?;
let status = rsp.status();
if !status.is_success() {
let v = serde_json::from_reader(rsp).map_err(GitlabError::json)?;
return Err(GitlabError::from_gitlab(v));
/// Get merge requests.
pub fn merge_request<I, K, V>(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment