Exemplo n.º 1
0
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
Exemplo n.º 2
0
def getfile(path):
    payload = {"op": "OPEN"}
    response = webclient.sendrequest(path=path, params=payload)
    return 'ok'
Exemplo n.º 3
0
def mkdir(path):
    payload = {'op': 'MKDIRS'}
    webclient.sendrequest(path=path, params=payload)
Exemplo n.º 4
0
def ls(path):
    payload = {'op': 'LISTSTATUS'}
    webclient.sendrequest(path=path, params=payload)