Commit Graph

22 Commits

Author SHA1 Message Date
rainzm
1d1bb6c381 feat(notify): advanced notify config and robot
1. Notify config has now become a domain resource, so that each domain can have its own configuration about notify.
   The domains has no configuration will use system config.
2. Robot separates from config and becomes a shared project resource. Sending information to robot can
   choose which robot to send to.
2021-06-24 10:29:35 +08:00
rainzm
7357b6e0a2 feat(cloudcommon): expand notifyclient
1. support new params in creating notification
2. adapt keystone because `auth.GetAdminSession` doesn't work in keystone
2021-01-13 19:39:03 +08:00
rainzm
a8ea8b10cc feat(cloudcommon): allways send webconsole notification via contacts
For notification with webconsole type, receiverId is same with contacts.
2020-11-30 17:45:52 +08:00
rainzm
264b9ef39f feat: add NotifyWebhook in notifyclient 2020-10-19 16:00:12 +08:00
rainzm
f57a199cbd feat(notify): Add TNotifyChannel const of robot 2020-09-03 15:08:13 +08:00
Rain Zheng
1ed65ddd1a Feature & Fix for Notify (#7714)
* feat(notify): Add 'get-types' action for ConfigManager

The List interface is only open to administrators,
because we don't want anyone other than administrators
to see the details of the notify configuration.
To let general user to kown available notification channels,
add 'get-types' actions of ConfigManager.

* feat(notify): Check the availability of contact type before creating notification

Creating notification with unconfigured contact type will fail at
sending message. Now, prevent creation in advance.

* feat(notify): Add workwx for NotifyNormal/Important/Critical

* feat(notify): Add Notify about robot in notifyclient

* fix(notify): Init ParentContactType for SSubContact

1. ParentContactType of SSubContact with webconsole type is empty.
2. ParentContactType of others SSubContact is mobile.

* fix(notify): Unverify SSubContact when ParentContactType match

* fix(notify): When no data is initialized, exit directly
2020-09-02 16:10:06 +08:00
Rain Zheng
707051ec0b fix: make old notify send SDK compatible (#7628) 2020-08-25 18:48:32 +08:00
Rain Zheng
853153c739 Refactor for Notify (#7611)
* refactor(notify): ALL

* feat(climc): Notify v2

* feat: support notify for codegen.py

* delete deprecated code and Maintain SDK compatibility

* Adjust the template for mail validation to support captcha

* fix: The issue of notify refactoring

* add copyright for notifyv2 cli

* Adjust according to the advice of make check

* Remove utils package in notify

* fix import format

* remove redundant Template module

* fix validateCreate and validateUpdate of notifytemplate

* fix update issues of receivers

* fix: Add SetStageComplete in tasks
2020-08-25 17:19:02 +08:00
Rain
2a72f35138 feat(notify): Add TNotifyChannel 'feishu' 2020-04-10 20:14:48 +08:00
Rain
61ff025886 Fix(notify): Unified the api params and fix some bug.
1. Config Verify 和 Contact 的 InitalizeData 写得过于直接了。
会导致正常的数据被覆盖。实际上,数据的Init只需要更换数据
库的时候更新,如何判断数据库要被更新了,就是判断新出现的
column 有没有非零值的,如果有,就说明数据库不是第一次更新。

2. 前端的请求经过yunionapi,最终会调用climc里面注册的ResourceManager,
所以这个地方一定要和后端的参数处理统一。之前因为添加 uname
的支持破坏了这个地方的统一,虽然climc可以调用成功但是前端接口调用会失败。

3. Resend 的bug,会导致任务的阻塞。

4. 为了兼容kapacitor对climc
notify的调用,分成了notify和notify-batch两个命令。
2019-12-20 11:39:17 +08:00
Rain
59a7b155a3 fix(notify): Fix the bugs of user cache and some api's params 2019-12-17 17:18:22 +08:00
Rain
2222c7779c feat(notify): Available uname in api & Unified template management
1. Uname is availbale now in api via adding "uname=true" in query.
So we can use uname in climc which is much more visual and use uid in
web client which avoid time-consuming remote calls that may occur.

2. Previously, the template for the message was managed by the
individual sending components. Now, these templats was managed uniformly
by Notify Service so that we can easily add and remove.

3. Now, failure to send a validation message will trigger a notification
to the user via websocket.
2019-12-14 16:49:26 +08:00
Yousong Zhou
8ba5986d83 goimports: first run 2019-10-28 06:22:17 +00:00
Rain
dc68d23ff6 support Secondary authority management for contact and notification
rpc=>grpc, go=>workerMan

pull dingtalk auto

grpc
2019-09-24 15:33:53 +08:00
TangBin
d2fa217cab mcclient module base 2019-09-07 22:56:47 +08:00
rex zhasm
71783997d5 新增 climc notify-broadcast 接口,用于向所有在线用户发 websocket 通知 (#2131) 2019-08-07 16:36:41 +08:00
wanyaoqi
1ee81d46cc fix go vet report bugs 2019-05-09 11:53:29 +08:00
Zexi
db0e303798 make 'go test ./...' pass 2019-04-15 19:54:46 +08:00
Qiu Jian
004d9b6f95 update copyright headers of all source 2019-03-29 14:47:48 +08:00
Qiu Jian
a72ae86082 fix: send system notification to specific users or groups 2019-02-16 01:46:39 +08:00
Qiu Jian
44faf10bfd update influxdb in a more graceful manner 2019-02-11 23:01:44 +08:00
Qiu Jian
ff4709e066 增加:补充完整通知消息功能 2019-02-08 07:42:53 +08:00