Use accept header in in /jobs/export request

This commit is contained in:
Greg Schueler 2014-01-16 16:05:52 -08:00
parent af37fd1f56
commit aba9f8de2b

View file

@ -542,11 +542,13 @@ public class RundeckClient implements Serializable {
throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException {
AssertUtil.notNull(format, "format is mandatory to export jobs !"); AssertUtil.notNull(format, "format is mandatory to export jobs !");
AssertUtil.notBlank(project, "project is mandatory to export jobs !"); AssertUtil.notBlank(project, "project is mandatory to export jobs !");
return new ApiCall(this).get(new ApiPathBuilder("/jobs/export").param("format", format) return new ApiCall(this).get(new ApiPathBuilder("/jobs/export")
.param("project", project) .accept(format == FileType.XML ? "text/xml" : "text/yaml")
.param("jobFilter", jobFilter) .param("format", format)
.param("groupPath", groupPath) .param("project", project)
.param("idlist", StringUtils.join(jobIds, ","))); .param("jobFilter", jobFilter)
.param("groupPath", groupPath)
.param("idlist", StringUtils.join(jobIds, ",")));
} }
/** /**