yapi-plugin-pl-es-storage
第三方插件,通过hook形式,将页面测试集每一次测试后的结果写入Elasticsearch进行持久化存储:
"plugins": [
{
"name":"pl-es-storage",
"options":{
"esHost":"xxx.xxx.xx:port",
"esUsername":"xxxx",
"esPwd":"xxxx",
"indexName":"xxxx",
"dataSource":"xxxx"
}
}
]
使用注意:
- 该插件必须基于源码中支持after_col_test 钩子(因为项目在本地已修改加入该钩子,所以该插件得以配合使用),本人稍后会在yapi中提交此hook的变更。
- Elasticsearch 没有开启权限认证时,
esUsername
,esPwd
可以不省略不配置
这里面的配置项含义如下:
-
esHost
es集群的host地址 -
esUsername
es集群访问用户名 -
esPwd
es集群用户密码 -
indexName
数据插入到Es的哪个索引里 -
dataSource
标明数据来源,会作为document中source字段的值