Groups
Groups
Sign in
Groups
Groups
アーカイブされた日本 Jenkins ユーザー グループ
Conversations
About
Send feedback
Help
リモートアクセスAPIで実行したジョブ番号を取得したい
833 views
Skip to first unread message
tarchan
unread,
Mar 22, 2013, 5:31:52 AM
3/22/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkin...@googlegroups.com
こんにちは、tarchanです。
いまアプリケーションからリモートアクセスAPIを使ってジョブを実行して、実行したジョブの成功/失敗を確認したいと考えています。
http://server/jenkins/job/MyJob/buildWithParameters
にHttpClientでGETしてジョブを実行するところまでは出来ました。
ただこのGETリクエストのレスポンスを見てもジョブ番号が何番なのかわかりませんでした。
http://server/jenkins/job/MyJob/lastBuild/api/xml
にアクセスすると最新のジョブ番号はわかるのですが、同時にいくつかのリクエストが発生すると自分のジョブ番号ではない場合があります。
リモートアクセスAPIで実行したジョブを特定する方法はありませんか?
よろしくお願いします。
Seiji Sogabe
unread,
Mar 22, 2013, 6:17:31 AM
3/22/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkin...@googlegroups.com
曽我部です。
同様のリクエストが、[JENKINS-12827] api should return the build number that was
queued. [1]に
ありますので、voteすれば誰かが実装してくれるかも。
[1]
https://issues.jenkins-ci.org/browse/JENKINS-12827
回避策として、自分が起動したビルドかどうか判断できればいいのであれば、
http://jenkins/job/xxx/api/xml?depth=1
にアクセスすると、
<build>
<action>
<cause>
<shortDescription>ユーザーSeiji Sogabeが実行</shortDescription>
<userId>sogabe</userId>
<userName>Seiji Sogabe</userName>
</cause>
</action>
のように、起動したユーザのIDを<userId>で取得できますので、
判断できると思います。
でわ。
2013年3月22日 18:31 tarchan <
tar...@gmail.com
>:
> --
> このメールは Google グループのグループ「日本Jenkinsユーザー会」の登録者に送られています。
> このグループから退会し、メールの受信を停止するには、
jenkinsci-ja...@googlegroups.com
> にメールを送信します。
> その他のオプションについては、
https://groups.google.com/groups/opt_out
にアクセスしてください。
>
>
--
s.sogabe at
gmail.com
tarchan
unread,
Mar 22, 2013, 7:10:55 AM
3/22/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkin...@googlegroups.com
tarchanです。
曽我部さん、ありがとうございます。
アカウントを作ってvoteしてきました。
「自分」という言い方はあいまいでしたね。
ジョブを実行したリクエスト自身のジョブ番号という意識でした。
現状APIは無いようなので、GETしたレスポンスから「updateBuildHistory("/jenkins/job/MyJob/buildHistory/ajax",XX)」という文字列を検索して特定するようにしました。
ありがとうございました。
2013年3月22日金曜日 19時17分31秒 UTC+9 sogabe:
> このグループから退会し、メールの受信を停止するには、
jenkinsci-ja+unsubscribe@googlegroups.com
Reply all
Reply to author
Forward
0 new messages