2016-09-05 28 views
2

我正在寫一個自動使用C#,將允許用戶安裝工具爲特定項目的所有竹計劃:你如何使用竹REST API

  • 首先選擇一個竹子項目
  • 選擇一個Bamboo項目後,該項目下的Bamboo Plans將出現。

我曾經嘗試這樣做 - http://bamboo_host:8085/rest/api/latest/project/TC621/plans

<project expand="plans" key="TC621" name="TruCare 6.2.1"> 
    <link href="http://bamboo_host.com:8085/rest/api/latest/project/TC621" rel="self"/> 
<plans start-index="0" max-result="12" size="12"/> 
</project> 

但它不給我我需要的信息。我可以得到的最接近的是使用這個 - http://bamboo_host.com:8085/rest/api/latest/project?expand=projects.project.plans.plan

這給了我所有的項目,然後所有的計劃。有沒有辦法在URI中傳遞項目名稱來列出這個項目的計劃?

感謝 埃裏克

回答

1

根據Bamboo REST API documentation你應該使用擴大參數。例如

http://localhost:9087/bamboo/rest/api/1.0/project/TC621?expand=plans 
http://localhost:9087/bamboo/rest/api/1.0/project/TC621?expand=plans.plan 
+0

這很好。謝謝! – Eric27710