diff --git a/pkg/compute/models/secgroups.go b/pkg/compute/models/secgroups.go index 961ea868f7..af26fc555f 100644 --- a/pkg/compute/models/secgroups.go +++ b/pkg/compute/models/secgroups.go @@ -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) { diff --git a/pkg/compute/tasks/filesystem_create_task.go b/pkg/compute/tasks/filesystem_create_task.go index 054628309a..a0a2c16af8 100644 --- a/pkg/compute/tasks/filesystem_create_task.go +++ b/pkg/compute/tasks/filesystem_create_task.go @@ -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, }) } diff --git a/pkg/compute/tasks/nat_create_task.go b/pkg/compute/tasks/nat_create_task.go index 05079324e2..a02eebc224 100644 --- a/pkg/compute/tasks/nat_create_task.go +++ b/pkg/compute/tasks/nat_create_task.go @@ -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) } diff --git a/pkg/compute/tasks/nat_delete_task.go b/pkg/compute/tasks/nat_delete_task.go index 6c7124e4f4..f715b90a40 100644 --- a/pkg/compute/tasks/nat_delete_task.go +++ b/pkg/compute/tasks/nat_delete_task.go @@ -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) }