How to omit artifacts from json api -
i using jenkins ver. 1.629, , using json api read statistics our builds.
http://jenkins/job/myproject/25/api/json
this call behaves correctly, however, since artifacts of build has lot of files, returned json has large array artifacts. difference 6.8mb artifacts, , 16kb without.
since not need know list of files in artifact, know how omit json result (on server).
note: don't want zip artifacts make list smaller have project relies on artifacts , needs them unzipped, not want zip , unzip unnecessarily.
the xml api has exclude
parameter, json api not have way exclude parts of response. however, if know names of parameters care in json result, can use tree
parameter limit response fields care about. example, can build information job (along little metadata) with:
http://jenkins/job/myproject/25/api/json?tree=name,url,builds[*]
and chances can further limit fields of build array, see list of jobs longest build time.
providing limits in query (instead using exclude) allows jenkins server save processing since doesn't need build whole 6mb response. there more details in built-in api description: http://jenkins/job/myproject/25/api
.
Comments
Post a Comment