Skip to content

Commit f6fa9f3

Browse files
authored
Merge pull request #1694 from ioito/hotfix/qx-ksyun-vm-charge-type
fix(region): ksyun charge type
2 parents d80d7fe + 68274ee commit f6fa9f3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pkg/cloudprovider/instance.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ type SManagedVMCreateConfig struct {
161161
ProjectId string
162162
EnableMonitorAgent bool
163163

164+
// 金山云按量付费类型
165+
// Daily(按量付费(按日月结))、 HourlyInstantSettlement(按量付费(按小时月结))
166+
KsyunPostpaidChargeType string
167+
164168
SPublicIpInfo
165169

166170
Tags map[string]string

pkg/multicloud/ksyun/host.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"yunion.io/x/cloudmux/pkg/cloudprovider"
2323
"yunion.io/x/cloudmux/pkg/multicloud"
2424
"yunion.io/x/pkg/errors"
25+
"yunion.io/x/pkg/utils"
2526

2627
"yunion.io/x/jsonutils"
2728
)
@@ -92,6 +93,9 @@ func (region *SRegion) CreateVM(opts *cloudprovider.SManagedVMCreateConfig) (*SI
9293
"SystemDisk.DiskSize": fmt.Sprintf("%d", opts.SysDisk.SizeGB),
9394
"SyncTag": "true",
9495
}
96+
if utils.IsInStringArray(opts.KsyunPostpaidChargeType, []string{"HourlyInstantSettlement", "Daily"}) {
97+
params["ChargeType"] = opts.KsyunPostpaidChargeType
98+
}
9599
if len(opts.Hostname) > 0 {
96100
params["HostName"] = opts.Hostname
97101
}

0 commit comments

Comments
 (0)