In [ ]:
control=input()
In [ ]:
import getpass
password=getpass.getpass()
In [ ]:
# Delete Jobs
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # suppress warnings
# Figure out samples from the header of the input file
with open('inputdata_workshop.xls', 'r') as f: header = f.readline()
samples = list(set(map(lambda s: s[1:-1][:5],header.split("\t"))))
samples.remove('BLANK')
# Delete all of them
for s in samples:
url="https://admin:"+password+"@"+control+"/chronos/scheduler/job/cv-"+s.replace(".", "_")
response=requests.delete(url, verify=False)
print(s + " HTTP response code: " + str(response.status_code))