mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
feat(region): add some resources to create deleted webhook notifications
This commit is contained in:
@@ -630,6 +630,10 @@ func (self *SSecurityGroup) PostCreate(ctx context.Context, userCred mcclient.To
|
||||
|
||||
SecurityGroupRuleManager.TableSpec().Insert(ctx, rule)
|
||||
}
|
||||
notifyclient.EventNotify(ctx, userCred, notifyclient.SEventNotifyParam{
|
||||
Obj: self,
|
||||
Action: notifyclient.ActionCreate,
|
||||
})
|
||||
}
|
||||
|
||||
func (manager *SSecurityGroupManager) FetchSecgroupById(secId string) (*SSecurityGroup, error) {
|
||||
|
||||
@@ -113,7 +113,7 @@ func (self *FileSystemCreateTask) OnSyncstatusComplete(ctx context.Context, fs *
|
||||
self.SetStageComplete(ctx, nil)
|
||||
notifyclient.EventNotify(ctx, self.UserCred, notifyclient.SEventNotifyParam{
|
||||
Obj: self,
|
||||
Action: notifyclient.ActionDelete,
|
||||
Action: notifyclient.ActionCreate,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +186,10 @@ func (self *NatGatewayCreateTask) OnDeployEipComplete(ctx context.Context, nat *
|
||||
}
|
||||
|
||||
func (self *NatGatewayCreateTask) OnSyncstatusComplete(ctx context.Context, nat *models.SNatGateway, data jsonutils.JSONObject) {
|
||||
notifyclient.EventNotify(ctx, self.UserCred, notifyclient.SEventNotifyParam{
|
||||
Obj: nat,
|
||||
Action: notifyclient.ActionCreate,
|
||||
})
|
||||
self.SetStageComplete(ctx, nil)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/notifyclient"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/compute/models"
|
||||
"yunion.io/x/onecloud/pkg/util/logclient"
|
||||
@@ -132,5 +133,9 @@ func (self *NatGatewayDeleteTask) doDeleteNatGateway(ctx context.Context, nat *m
|
||||
|
||||
func (self *NatGatewayDeleteTask) taskComplete(ctx context.Context, nat *models.SNatGateway) {
|
||||
nat.RealDelete(ctx, self.GetUserCred())
|
||||
notifyclient.EventNotify(ctx, self.UserCred, notifyclient.SEventNotifyParam{
|
||||
Obj: nat,
|
||||
Action: notifyclient.ActionDelete,
|
||||
})
|
||||
self.SetStageComplete(ctx, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user