diff --git a/go.mod b/go.mod index 434d721c6a..eae57835ae 100644 --- a/go.mod +++ b/go.mod @@ -93,14 +93,14 @@ require ( k8s.io/cri-api v0.22.17 k8s.io/klog/v2 v2.2.0 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240417101508-a89da4ad967d + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240418034244-1a37b648d016 yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401 yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 yunion.io/x/pkg v1.10.1-0.20240416041628-5e17b8728132 yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e - yunion.io/x/sqlchemy v1.1.3-0.20240326090913-96da8bf92408 + yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305 yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c ) diff --git a/go.sum b/go.sum index e6137a7bc7..d3f48d97d1 100644 --- a/go.sum +++ b/go.sum @@ -1222,8 +1222,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240417101508-a89da4ad967d h1:ZCPT9Yn7UdaX46O0hNIi28skvgr6oPI3hj8YqZvz6fM= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240417101508-a89da4ad967d/go.mod h1:dsUESXIbXJ+/ywbNClhldOrbPOiBi2udrgOnB/ffoWk= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240418034244-1a37b648d016 h1:Q81gQLJKfKN73vqFugpgOa10Lqj6PbDqUe/MHS0fnOA= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240418034244-1a37b648d016/go.mod h1:dsUESXIbXJ+/ywbNClhldOrbPOiBi2udrgOnB/ffoWk= yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug= yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= @@ -1241,7 +1241,7 @@ yunion.io/x/pkg v1.10.1-0.20240416041628-5e17b8728132 h1:+7rO5MAfU4BNvYPim0MhgN1 yunion.io/x/pkg v1.10.1-0.20240416041628-5e17b8728132/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk= yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo= yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo= -yunion.io/x/sqlchemy v1.1.3-0.20240326090913-96da8bf92408 h1:TmkgsnVG/KsUfxaFxaYEhQs0o4nXc9fFFlqZv6mwZ/E= -yunion.io/x/sqlchemy v1.1.3-0.20240326090913-96da8bf92408/go.mod h1:5W8ghvJ4TNt/r2yDjjD3i4QsZgIiJX45dhRQBGWPHsQ= +yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305 h1:TIXzc634+YSAs2+3A+TyPmKAGd6HtAYU3M4cKwzUuo0= +yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305/go.mod h1:5W8ghvJ4TNt/r2yDjjD3i4QsZgIiJX45dhRQBGWPHsQ= yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ= yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng= diff --git a/pkg/apis/cloudid/samluser.go b/pkg/apis/cloudid/samluser.go index 84408385b8..70be6107c0 100644 --- a/pkg/apis/cloudid/samluser.go +++ b/pkg/apis/cloudid/samluser.go @@ -39,8 +39,9 @@ type SamluserDetails struct { CloudgroupResourceDetails CloudaccountResourceDetails - ManagerId string - Manager string + CloudaccountId string + ManagerId string + Manager string SSamluser } diff --git a/pkg/apis/cloudid/zz_generated.model.go b/pkg/apis/cloudid/zz_generated.model.go index ac37e13712..e63aa8aaca 100644 --- a/pkg/apis/cloudid/zz_generated.model.go +++ b/pkg/apis/cloudid/zz_generated.model.go @@ -90,8 +90,6 @@ type SCloudpolicy struct { PolicyType string `json:"policy_type"` // 策略内容 Document *jsonutils.JSONDict `json:"document"` - // 是否锁定, 若锁定后, 此策略不允许被绑定到用户或权限组, 仅管理员可以设置是否锁定 - Locked *bool `json:"locked,omitempty"` } // SCloudpolicyResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudpolicyResourceBase. @@ -110,7 +108,7 @@ type SCloudprovider struct { // SCloudproviderResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudproviderResourceBase. type SCloudproviderResourceBase struct { // 子订阅Id - CloudproviderId string `json:"cloudprovider_id"` + ManagerId string `json:"manager_id"` } // SCloudrole is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SCloudrole. @@ -118,10 +116,10 @@ type SCloudrole struct { apis.SEnabledStatusInfrasResourceBase apis.SExternalizedResourceBase SCloudaccountResourceBase + SCloudproviderResourceBase SAMLProviderResourceBase SCloudgroupResourceBase Document *jsonutils.JSONDict `json:"document"` - OwnerId string `json:"owner_id"` } // SClouduser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SClouduser. @@ -161,6 +159,7 @@ type SSAMLProvider struct { apis.SStatusInfrasResourceBase apis.SExternalizedResourceBase SCloudaccountResourceBase + SCloudproviderResourceBase EntityId string `json:"entity_id"` MetadataDocument string `json:"metadata_document"` AuthUrl string `json:"auth_url"` @@ -169,9 +168,8 @@ type SSAMLProvider struct { // SSamluser is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudid/models.SSamluser. type SSamluser struct { apis.SStatusDomainLevelUserResourceBase - apis.SExternalizedResourceBase SCloudgroupResourceBase - SCloudaccountResourceBase // 邮箱地址 - Email string `json:"email"` + Email string `json:"email"` + CloudroleId string `json:"cloudrole_id"` } diff --git a/pkg/apis/cloudprovider/doc.go b/pkg/apis/cloudprovider/doc.go index 5997bbb7ae..c6f37fc532 100644 --- a/pkg/apis/cloudprovider/doc.go +++ b/pkg/apis/cloudprovider/doc.go @@ -1,5 +1,6 @@ -// Copyright 2019 Yunion -// +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -12,4 +13,28 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cloudprovider // import "yunion.io/x/onecloud/pkg/apis/cloudprovider" +// Code generated by swagger-gen. DO NOT EDIT. + +// Cloudprovider API +// +// Schemes: https, http +// BasePath: / +// Version: 1.0 +// Host: "127.0.0.1:8889" +// Contact: Zexi Li +// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// SecurityDefinitions: +// keystone: +// name: X-Auth-Token +// type: apiKey +// in: header +// +// swagger:meta +package cloudprovider diff --git a/pkg/apis/cloudprovider/zz_generated.model.go b/pkg/apis/cloudprovider/zz_generated.model.go index df150d8908..563452ae32 100644 --- a/pkg/apis/cloudprovider/zz_generated.model.go +++ b/pkg/apis/cloudprovider/zz_generated.model.go @@ -14,7 +14,22 @@ package cloudprovider -import "yunion.io/x/cloudmux/pkg/cloudprovider" +// CacheKeyRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.CacheKeyRule. +type CacheKeyRule struct { + RulePaths []string `json:"rule_paths"` + RuleType string `json:"rule_type"` + FullUrlCache bool `json:"full_url_cache"` + IgnoreCase bool `json:"ignore_case"` + QueryString CacheKeyRuleQueryString `json:"query_string"` + RuleTag string `json:"rule_tag"` +} + +// CacheKeyRuleQueryString is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.CacheKeyRuleQueryString. +type CacheKeyRuleQueryString struct { + Enabled bool `json:"enabled"` + Action string `json:"action"` + Value string `json:"value"` +} // DefaultAction is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.DefaultAction. type DefaultAction struct { @@ -30,6 +45,115 @@ type DefaultAction struct { ResponseHeaders map[string]string `json:"response_headers"` } +// ElasticSearchAccessInfo is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.ElasticSearchAccessInfo. +type ElasticSearchAccessInfo struct { + Domain string `json:"domain"` + PrivateDomain string `json:"private_domain"` + Vip string `json:"vip"` + Port int `json:"port"` + PrivatePort int `json:"private_port"` + KibanaUrl string `json:"kibana_url"` + KibanaPrivateUrl string `json:"kibana_private_url"` +} + +// RefererRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.RefererRule. +type RefererRule struct { + // 规则类型: + // all:所有文件生效 + // file:指定文件后缀生效 + // directory:指定路径生效 + // path:指定绝对路径生效 + RuleType string `json:"rule_type"` + RulePaths []string `json:"rule_paths"` + RefererType string `json:"referer_type"` + Referers []string `json:"referers"` + AllowEmpty *bool `json:"allow_empty"` +} + +// RuleCacheConfig is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.RuleCacheConfig. +type RuleCacheConfig struct { + Cache *struct { + Enabled bool + CacheTime int + CompareMaxAge bool + IgnoreCacheControl bool + IgnoreSetCookie bool + } `json:"cache"` + NoCache *struct { + Enabled bool + Revalidate bool + } `json:"no_cache"` + FollowOrigin *struct { + Enabled bool + HeuristicCache struct { + Enabled bool + CacheConfig struct { + HeuristicCacheTimeSwitch bool + HeuristicCacheTime int + } + } + } `json:"follow_origin"` +} + +// SCDNCache is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNCache. +type SCDNCache struct { + RuleCache []SCacheRuleCache `json:"rule_cache"` +} + +// SCDNCacheKeys is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNCacheKeys. +type SCDNCacheKeys struct { + // 开启关闭忽略参数 + Enabled *bool `json:"enabled"` + // 是否忽略大小 + IgnoreCase *bool `json:"ignore_case"` + // 分路径缓存键配置 + KeyRules []CacheKeyRule `json:"key_rules"` +} + +// SCDNForceRedirect is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNForceRedirect. +type SCDNForceRedirect struct { + // 访问强制跳转配置开关 + Enabled *bool `json:"enabled"` + // 访问强制跳转类型 + // enmu: http, https + RedirectType string `json:"redirect_type"` +} + +// SCDNHttps is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNHttps. +type SCDNHttps struct { + // https 配置开关 + Enabled *bool `json:"enabled"` + // http2 配置开关 + Http2 *bool `json:"http2"` +} + +// SCDNMaxAge is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNMaxAge. +type SCDNMaxAge struct { + Enabled *bool `json:"enabled"` + MaxAgeRules []SMaxAgeRule `json:"max_age_rules"` +} + +// SCDNRangeOriginPull is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNRangeOriginPull. +type SCDNRangeOriginPull struct { + Enabled *bool `json:"enabled"` + RangeOriginPullRules []SRangeOriginPullRule `json:"range_origin_pull_rules"` +} + +// SCDNReferer is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCDNReferer. +type SCDNReferer struct { + // 是否开启防盗链 + Enabled *bool `json:"enabled"` + RefererRules []RefererRule `json:"referer_rules"` +} + +// SCacheRuleCache is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCacheRuleCache. +type SCacheRuleCache struct { + RulePaths []string `json:"rule_paths"` + RuleType string `json:"rule_type"` + Priority int `json:"priority"` + CacheConfig *RuleCacheConfig `json:"cache_config"` +} + // SCdnDomain is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnDomain. type SCdnDomain struct { // cdn加速域名 @@ -48,14 +172,22 @@ type SCdnDomain struct { // SCdnOrigin is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnOrigin. type SCdnOrigin struct { - Type string `json:"type"` - Origin string `json:"origin"` + // 源站类型 + // domain: 域名类型, cos:对象存储源站, ip:IP 列表作为源站 + // enmu: domain, cos, ip + // required: true + Type string `json:"type"` + // 源站地址 + Origin string `json:"origin"` + // 回主源站时 Host 头部 ServerName string `json:"server_name"` - Protocol string `json:"protocol"` - Path string `json:"path"` - Port int `json:"port"` - Enabled string `json:"enabled"` - Priority int `json:"priority"` + // 回源协议 + // enmu: http, follow, https + Protocol string `json:"protocol"` + Path string `json:"path"` + Port int `json:"port"` + Enabled string `json:"enabled"` + Priority int `json:"priority"` } // SCdnOrigins is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SCdnOrigins. @@ -85,10 +217,28 @@ type SGeographicInfo struct { CountryCode string `json:"country_code"` } +// SMaxAgeRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SMaxAgeRule. +type SMaxAgeRule struct { + MaxAgeType string `json:"max_age_type"` + MaxAgeContents []string `json:"max_age_contents"` + MaxAgeTime int `json:"max_age_time"` + FollowOrigin bool `json:"follow_origin"` +} + +// SRangeOriginPullRule is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SRangeOriginPullRule. +type SRangeOriginPullRule struct { + Enabled bool `json:"enabled"` + RuleType string `json:"rule_type"` + RulePaths []string `json:"rule_paths"` +} + // SSubAccount is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SSubAccount. type SSubAccount struct { + Id string `json:"id"` // 若Account不为空,可不传 Name string `json:"name"` + // 描述信息 + Desc string `json:"desc"` // 输入必填,若为空,需要指定子账号名称 Account string `json:"account"` HealthStatus string `json:"health_status"` @@ -144,9 +294,11 @@ type ServerVncOutput struct { HostId string `json:"host_id"` Zone string `json:"zone"` // kvm host ip - Host string `json:"host"` - Protocol string `json:"protocol"` - Port int64 `json:"port"` + Host string `json:"host"` + Protocol string `json:"protocol"` + Port int64 `json:"port"` + // volcengine + Region string `json:"region"` Url string `json:"url"` InstanceId string `json:"instance_id"` InstanceName string `json:"instance_name"` @@ -163,7 +315,7 @@ type ServerVncOutput struct { // SubAccounts is an autogenerated struct via yunion.io/x/cloudmux/pkg/cloudprovider.SubAccounts. type SubAccounts struct { // 若输出则是全量子账号列表,若输入,代表允许同步的子账号 - Accounts []cloudprovider.SSubAccount `json:"accounts"` + Accounts []SSubAccount `json:"accounts"` // 若输出是云账号查询到的区域列表,若输入,代表允许同步的区域 Cloudregions []struct { Id string diff --git a/pkg/apis/cloudprovider/zz_generated.swagger_spec_cloudprovider.go b/pkg/apis/cloudprovider/zz_generated.swagger_spec_cloudprovider.go new file mode 100644 index 0000000000..9f8762621a --- /dev/null +++ b/pkg/apis/cloudprovider/zz_generated.swagger_spec_cloudprovider.go @@ -0,0 +1,18 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by swagger-gen. DO NOT EDIT. + +package cloudprovider diff --git a/pkg/apis/compute/zz_generated.model.go b/pkg/apis/compute/zz_generated.model.go index d28b0c98b0..a85d432b18 100644 --- a/pkg/apis/compute/zz_generated.model.go +++ b/pkg/apis/compute/zz_generated.model.go @@ -17,10 +17,10 @@ package compute import ( time "time" - cloudprovider "yunion.io/x/cloudmux/pkg/cloudprovider" jsonutils "yunion.io/x/jsonutils" "yunion.io/x/onecloud/pkg/apis" + "yunion.io/x/onecloud/pkg/apis/cloudprovider" ) // SAccessGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SAccessGroup. @@ -361,7 +361,6 @@ type SCloudproviderschedtag struct { type SCloudregion struct { apis.SEnabledStatusStandaloneResourceBase SI18nResourceBase - SManagedResourceBase apis.SExternalizedResourceBase cloudprovider.SGeographicInfo // 云环境 @@ -1194,7 +1193,7 @@ type SGuestnetwork struct { TxTrafficLimit int64 `json:"tx_traffic_limit"` TxTrafficUsed int64 `json:"tx_traffic_used"` // 网卡序号 - Index byte `json:"index"` + Index int `json:"index"` // 是否为虚拟接口(无IP) Virtual bool `json:"virtual"` // 虚拟网卡设备名称 @@ -1306,6 +1305,15 @@ type SHost struct { UefiInfo jsonutils.JSONObject `json:"uefi_info"` } +// SHostIsolatedDeviceModel is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostIsolatedDeviceModel. +type SHostIsolatedDeviceModel struct { + SHostJointsBase + // 宿主机Id + HostId string `json:"host_id"` + // 设备类型Id + IsolatedDeviceModelId string `json:"isolated_device_model_id"` +} + // SHostJointsBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SHostJointsBase. type SHostJointsBase struct { apis.SJointResourceBase @@ -1498,7 +1506,7 @@ type SIsolatedDevice struct { // 云主机Id GuestId string `json:"guest_id"` // guest network index - NetworkIndex byte `json:"network_index"` + NetworkIndex int `json:"network_index"` // Nic wire id WireId string `json:"wire_id"` // Offload interface name @@ -1551,6 +1559,8 @@ type SIsolatedDeviceModel struct { DeviceId string `json:"device_id"` DevType string `json:"dev_type"` HotPluggable *bool `json:"hot_pluggable,omitempty"` + // Disable auto detect isolated devices on host + DisableAutoDetect *bool `json:"disable_auto_detect,omitempty"` } // SKafka is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SKafka. diff --git a/pkg/apis/notify/zz_generated.model.go b/pkg/apis/notify/zz_generated.model.go index c1d014ba71..85258af44b 100644 --- a/pkg/apis/notify/zz_generated.model.go +++ b/pkg/apis/notify/zz_generated.model.go @@ -93,7 +93,7 @@ type SNotification struct { // SNotificationGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotificationGroup. type SNotificationGroup struct { - apis.SLogBase + Id string `json:"id"` GroupKey string `json:"group_key"` Title string `json:"title"` // swagger:ignore diff --git a/scripts/codegen.py b/scripts/codegen.py index a4dfc9cd50..e0a6ff7189 100755 --- a/scripts/codegen.py +++ b/scripts/codegen.py @@ -128,7 +128,7 @@ class ModelAPI(FuncDispatcher): def gen_cloudcommon(self): self.run(pkg=["cloudcommon", "db"]) self.run(pkg=["cloudcommon", "db", "proxy"], out=["cloudcommon", "proxy"]) - self.run_same("cloudprovider") + run_swagger_gen(['yunion.io/x/cloudmux/pkg/cloudprovider'], 'yunion.io/x/onecloud/pkg/apis/cloudprovider') self.run(pkg=["keystone", "models"], out=["identity"]) self.run_model("compute") self.run_model("image") diff --git a/vendor/modules.txt b/vendor/modules.txt index af8aa259b8..1b05fa11a1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1501,7 +1501,7 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240417101508-a89da4ad967d +# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240418034244-1a37b648d016 ## explicit; go 1.18 yunion.io/x/cloudmux/pkg/apis yunion.io/x/cloudmux/pkg/apis/billing @@ -1654,7 +1654,7 @@ yunion.io/x/pkg/utils # yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e ## explicit; go 1.12 yunion.io/x/s3cli -# yunion.io/x/sqlchemy v1.1.3-0.20240326090913-96da8bf92408 +# yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305 ## explicit; go 1.17 yunion.io/x/sqlchemy yunion.io/x/sqlchemy/backends diff --git a/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/cdn.go b/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/cdn.go index d6b73d9a5b..4fd1cae188 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/cdn.go +++ b/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/cdn.go @@ -77,6 +77,7 @@ func (self SCdnOrigins) String() string { } // 是否忽略参数 +// +onecloud:model-api-gen type SCDNCacheKeys struct { // 开启关闭忽略参数 Enabled *bool @@ -110,6 +111,7 @@ func (self SCDNCacheKeys) String() string { } // 是否分片回源 +// +onecloud:model-api-gen type SCDNRangeOriginPull struct { Enabled *bool RangeOriginPullRules []SRangeOriginPullRule @@ -143,6 +145,7 @@ type CacheRule struct { CacheTime int } +// +onecloud:model-api-gen type SCDNCache struct { RuleCache []SCacheRuleCache } @@ -186,6 +189,7 @@ func (self SCDNCache) String() string { return jsonutils.Marshal(self).String() } +// +onecloud:model-api-gen type SCDNHttps struct { // https 配置开关 Enabled *bool @@ -201,6 +205,7 @@ func (self SCDNHttps) String() string { return jsonutils.Marshal(self).String() } +// +onecloud:model-api-gen type SCDNForceRedirect struct { // 访问强制跳转配置开关 Enabled *bool @@ -230,6 +235,7 @@ type RefererRule struct { AllowEmpty *bool } +// +onecloud:model-api-gen type SCDNReferer struct { // 是否开启防盗链 Enabled *bool @@ -253,6 +259,7 @@ type SMaxAgeRule struct { } // 浏览器缓存配置 +// +onecloud:model-api-gen type SCDNMaxAge struct { Enabled *bool MaxAgeRules []SMaxAgeRule diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/ksyun/instances.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/ksyun/instances.go index efda6d2689..efcd7121b4 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/ksyun/instances.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/ksyun/instances.go @@ -126,6 +126,7 @@ type SInstance struct { DataDisks []DataDisks `json:"DataDisks"` VncSupport bool `json:"VncSupport"` Platform string `json:"Platform"` + ServiceEndTime time.Time `json:"ServiceEndTime"` } func (region *SRegion) GetInstances(zoneName string, instanceIds []string) ([]SInstance, error) { @@ -448,3 +449,7 @@ func (ins *SInstance) GetBillingType() string { func (ins *SInstance) GetCreatedAt() time.Time { return ins.CreationDate } + +func (ins *SInstance) GetExpiredAt() time.Time { + return ins.ServiceEndTime +} diff --git a/vendor/yunion.io/x/sqlchemy/table.go b/vendor/yunion.io/x/sqlchemy/table.go index 574f86ae5e..73483c91b3 100644 --- a/vendor/yunion.io/x/sqlchemy/table.go +++ b/vendor/yunion.io/x/sqlchemy/table.go @@ -173,11 +173,20 @@ func (ts *STableSpec) SyncColumnIndexes() error { cols, err := ts.Database().backend.FetchTableColumnSpecs(ts) if err != nil { - log.Errorf("fetchColumnDefs fail: %s", err) return errors.Wrap(err, "FetchTableColumnSpecs") } if len(cols) != len(ts._columns) { - return errors.Wrapf(errors.ErrInvalidStatus, "ts col %d != actual col %d", len(ts._columns), len(cols)) + colsName := map[string]bool{} + for _, col := range ts._columns { + colsName[col.Name()] = true + } + removed := []string{} + for _, col := range cols { + if _, ok := colsName[col.Name()]; !ok { + removed = append(removed, col.Name()) + } + } + return errors.Wrapf(errors.ErrInvalidStatus, "ts %s col %d != actual col %d need remove columns %s", ts.Name(), len(ts._columns), len(cols), removed) } for i := range cols { cols[i].SetColIndex(i)