2012-02-15 4 views
4

私はfreeStyleProjectからXML応答を消費するためにJenkins(Hudson)Remote APIを使用しようとしています。Jenkins Remote APIでtreePropertyを使用してdownstreamProjectとパラメータを取得する方法は?

Jenkins documentationhereのツリークエリパラメータについて調べてみましたが、これを使用して応答時間を改善し、XML応答を取得しようとしています。しかし、ジェンキンスは、ジョブのノードdownstreamProjectとアクションを生成することができないようだ/のパラメータは、このURLを構築します。

http://localhost/job/MyJob/api/xml?depth=2&tree=name,description,builds[アクション[パラメータ[名前、値]]番号、URL、タイムスタンプ、結果] 、healthReport [スコア、説明]、downstreamProject [名前、URL]

私はちょうどこの応答XMLを取得:

<freeStyleProject> 
    <description>Description</description> 
    <name>MyJob</name> 
    <build> 
     <number>2</number> 
     <result>SUCCESS</result> 
     <timestamp>1325784290000</timestamp> 
     <url>http://localhost/job/MyJob/2/</url> 
    </build> 
    <build> 
     <number>1</number> 
     <result>SUCCESS</result> 
     <timestamp>1323931754000</timestamp> 
     <url>http://localhost/job/MyJob/1/</url> 
    </build> 
    <healthReport> 
     <description>Build stability: No recent builds failed.</description> 
     <score>100</score> 
    </healthReport> 
</freeStyleProject> 

はおそらく木クエリパラメータには、これらをサポートしていませんか?このノードをxpathとexludeクエリパラメータを使用して取得する唯一の方法はありますか?

答えて

10

"tree"パ​​ラメータの場合、探している部分は複数形(ここでは特異点があります)です。

アクション=>アクション

パラメータ=>パラメータ

downstreamProject => downstreamProjects

だから、あなたのURLは次のようになります。

ます。http:// localhostの/仕事/ MYJOB/API/xml?depth = 2 & tree =名前、説明、ビルド[actions [parameters [name、value]]、number、url、timestamp、result]、healthReport [score、description]、downstreamProjects [name、url]

関連する問題