This repository was archived by the owner on Aug 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -105,3 +105,13 @@ def list_logs(job_id, api_key=None):
105105 logs_api = client .API (config .CONFIG_LOG_HOST , api_key = api_key )
106106 command = jobs_commands .JobLogsCommand (api = logs_api )
107107 command .execute (job_id )
108+
109+
110+ @jobs_group .command ("artifactsDestroy" , help = "Destroy job's artifacts" )
111+ @click .argument ("job_id" )
112+ @click .option ("--files" , "files" )
113+ @common .api_key_option
114+ def destroy_artifacts (job_id , api_key = None , files = None ):
115+ jobs_api = client .API (config .CONFIG_HOST , api_key = api_key )
116+ command = jobs_commands .ArtifactsDestroyCommand (api = jobs_api )
117+ command .execute (job_id , files = files )
Original file line number Diff line number Diff line change @@ -158,3 +158,13 @@ def execute(self, json_):
158158 self ._log_message (response ,
159159 "Job created" ,
160160 "Unknown error while creating job" )
161+
162+
163+ class ArtifactsDestroyCommand (JobsCommandBase ):
164+ def execute (self , job_id , files = None ):
165+ url = '/jobs/{}/artifactsDestroy' .format (job_id )
166+ params = None
167+ if files :
168+ params = {'files' : files }
169+ response = self .api .post (url , params = params )
170+ self ._log_message (response , "Artifacts destroyed" , "Unknown error while destroying artifacts" )
You can’t perform that action at this time.
0 commit comments