Jenkins API

165 views
Skip to first unread message

Andrew Sumner

unread,
Mar 6, 2014, 3:01:04 PM3/6/14
to jenkins...@googlegroups.com
Couple of questions:

1. Where can I find a list of functions I can call?

    eg I found toggleOffline while searching the internet, I don't think its strictly an api method, but where can I find documentation for this and other methods?

2. Having a problem authenticating with Jenkins using vbscript, how do I do this?  I've tried many different ways but nothing I tried worked.

    url = "http://jenkins/<node name>/toggleOffline?offlineMessage=Rebooting"

    With CreateObject("MSXML2.XMLHTTP")
        .open "GET", url, False
        .send
       
        responseText = .responseText
        statusText = .statusText
        status = .status
    End With

    If status <> 200 Then
        ' Call not successful - quit
        WScript.Echo("Status: " & status & " - " & statusText)
        WScript.Echo(responseText)
        WScript.Quit(2)
    End If
   
    WScript.Echo("Response: " & responseText)

JonathanRRogers

unread,
Mar 7, 2014, 11:12:18 AM3/7/14
to jenkins...@googlegroups.com
On Thursday, March 6, 2014 3:01:04 PM UTC-5, Andrew Sumner wrote:
Couple of questions:

1. Where can I find a list of functions I can call?

    eg I found toggleOffline while searching the internet, I don't think its strictly an api method, but where can I find documentation for this and other methods?

Every page of Jenkins has  a link called "REST API" near the bottom right corner. This leads to a page with specific instructions and also a link to the overall documentation:

<URL:http://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API>

Eric Pyle

unread,
Mar 7, 2014, 12:55:58 PM3/7/14
to jenkins...@googlegroups.com
Re: 1 - see http://jenkins-ci.361315.n4.nabble.com/quot-wipe-out-current-workspace-quot-via-REST-API-td4687766.html for suggestions on how to find the most useful functions.

Re: 2 - The comments on the Jenkins wiki page mentioned by Robin Rosenberg contain several examples of Python code to handle authentication. I don't have experience using VbScript but I imagine you could do it there, too.

Regards,
Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages