Adds support for wiping out a job's workspace
Support for wiping out a Jenkins job's workspace. Change-Id: I8daa4a6fe7976c90ca59c89bda775d83aff7b622 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
This commit is contained in:
parent
abe6df6d1d
commit
08f76f724d
@ -24,6 +24,7 @@ the things you can use it for:
|
||||
* Put server in shutdown mode (quiet down)
|
||||
* List running builds
|
||||
* Delete builds
|
||||
* Wipeout job workspace
|
||||
* Create/delete/update folders [#f1]_
|
||||
* Set the next build number [#f2]_
|
||||
* Install plugins
|
||||
|
@ -116,6 +116,7 @@ BUILD_WITH_PARAMS_JOB = '%(folder_url)sjob/%(short_name)s/buildWithParameters'
|
||||
BUILD_INFO = '%(folder_url)sjob/%(short_name)s/%(number)d/api/json?depth=%(depth)s'
|
||||
BUILD_CONSOLE_OUTPUT = '%(folder_url)sjob/%(short_name)s/%(number)d/consoleText'
|
||||
DELETE_BUILD = '%(folder_url)sjob/%(short_name)s/%(number)s/doDelete'
|
||||
WIPEOUT_JOB_WORKSPACE = '%(folder_url)sjob/%(short_name)s/doWipeOutWorkspace'
|
||||
NODE_LIST = 'computer/api/json'
|
||||
CREATE_NODE = 'computer/doCreateItem'
|
||||
DELETE_NODE = 'computer/%(name)s/doDelete'
|
||||
@ -1239,6 +1240,16 @@ class Jenkins(object):
|
||||
self.jenkins_open(requests.Request('POST',
|
||||
self._build_url(DELETE_BUILD, locals()), b''))
|
||||
|
||||
def wipeout_job_workspace(self, name):
|
||||
"""Wipe out workspace for given Jenkins job.
|
||||
|
||||
:param name: Name of Jenkins job, ``str``
|
||||
"""
|
||||
folder_url, short_name = self._get_job_folder(name)
|
||||
self.jenkins_open(requests.Request('POST',
|
||||
self._build_url(WIPEOUT_JOB_WORKSPACE,
|
||||
locals()), b''))
|
||||
|
||||
def get_running_builds(self):
|
||||
'''Return list of running builds.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user