Merge pull request #9668 from thalesmg/fix-bridge-name-type-fields-v50
fix(mongodb): add `type` and `name` fields to the `get`/`post` API docs
This commit is contained in:
commit
c99ef2aedf
|
@ -64,4 +64,26 @@ emqx_ee_bridge_mongodb {
|
|||
zh: "MongoDB(独立)配置"
|
||||
}
|
||||
}
|
||||
|
||||
desc_type {
|
||||
desc {
|
||||
en: """The Bridge Type."""
|
||||
zh: """桥接类型。"""
|
||||
}
|
||||
label {
|
||||
en: "Bridge Type"
|
||||
zh: "桥接类型"
|
||||
}
|
||||
}
|
||||
|
||||
desc_name {
|
||||
desc {
|
||||
en: """Bridge name."""
|
||||
zh: """桥接名称。"""
|
||||
}
|
||||
label {
|
||||
en: "Bridge Name"
|
||||
zh: "桥接名称"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,11 +46,11 @@ fields(mongodb_sharded) ->
|
|||
fields(mongodb_single) ->
|
||||
emqx_connector_mongo:fields(single) ++ fields("config");
|
||||
fields("post_rs") ->
|
||||
fields(mongodb_rs);
|
||||
fields(mongodb_rs) ++ type_and_name_fields(mongodb_rs);
|
||||
fields("post_sharded") ->
|
||||
fields(mongodb_sharded);
|
||||
fields(mongodb_sharded) ++ type_and_name_fields(mongodb_sharded);
|
||||
fields("post_single") ->
|
||||
fields(mongodb_single);
|
||||
fields(mongodb_single) ++ type_and_name_fields(mongodb_single);
|
||||
fields("put_rs") ->
|
||||
fields(mongodb_rs);
|
||||
fields("put_sharded") ->
|
||||
|
@ -58,11 +58,17 @@ fields("put_sharded") ->
|
|||
fields("put_single") ->
|
||||
fields(mongodb_single);
|
||||
fields("get_rs") ->
|
||||
emqx_bridge_schema:metrics_status_fields() ++ fields(mongodb_rs);
|
||||
emqx_bridge_schema:metrics_status_fields() ++
|
||||
fields(mongodb_rs) ++
|
||||
type_and_name_fields(mongodb_rs);
|
||||
fields("get_sharded") ->
|
||||
emqx_bridge_schema:metrics_status_fields() ++ fields(mongodb_sharded);
|
||||
emqx_bridge_schema:metrics_status_fields() ++
|
||||
fields(mongodb_sharded) ++
|
||||
type_and_name_fields(mongodb_sharded);
|
||||
fields("get_single") ->
|
||||
emqx_bridge_schema:metrics_status_fields() ++ fields(mongodb_single).
|
||||
emqx_bridge_schema:metrics_status_fields() ++
|
||||
fields(mongodb_single) ++
|
||||
type_and_name_fields(mongodb_single).
|
||||
|
||||
conn_bridge_examples(Method) ->
|
||||
[
|
||||
|
@ -103,6 +109,12 @@ desc(_) ->
|
|||
%% Internal fns
|
||||
%%=================================================================================================
|
||||
|
||||
type_and_name_fields(MongoType) ->
|
||||
[
|
||||
{type, mk(MongoType, #{required => true, desc => ?DESC("desc_type")})},
|
||||
{name, mk(binary(), #{required => true, desc => ?DESC("desc_name")})}
|
||||
].
|
||||
|
||||
values(mongodb_rs = MongoType, Method) ->
|
||||
TypeOpts = #{
|
||||
servers => <<"localhost:27017, localhost:27018">>,
|
||||
|
|
Loading…
Reference in New Issue