如何使用 Bamboo REST 获取特定项目的所有 Bamboo 计划 API
How do you get all Bamboo plans for a specific project using the Bamboo REST API
我正在使用 C# 编写一个自动安装工具,它允许用户:
- 首先 select 一个 Bamboo 项目
- select创建一个 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 中传递项目名称以仅列出该项目的计划?
谢谢
埃里克
根据 Bamboo REST API documentation 你应该使用 expand 参数。例如
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
我正在使用 C# 编写一个自动安装工具,它允许用户:
- 首先 select 一个 Bamboo 项目
- select创建一个 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 中传递项目名称以仅列出该项目的计划?
谢谢 埃里克
根据 Bamboo REST API documentation 你应该使用 expand 参数。例如
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