"wipe out current workspace" via REST API?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"wipe out current workspace" via REST API?

Craig Rodrigues
Hi,

Is it possible to trigger "wipe out current workspace"
from the REST API?  I didn't see an obvious way to do it
after reading https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

Thanks.
--
Craig


--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "wipe out current workspace" via REST API?

Daniel Beck
What's wrong with /job/jobname/doWipeOutWorkspace ?

On 20.01.2014, at 19:48, Craig Rodrigues <[hidden email]> wrote:

> Hi,
>
> Is it possible to trigger "wipe out current workspace"
> from the REST API?  I didn't see an obvious way to do it
> after reading https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
>
> Thanks.
> --
> Craig
>
>
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "wipe out current workspace" via REST API?

Craig Rodrigues
Hi,

Thanks, that worked great!
After you mentioned this, I realized that I could look at the source
code to the Jenkins web page to find functions like "doWipeOutWorkspace".

Are functions like this documented somewhere in the Jenkins docs online?
--
Craig


On Mon, Jan 20, 2014 at 11:17 AM, Daniel Beck <[hidden email]> wrote:
What's wrong with /job/jobname/doWipeOutWorkspace ?

On 20.01.2014, at 19:48, Craig Rodrigues <[hidden email]> wrote:

> Hi,
>
> Is it possible to trigger "wipe out current workspace"
> from the REST API?  I didn't see an obvious way to do it
> after reading https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
>
> Thanks.
> --
> Craig
>
>
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "wipe out current workspace" via REST API?

Daniel Beck
Not as a 'look, here's everything you can use like an API'. I've looked at the Javadoc, sources, or the web UI to find these in the past.

Javadoc/sources example: You want to perform an action on a freestyle project.
Go to javadoc.jenkins-ci.org and look for "freestyle", and you'll find e.g.: http://javadoc.jenkins-ci.org/hudson/model/FreeStyleProject.html (which is also a nice introduction to the class hierarchy in Jenkins -- I've found most of what I searched when starting with the classes Jenkins, Run, or Job)

Search for methods whose names start with 'do' that seem to do what you want. Find doDoWipeOutWorkspace.
One 'do' is convention for these kinds of methods. The second 'do' is from the URL:
/job/foo/bar ---> FoosType.doBar
/job/foo/doBar ---> FoosType.doDoBar

Of course, some methods only work with POST, or require specific parameters, or have useless return values for an API (like HTTP redirects). This you'll need to experiment with, or read the sources.

On 20.01.2014, at 23:02, Craig Rodrigues <[hidden email]> wrote:

> Hi,
>
> Thanks, that worked great!
> After you mentioned this, I realized that I could look at the source
> code to the Jenkins web page to find functions like "doWipeOutWorkspace".
>
> Are functions like this documented somewhere in the Jenkins docs online?
> --
> Craig
>
>
> On Mon, Jan 20, 2014 at 11:17 AM, Daniel Beck <[hidden email]> wrote:
> What's wrong with /job/jobname/doWipeOutWorkspace ?
>
> On 20.01.2014, at 19:48, Craig Rodrigues <[hidden email]> wrote:
>
> > Hi,
> >
> > Is it possible to trigger "wipe out current workspace"
> > from the REST API?  I didn't see an obvious way to do it
> > after reading https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API
> >
> > Thanks.
> > --
> > Craig
> >
> >
> >
> > --
> > 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 [hidden email].
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "wipe out current workspace" via REST API?

pelos
This post has NOT been accepted by the mailing list yet.
when i got to the website
/job/doWipeOutWorkspace
i do get the message:
POST is required for hudson.model.AbstractProject.doDoWipeOutWorkspace

so i went to http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html

how can i use all those methods?
if i go to a url like
/job/enable  i do get the message again that i can use post and say that needs the
doEnable,

but not all the methods have that message that can be use in post,  for example: isBuildBlocked
i was expecting to go to the  url  /job/isBuildBlocked and get the same message that saying trying to use post and will say something like needs Abstract doisBuildBlocked in post...  =(

how can i tell witch methods do work via url / rest?

thanks guys =)
Loading...