Merge pull request #12845 from ioito/hotfix/qx-qcloud-kafka-fix

fix(region): kafka data
This commit is contained in:
Zexi Li
2021-12-09 00:58:37 +08:00
committed by GitHub
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ type SKafka struct {
// 存储类型
// example: local_ssd
StorageType string `nullable:"false" list:"user" create:"required"`
StorageType string `nullable:"true" list:"user" create:"required"`
// 存储大小
// example: 1024
DiskSizeGb int `nullable:"false" list:"user" create:"required"`
+11 -2
View File
@@ -17,6 +17,7 @@ package qcloud
import (
"fmt"
"strings"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
@@ -97,6 +98,14 @@ func (self *SKafka) GetBillingType() string {
return billing_api.BILLING_TYPE_PREPAID
}
func (self *SKafka) GetCreatedAt() time.Time {
return time.Unix(int64(self.CreateTime), 0)
}
func (self *SKafka) GetExpiredAt() time.Time {
return time.Unix(int64(self.ExpireTime), 0)
}
func (self *SKafka) GetInstanceType() string {
return self.InstanceType
}
@@ -114,11 +123,11 @@ func (self *SKafka) IsMultiAz() bool {
}
func (self *SKafka) GetBandwidthMb() int {
return self.Bandwidth
return self.Bandwidth / 8
}
func (self *SKafka) GetStorageType() string {
return ""
return self.DiskType
}
func (self *SKafka) GetEndpoint() string {