feat(region): add some resources to create deleted webhook notifications

This commit is contained in:
rainzm
2021-10-26 14:41:16 +08:00
parent e5cefa54f5
commit 2a8cfa612b
4 changed files with 14 additions and 1 deletions
+4
View File
@@ -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) {
+1 -1
View File
@@ -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,
})
}
+4
View File
@@ -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)
}
+5
View File
@@ -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)
}