2015-08-20 25 views

回答

1

對於數組類型的屬性,支持範圍說明符。例如,tree = jobs [name] {0,10}將檢索前10個作業的名稱。範圍指定單元有以下變種:

{M,N}: From the M-th element (inclusive) to the N-th element (exclusive). 
{M,}: From the M-th element (inclusive) to the end. 
{,N}: From the first element (inclusive) to the N-th element (exclusive). The same as {0,N}. 
{N}: Just retrieve the N-th element. The same as {N,N+1}. 

[以上爲正常 被盜 從借來的內置詹金斯文檔在$ {JENKINS_URL}/API]

你想實現可以做到這什麼方法:

爲M在{10,20,30}: 打開瀏覽器鏈接(http://example.jenkins.com/job/someJob/api/json/parameters?pretty=true&tree=builds[number,result,building,actions[parameters[*]]]{M,}

注意BUILD_NUMBER有一點做與此查詢。它會計算現有的構建日誌,所以如果你有某種日誌循環機制 - 你不能指望build_number。

+0

對不起,這不是我要求的。我的興趣是具體編號。 構建的數量正在發生變化,我希望從特定的數字中獲得所有構建,例如: 有200個構建中最小的是1500,較大的是1700.我需要從構建1658中獲得所有構建 – soninob

+0

你的問題確切地問我回答了什麼。查詢{(total_builds_currently present - latest_build_number + desired_build_number),} – Zloj

+0

請記住,我正在尋找一個電話來獲取此數據,這意味着我沒有數字1500,1700,200在手邊,只有1658。你是否仍然認爲它可以用你的答案完成? – soninob

相關問題