mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: unify lb charge type (#24271)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -112,7 +112,7 @@ type SLoadbalancer struct {
|
||||
SLoadbalancerClusterResourceBase
|
||||
|
||||
// 计费类型
|
||||
ChargeType string `list:"user" get:"user" create:"optional" update:"user" json:"charge_type"`
|
||||
SBillingChargeTypeBase
|
||||
|
||||
// 套餐名称
|
||||
LoadbalancerSpec string `list:"user" get:"user" list:"user" create:"optional" json:"loadbalancer_spec"`
|
||||
@@ -1138,7 +1138,7 @@ func (region *SCloudregion) newFromCloudLoadbalancer(ctx context.Context, userCr
|
||||
|
||||
lb.Status = ext.GetStatus()
|
||||
lb.LoadbalancerSpec = ext.GetLoadbalancerSpec()
|
||||
lb.ChargeType = ext.GetChargeType()
|
||||
lb.ChargeType = billing_api.ParseNetChargeType(ext.GetChargeType())
|
||||
lb.EgressMbps = ext.GetEgressMbps()
|
||||
lb.ExternalId = ext.GetGlobalId()
|
||||
lbNetworkIds := getExtLbNetworkIds(ext, lb.ManagerId)
|
||||
@@ -1458,7 +1458,7 @@ func (lb *SLoadbalancer) syncWithCloudLoadbalancer(ctx context.Context, userCred
|
||||
lb.Status = ext.GetStatus()
|
||||
lb.LoadbalancerSpec = ext.GetLoadbalancerSpec()
|
||||
lb.EgressMbps = ext.GetEgressMbps()
|
||||
lb.ChargeType = ext.GetChargeType()
|
||||
lb.ChargeType = billing_api.ParseNetChargeType(ext.GetChargeType())
|
||||
lbNetworkIds := getExtLbNetworkIds(ext, lb.ManagerId)
|
||||
lb.NetworkId = strings.Join(lbNetworkIds, ",")
|
||||
if len(lb.VpcId) == 0 {
|
||||
|
||||
@@ -143,7 +143,7 @@ func (self *SManagedVirtualizationRegionDriver) RequestCreateLoadbalancerInstanc
|
||||
Desc: lb.Description,
|
||||
Address: lb.Address,
|
||||
AddressType: lb.AddressType,
|
||||
ChargeType: lb.ChargeType,
|
||||
ChargeType: string(lb.ChargeType),
|
||||
EgressMbps: lb.EgressMbps,
|
||||
LoadbalancerSpec: lb.LoadbalancerSpec,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user