mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #9603 from rainzm/lb/webhook
feat(webhook): send webhook notification when c/d loadbalancerlisterrule
This commit is contained in:
@@ -250,6 +250,7 @@ func (self *LoadbalancerListenerRuleCreateTask) OnLoadbalancerListenerRuleCreate
|
||||
lbr.SetStatus(self.GetUserCred(), api.LB_STATUS_ENABLED, "")
|
||||
db.OpsLog.LogEvent(lbr, db.ACT_ALLOCATE, lbr.GetShortDesc(ctx), self.UserCred)
|
||||
logclient.AddActionLogWithStartable(self, lbr, logclient.ACT_CREATE, nil, self.UserCred, true)
|
||||
notifyclient.NotifyWebhook(ctx, self.UserCred, lbr, notifyclient.ActionCreate)
|
||||
lblis := lbr.GetLoadbalancerListener()
|
||||
if lblis != nil {
|
||||
logclient.AddActionLogWithStartable(self, lblis, logclient.ACT_LB_ADD_LISTENER_RULE, nil, self.UserCred, true)
|
||||
|
||||
@@ -60,6 +60,7 @@ func (self *LoadbalancerListenerRuleDeleteTask) OnInit(ctx context.Context, obj
|
||||
func (self *LoadbalancerListenerRuleDeleteTask) OnLoadbalancerListenerRuleDeleteComplete(ctx context.Context, lbr *models.SLoadbalancerListenerRule, data jsonutils.JSONObject) {
|
||||
db.OpsLog.LogEvent(lbr, db.ACT_DELETE, lbr.GetShortDesc(ctx), self.UserCred)
|
||||
logclient.AddActionLogWithStartable(self, lbr, logclient.ACT_DELOCATE, nil, self.UserCred, true)
|
||||
notifyclient.NotifyWebhook(ctx, self.UserCred, lbr, notifyclient.ActionDelete)
|
||||
lblis := lbr.GetLoadbalancerListener()
|
||||
if lblis != nil {
|
||||
logclient.AddActionLogWithStartable(self, lblis, logclient.ACT_LB_REMOVE_LISTENER_RULE, nil, self.UserCred, true)
|
||||
|
||||
Reference in New Issue
Block a user