def addProject(fname): data = dataformat.yamlFileToBaseData(fname) data['key'] = key # print(data) url = base_url + "/project/add" r = requests.post(url, json.dumps(data)) print(r.text)
def addMachine(fname): ''' 添加机器: :param fname: fname--文件名,add_data目录下的machinedata.yaml文件名 :return: ''' data = dataformat.yamlFileToBaseData(fname) data['key'] = key # print(data) url = base_url + "/machine/add" r = requests.post(url, json.dumps(data)) print(r.text)
def editMachine(fname): data = dataformat.yamlFileToBaseData(fname) data['key'] = key url = base_url + "/machine/edit" r = requests.post(url, json.dumps(data)) print(r.text)