zhanghb
zhanghb
+1  ``` python 3.6 fastapi==0.60.1 uvicorn==0.11.3 ``` uvicorn main:app --host 0.0.0.0 --port 8101 --workers 4 docker:2 core 2GB memory,CentOS Linux release 7.8.2003 (Core) client call the function below per...
update: I add `async` before `def` and it worked refer: https://github.com/tiangolo/fastapi/issues/596#issuecomment-647704509 ``` @router.get('/tsp/crontab') def tsp_crontab_schedule(topic: schemas.AgentPushParamsEnum..) pass ``` to ``` @router.get('/tsp/crontab') async def tsp_crontab_schedule(topic: schemas.AgentPushParamsEnum..) pass ```
@railgun20001 SDK 是基于又拍云的 [REST_API](http://docs.upyun.com/api/rest_api/) 开发的. 目前只有一个统计整个服务使用量的接口, 没有提供直接统计某个目录的接口的. 实现这个得多写点代码统计一下. 比如调用 [获取文件列表](http://docs.upyun.com/api/rest_api/#_13) 这个接口, 会返回一个文件大小的数据。遍历某个目录, 然后把这个目录下面每个文件的大小相加一下。 有个现成的 Python 脚本, 遍历的方式统计某个目录的大小: [Python 统计目录大小](https://github.com/monkey-wenjun/upyun-sdk-script/tree/master/%E7%BB%9F%E8%AE%A1%E7%9B%AE%E5%BD%95%E5%A4%A7%E5%B0%8F--Python2.7)
> @binbinah 暂时还是没有获取目录大小的接口是吧? 嗯,还没有这样的接口
浏览器客户端 js 在会禁用 Date 这种字段,可以尝试一下用 "x-date" 字段试试。 另外, 客户端 js 的上传,安全起见,不建议使用 REST 接口进行上传的,您可以用 FORM 接口的 大文件模式:[FORM 大文件上传](http://docs.upyun.com/api/form_api/#_5)