def delete(opt, conf, username): """ Деактивируем телефон fs-api -c endpoint -a delete --phone <phone> """ url = "{2}://{0}{1}".format(conf.get(opt.section, 'host'),conf.get(opt.section, 'pref'),conf.get(opt.section, 'protocol')) con = Connection(url, username=conf.get(opt.section, 'user'), password=conf.get(opt.section, 'passwd'), path_cache=PATH_CACHE) res = con.delete('/endpoint/phone/{0}/'.format(opt.phone)) if res: print("Delete: {0}".format(res))
def delete(opt, conf, username): """ Удаляем аккаунт fs-api -c account -a delete -u <username> """ url = "{2}://{0}{1}".format( conf.get(opt.section, "host"), conf.get(opt.section, "pref"), conf.get(opt.section, "protocol") ) con = Connection( url, username=conf.get(opt.section, "user"), password=conf.get(opt.section, "passwd"), path_cache=PATH_CACHE ) res = con.delete("/account/{0}/".format(username)) if res: print("Delete: {0}".format(res))