Closed cosven closed 8 years ago
原先的代码结构根本不能做 mock。
有多麻烦:
zk_clients
参数进去。1. 运行脚本要改
2. 所有的测试也要相似的改
3. 一些地方引用了 app ,就没办法
把 env, profile 看成子资源
把 env,profile 看成属性。(感觉这种,大部分的逻辑都会集中到在一个controller中)
- 列出某个所有 Service
/api/services
/api/services
/api/services/<service>/<env>/profiles
/api/services/<service>?env=<env>
/api/services/<service>/<env>/<profile_name>
/api/services/<service>?env=<env>&profile=<profile>
如果profile_name的名字是profiles,可能会出问题
- 创建、删除 service
/api/services/<service>
/api/services/<service>/<env>/profiles/default
POST
profile_name
/api/services/<service>/<env>/<profile>/history
raise_for_status
: If we made a bad request (a 4XX client error or 5XX server error response), we can raise it with。
返回数据中的message应该是对错误的描述,不应该包含数据...
[x] dashboard 集成 cfb
把CFB看成一个服务,这样会导致Dashboard写很多重复的代码。 比如说像,表单,一些判断逻辑等。
raise 之后不就会出现500么? 难道是为了开发调试么?应该是,如果返回是4或者5都说明请求有问题或者服务器有问题...
create_service
409 时,返回的内容应该更具体。