def putfile(): local_path = request.args.get("local", "") dest_path = request.args.get("dest", "") payload = {"op": "CREATE"} response = webclient.sendrequest(path=dest_path, params=payload) datanode =response.headers["Location"] file = open(local_path).read() response = requests.put(datanode, file=file) return response.text
def getfile(path): payload = {"op": "OPEN"} response = webclient.sendrequest(path=path, params=payload) return 'ok'
def mkdir(path): payload = {'op': 'MKDIRS'} webclient.sendrequest(path=path, params=payload)
def ls(path): payload = {'op': 'LISTSTATUS'} webclient.sendrequest(path=path, params=payload)