From 1df9c11501a06ccc0353646c2992514a2f9a8b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 20 Aug 2025 17:05:34 +0800 Subject: [PATCH] fix(region): add change_config status for aigateway (#23138) --- pkg/apis/const.go | 1 + pkg/compute/models/ai_gateway.go | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/apis/const.go b/pkg/apis/const.go index 2b8a60247e..8d0531a4d7 100644 --- a/pkg/apis/const.go +++ b/pkg/apis/const.go @@ -53,6 +53,7 @@ const ( STATUS_SYNC_STATUS = "sync_status" STATUS_DELETING = "deleting" STATUS_DELETE_FAILED = "delete_failed" + STATUS_CHANGE_CONFIG = "change_config" STATUS_UNKNOWN = "unknown" STATUS_CREATING = "creating" STATUS_AVAILABLE = "available" diff --git a/pkg/compute/models/ai_gateway.go b/pkg/compute/models/ai_gateway.go index a7922b8776..b8f27a5ef4 100644 --- a/pkg/compute/models/ai_gateway.go +++ b/pkg/compute/models/ai_gateway.go @@ -61,13 +61,13 @@ type SAiGateway struct { db.SExternalizedResourceBase SManagedResourceBase - Authentication bool `default:"false" list:"user" json:"authentication"` - CacheInvalidateOnUpdate bool `default:"false" list:"user" json:"cache_invalidate_on_update"` - CacheTTL int `default:"0" list:"user" json:"cache_ttl"` - CollectLogs bool `default:"false" list:"user" json:"collect_logs"` - RateLimitingInterval int `default:"0" list:"user" json:"rate_limiting_interval"` - RateLimitingLimit int `default:"0" list:"user" json:"rate_limiting_limit"` - RateLimitingTechnique string `width:"32" charset:"ascii" default:"" list:"user" json:"rate_limiting_technique"` + Authentication bool `default:"false" list:"user" create:"optional"` + CacheInvalidateOnUpdate bool `default:"false" list:"user" create:"optional"` + CacheTTL int `default:"0" list:"user" create:"optional"` + CollectLogs bool `default:"false" list:"user" create:"optional"` + RateLimitingInterval int `default:"0" list:"user" create:"optional"` + RateLimitingLimit int `default:"0" list:"user" create:"optional` + RateLimitingTechnique string `width:"32" charset:"ascii" default:"" list:"user" create:"optional"` } // AI网关列表 @@ -431,5 +431,6 @@ func (self *SAiGateway) StartAiGatewayChangeConfigTask(ctx context.Context, user if err != nil { return err } + self.SetStatus(ctx, userCred, apis.STATUS_CHANGE_CONFIG, "") return task.ScheduleRun(nil) }