diff --git a/api/swagger/docs.go b/api/swagger/docs.go index d8548d1c..61c697f6 100644 --- a/api/swagger/docs.go +++ b/api/swagger/docs.go @@ -10430,6 +10430,12 @@ const docTemplate = `{ "name": { "type": "string" }, + "policyIds": { + "type": "array", + "items": { + "type": "string" + } + }, "stackTemplateId": { "type": "string" }, diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 7b2293c4..058f2406 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -10424,6 +10424,12 @@ "name": { "type": "string" }, + "policyIds": { + "type": "array", + "items": { + "type": "string" + } + }, "stackTemplateId": { "type": "string" }, diff --git a/api/swagger/swagger.yaml b/api/swagger/swagger.yaml index ac85f22d..7b9152ce 100644 --- a/api/swagger/swagger.yaml +++ b/api/swagger/swagger.yaml @@ -1044,6 +1044,10 @@ definitions: type: string name: type: string + policyIds: + items: + type: string + type: array stackTemplateId: type: string tksCpNode: diff --git a/internal/delivery/http/system-notification-rule.go b/internal/delivery/http/system-notification-rule.go index 5152381d..c7b354d2 100644 --- a/internal/delivery/http/system-notification-rule.go +++ b/internal/delivery/http/system-notification-rule.go @@ -181,6 +181,13 @@ func (h *SystemNotificationRuleHandler) GetSystemNotificationRule(w http.Respons log.Info(r.Context(), err) } + out.SystemNotificationRule.TargetUsers = make([]domain.SimpleUserResponse, len(systemNotificationRule.TargetUsers)) + for i, targetUser := range systemNotificationRule.TargetUsers { + if err := serializer.Map(r.Context(), targetUser, &out.SystemNotificationRule.TargetUsers[i]); err != nil { + log.Info(r.Context(), err) + } + } + out.SystemNotificationRule.SystemNotificationConditions = make([]domain.SystemNotificationConditionResponse, len(systemNotificationRule.SystemNotificationConditions)) for i, condition := range systemNotificationRule.SystemNotificationConditions { if err := serializer.Map(r.Context(), condition, &out.SystemNotificationRule.SystemNotificationConditions[i]); err != nil { diff --git a/pkg/domain/stack.go b/pkg/domain/stack.go index c56abc48..82cb8e66 100644 --- a/pkg/domain/stack.go +++ b/pkg/domain/stack.go @@ -81,22 +81,23 @@ type StackStepStatus struct { } type CreateStackRequest struct { - Name string `json:"name" validate:"required,name,rfc1123"` - Description string `json:"description"` - ClusterId string `json:"clusterId"` - CloudService string `json:"cloudService" validate:"required,oneof=AWS BYOH"` - StackTemplateId string `json:"stackTemplateId" validate:"required"` - CloudAccountId string `json:"cloudAccountId"` - ClusterEndpoint string `json:"userClusterEndpoint,omitempty"` - TksCpNode int `json:"tksCpNode"` - TksCpNodeMax int `json:"tksCpNodeMax,omitempty"` - TksCpNodeType string `json:"tksCpNodeType,omitempty"` - TksInfraNode int `json:"tksInfraNode"` - TksInfraNodeMax int `json:"tksInfraNodeMax,omitempty"` - TksInfraNodeType string `json:"tksInfraNodeType,omitempty"` - TksUserNode int `json:"tksUserNode"` - TksUserNodeMax int `json:"tksUserNodeMax,omitempty"` - TksUserNodeType string `json:"tksUserNodeType,omitempty"` + Name string `json:"name" validate:"required,name,rfc1123"` + Description string `json:"description"` + ClusterId string `json:"clusterId"` + CloudService string `json:"cloudService" validate:"required,oneof=AWS BYOH"` + StackTemplateId string `json:"stackTemplateId" validate:"required"` + CloudAccountId string `json:"cloudAccountId"` + ClusterEndpoint string `json:"userClusterEndpoint,omitempty"` + PolicyIds []string `json:"policyIds,omitempty"` + TksCpNode int `json:"tksCpNode"` + TksCpNodeMax int `json:"tksCpNodeMax,omitempty"` + TksCpNodeType string `json:"tksCpNodeType,omitempty"` + TksInfraNode int `json:"tksInfraNode"` + TksInfraNodeMax int `json:"tksInfraNodeMax,omitempty"` + TksInfraNodeType string `json:"tksInfraNodeType,omitempty"` + TksUserNode int `json:"tksUserNode"` + TksUserNodeMax int `json:"tksUserNodeMax,omitempty"` + TksUserNodeType string `json:"tksUserNodeType,omitempty"` } type CreateStackResponse struct {