def move(req): param = json.loads(req.body) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = DSt(src) d = DSt(dst) ecode = s.move(d) return Response(status = ecode)
def http_dir_move(): req = request param = json.loads(req.data) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = DSt(src) d = DSt(dst) ecode = s.move(d) return Response(status=ecode)
def http_dir_move(): req = request param = json.loads(req.data) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = DSt(src) d = DSt(dst) ecode = s.move(d) return Response(status = ecode)
def copy(req): param = json.loads(req.body) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = FSt(src) d = FSt(dst) if not s.exists: return Response(status=404) ecode = s.copy(d) return Response(status = ecode)
def copy(): req = request param = json.loads(req.data) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = FSt(src) d = FSt(dst) if not s.exists: return Response(status=404) ecode = s.copy(d) return Response(status=ecode)
def move(): req = request param = json.loads(req.data) src = path2o(param.get('src')) dst = path2o(param.get('dst')) s = FSt(src) d = FSt(dst) if not s.exists: return Response(status=404) ecode = s.move(d) return Response(status=ecode)
def get(req): param = json.loads(req.body) path = path2o(param.get('path')) a = ASt(path) if not a.exists: return Response(status=404) attrs = a.list() attrs = [{'a':'b'},{'c':'d'}] return Response(body=json.dumps(attrs),status=200)
def put(req): param = json.loads(req.body) path = path2o(param.get('path')) a = ASt(path) if a.exists: return Response(status=409) ecode = a.put() return Response(status=ecode)
def get(req): param = json.loads(req.body) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) app_iter = s.get() response = Response(app_iter=app_iter,request=req) return req.get_response(response)
def post(req): param = json.loads(req.body) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status = 404) attrs = req.headers ecode = s.setm(attrs) return Response(status=ecode)
def http_dir_put(): req = request param = json.loads(req.data) path = path2o(param.get('path')) d = DSt(path) if d.exists: return Response(status=409) ecode = d.put() return Response(status=ecode)
def delete(req): param = json.loads(req.body) path = path2o(param.get('path')) c = CSt(path) if not c.exists: return Response(status=404) ecode = c.delete() return Response(status=ecode)
def put(req): param = req.headers path = path2o(param.get('path')) s = FSt(path) md5 = req.headers.get('md5') datatype = req.headers.get('datatype') fileinput = req.environ['wsgi.input'] ecode = s.put(md5,datatype,fileinput) return Response(status=ecode)
def delete(): req = request param = json.loads(req.data) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) ecode = s.delete() return Response(status=ecode)
def put(): req = request param = req.headers path = path2o(param.get('path')) s = FSt(path) md5 = req.headers.get('md5') datatype = req.headers.get('datatype') fileinput = req.environ['wsgi.input'] ecode = s.put(md5,datatype,fileinput,req.content_length) return Response(status=ecode)
def put(): req = request param = req.headers path = path2o(param.get('path')) s = FSt(path) md5 = req.headers.get('md5') datatype = req.headers.get('datatype') fileinput = req.environ['wsgi.input'] ecode = s.put(md5, datatype, fileinput, req.content_length) return Response(status=ecode)
def post(req): param = json.loads(req.body) path = path2o(param.get('path')) a = ASt(path) if not a.exists: return Response(status=404) headers = req.headers attrs = headers ecode = a.putm(attrs) return Response(status=ecode)
def post(): req = request param = json.loads(req.data) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) attrs = req.headers ecode = s.setm(attrs) return Response(status=ecode)
def http_container_delete(): req = request param = json.loads(req.data) path = path2o(param.get('path')) c = CSt(path) if not c.exists: return Response(status=404) ecode = c.delete() return Response(status=ecode)
def http_account_post(): req = request param = json.loads(req.data) path = path2o(param.get('path')) a = ASt(path) if not a.exists: return Response(status=404) headers = req.headers attrs = headers ecode = a.putm(attrs) return Response(status=ecode)
def get(): req = request param = json.loads(req.data) path = path2o(param.get('path')) s = FSt(path) if not s.exists: return Response(status=404) app_iter = s.get() response = Response(response=app_iter) # return req.get_response(response) return response
def delete(req): param = json.loads(req.body) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False d = DSt(path) ecode = d.delete(r) return Response(status = ecode)
def http_dir_delete(): req = request param = json.loads(req.data) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False d = DSt(path) ecode = d.delete(r) return Response(status = ecode)
def http_dir_delete(): req = request param = json.loads(req.data) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False d = DSt(path) ecode = d.delete(r) return Response(status=ecode)
def head(req): param = json.loads(req.body) path = path2o(param.get('path')) is_swift = param.get('is_swift') s = FSt(path) ecode = 200 if not s.exists: ecode = 404 return Response(ecode) data = s.getm() if 'true' == is_swift: return Response(status=ecode,headers=data) else: return Response(json.dumps(data),status=ecode)
def head(req): param = json.loads(req.body) path = path2o(param.get('path')) is_swift = param.get('is_swift') a = ASt(path) if not a.exists: return Response(status=404) attrs = a.getm() if 'true' == is_swift: return Response(status=200,headers=attrs) else: return Response(body=json.dumps(attrs),status=200)
def http_account_get(): try: uid = os.getuid() user = getpass.getuser() req = request param = json.loads(req.data) path = path2o(param.get('path')) a = ASt(path) if not a.exists: return Response(response=a.path, status=404) attrs = a.list() return Response(response=json.dumps(attrs), status=200) except: msg = str(user + str(uid) + traceback.format_exc()) syslog.syslog(syslog.LOG_ERR, msg) return 'account exception'
def http_account_put(): try: req = request param = json.loads(req.data) path = path2o(param.get('path')) a = ASt(path) if a.exists: return Response(status=409) ecode = a.put() return Response(status=ecode) except: msg = getpass.getuser() + str(traceback.format_exc()) syslog.syslog(syslog.LOG_ERR, msg) return 'account exception'
def http_account_get(): try: uid = os.getuid() user = getpass.getuser() req = request param = json.loads(req.data) path = path2o(param.get('path')) a = ASt(path) if not a.exists: return Response(response=a.path,status=404) attrs = a.list() return Response(response=json.dumps(attrs),status=200) except: msg = str(user+str(uid)+traceback.format_exc()) syslog.syslog(syslog.LOG_ERR,msg) return 'account exception'
def get(req): param = json.loads(req.body) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False c = CSt(path) if not c.exists: return Response(status=404) attrs = c.list(r) return Response(body = json.dumps(attrs),status=200)
def http_account_put(): try: req = request param = json.loads(req.data) path = path2o(param.get('path')) a = ASt(path) if a.exists: return Response(status=409) ecode = a.put() return Response(status=ecode) except: msg = getpass.getuser()+str(traceback.format_exc()) syslog.syslog(syslog.LOG_ERR,msg) return 'account exception'
def head(): req = request param = json.loads(req.data) path = path2o(param.get('path')) is_swift = param.get('is_swift') s = FSt(path) ecode = 200 if not s.exists: ecode = 404 return Response(ecode) data = s.getm() if 'true' == is_swift: return Response(status=ecode, headers=data) else: return Response(response=json.dumps(data), status=ecode)
def http_container_post(): req = request param = json.loads(req.data) path = path2o(param.get('path')) c = CSt(path) if not c.exists: return Response(status=404) headers = req.headers attrs = headers ecode = c.putm(attrs) return Response(status = ecode)
def http_container_head(): req = request param = json.loads(req.data) path = path2o(param.get('path')) is_swift = param.get('is_swift') c = CSt(path) if not c.exists: return Response(status=404) attrs = c.getm() if 'true' == is_swift: return Response(status=200,headers=attrs) else: return Response(response = json.dumps(attrs),status=200)
def get(req): param = json.loads(req.body) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False d = DSt(path) if not d.exists: return Response(status=404) if not os.path.isdir(d.path): return Response(body = 'path type error',status=400) attrs = d.list(r) return Response(body = json.dumps(attrs),status=200)
def http_container_get(): req = request param = json.loads(req.data) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False c = CSt(path) if not c.exists: return Response(status=404) attrs = c.list(r) return Response(response = json.dumps(attrs),status=200)
def http_dir_get(): req = request param = json.loads(req.data) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False d = DSt(path) if not d.exists: return Response(status=404) if not os.path.isdir(d.path): return Response(response='path type error', status=400) attrs = d.list(r) return Response(response=json.dumps(attrs), status=200)
def http_dir_get(): req = request param = json.loads(req.data) path = path2o(param.get('path')) tree = param.get('tree') if 'true' == tree: r = True else: r = False d = DSt(path) if not d.exists: return Response(status=404) if not os.path.isdir(d.path): return Response(response = 'path type error',status=400) attrs = d.list(r) return Response(response = json.dumps(attrs),status=200)