Skip to content

Commit

Permalink
Merge pull request #48 from lixiaojun629/develop
Browse files Browse the repository at this point in the history
0.1.30
  • Loading branch information
lixiaojun629 committed Feb 14, 2020
2 parents 82051a9 + b9e2b89 commit 9664593
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export VERSION=0.1.29
export VERSION=0.1.30

.PHONY : install
install:
Expand Down
2 changes: 1 addition & 1 deletion base/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const DefaultBaseURL = "https://api.ucloud.cn/"
const DefaultProfile = "default"

//Version 版本号
const Version = "0.1.29"
const Version = "0.1.30"

//ConfigIns 配置实例, 程序加载时生成
var ConfigIns = &AggConfig{
Expand Down
13 changes: 8 additions & 5 deletions cmd/uhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ func NewCmdUHostCreate() *cobra.Command {
req.SubnetId = sdk.String(base.PickResourceID(*req.SubnetId))
req.SecurityGroupId = sdk.String(base.PickResourceID(*req.SecurityGroupId))
req.IsolationGroup = sdk.String(base.PickResourceID(*req.IsolationGroup))
if *req.Disks[1].Type == "NONE" || *req.Disks[1].Type == "" {
req.Disks = req.Disks[:1]
}
if hotPlug == "true" {
req.HotplugFeature = sdk.Bool(true)
any, err := describeImageByID(*req.ImageId, *req.ProjectId, *req.Region, *req.Zone)
Expand Down Expand Up @@ -400,16 +403,16 @@ func NewCmdUHostCreate() *cobra.Command {
bindRegion(req, flags)
bindZone(req, flags)

req.MachineType = flags.String("machine-type", "", "Optional. Accept values: N, C, G, O. Forward to https://docs.ucloud.cn/api/uhost-api/uhost_type for details")
req.MachineType = flags.String("machine-type", "N", "Optional. Accept values: N, C, G, O. Forward to https://docs.ucloud.cn/api/uhost-api/uhost_type for details")
req.MinimalCpuPlatform = flags.String("minimal-cpu-platform", "", "Optional. Accpet values: Intel/Auto, Intel/IvyBridge, Intel/Haswell, Intel/Broadwell, Intel/Skylake, Intel/Cascadelake")
req.UHostType = flags.String("type", "", "Optional. Accept values: N1, N2, N3, G1, G2, G3, I1, I2, C1. Forward to https://docs.ucloud.cn/api/uhost-api/uhost_type for details")
req.GPU = flags.Int("gpu", 0, "Optional. The count of GPU cores.")
req.NetCapability = flags.String("net-capability", "Normal", "Optional. Default is 'Normal', also support 'Super' which will enhance multiple times network capability as before")
req.NetCapability = flags.String("net-capability", "Normal", "Optional. Accept values: Normal, Super and Ultra. 'Normal' will disable network enhancement. 'Super' will enable network enhancement 1.0. 'Ultra' will enable network enhancement 2.0")
flags.StringVar(&hotPlug, "hot-plug", "true", "Optional. Enable hot plug feature or not. Accept values: true or false")
req.Disks[0].Type = flags.String("os-disk-type", "CLOUD_SSD", "Optional. Enumeration value. 'LOCAL_NORMAL', Ordinary local disk; 'CLOUD_NORMAL', Ordinary cloud disk; 'LOCAL_SSD',local ssd disk; 'CLOUD_SSD',cloud ssd disk; 'EXCLUSIVE_LOCAL_DISK',big data. The disk only supports a limited combination.")
req.Disks[0].Size = flags.Int("os-disk-size-gb", 20, "Optional. Default 20G. Windows should be bigger than 40G Unit GB")
req.Disks[0].BackupType = flags.String("os-disk-backup-type", "NONE", "Optional. Enumeration value, 'NONE' or 'DATAARK'. DataArk supports real-time backup, which can restore the disk back to any moment within the last 12 hours. (Normal Local Disk and Normal Cloud Disk Only)")
req.Disks[1].Type = flags.String("data-disk-type", "CLOUD_SSD", "Optional. Enumeration value. 'LOCAL_NORMAL', Ordinary local disk; 'CLOUD_NORMAL', Ordinary cloud disk; 'LOCAL_SSD',local ssd disk; 'CLOUD_SSD',cloud ssd disk; 'EXCLUSIVE_LOCAL_DISK',big data. The disk only supports a limited combination.")
req.Disks[1].Type = flags.String("data-disk-type", "CLOUD_SSD", "Optional. Accept values: 'LOCAL_NORMAL','LOCAL_SSD','CLOUD_NORMAL',CLOUD_SSD','CLOUD_RSSD','EXCLUSIVE_LOCAL_DISK' and 'NONE'. 'LOCAL_NORMAL', Ordinary local disk; 'CLOUD_NORMAL', Ordinary cloud disk; 'LOCAL_SSD',local ssd disk; 'CLOUD_SSD',cloud ssd disk; 'CLOUD_RSSD', coud rssd disk; 'EXCLUSIVE_LOCAL_DISK',big data. The disk only supports a limited combination. 'NONE', create uhost without data disk. More details https://docs.ucloud.cn/api/uhost-api/disk_type")
req.Disks[1].Size = flags.Int("data-disk-size-gb", 20, "Optional. Disk size. Unit GB")
req.Disks[1].BackupType = flags.String("data-disk-backup-type", "NONE", "Optional. Enumeration value, 'NONE' or 'DATAARK'. DataArk supports real-time backup, which can restore the disk back to any moment within the last 12 hours. (Normal Local Disk and Normal Cloud Disk Only)")
req.SecurityGroupId = flags.String("firewall-id", "", "Optional. Firewall Id, default: Web recommended firewall. see 'ucloud firewall list'.")
Expand All @@ -423,10 +426,10 @@ func NewCmdUHostCreate() *cobra.Command {
flags.SetFlagValues("type", "N2", "N1", "N3", "I2", "I1", "C1", "G1", "G2", "G3")
flags.SetFlagValues("machine-type", "N", "C", "G", "O")
flags.SetFlagValues("minimal-cpu-platform", "Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake")
flags.SetFlagValues("net-capability", "Normal", "Super")
flags.SetFlagValues("net-capability", "Normal", "Super", "Ultra")
flags.SetFlagValues("os-disk-type", "LOCAL_NORMAL", "CLOUD_NORMAL", "LOCAL_SSD", "CLOUD_SSD", "CLOUD_RSSD", "EXCLUSIVE_LOCAL_DISK")
flags.SetFlagValues("os-disk-backup-type", "NONE", "DATAARK")
flags.SetFlagValues("data-disk-type", "LOCAL_NORMAL", "CLOUD_NORMAL", "LOCAL_SSD", "CLOUD_SSD", "EXCLUSIVE_LOCAL_DISK")
flags.SetFlagValues("data-disk-type", "LOCAL_NORMAL", "CLOUD_NORMAL", "LOCAL_SSD", "CLOUD_SSD", "CLOUD_RSSD", "EXCLUSIVE_LOCAL_DISK", "NONE")
flags.SetFlagValues("data-disk-backup-type", "NONE", "DATAARK")
flags.SetFlagValues("create-eip-line", "BGP", "International")
flags.SetFlagValues("create-eip-traffic-mode", "Bandwidth", "Traffic", "ShareBandwidth")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ require (
)

replace (
github.com/spf13/cobra v0.0.3 => github.com/lixiaojun629/cobra v0.0.9
github.com/spf13/cobra v0.0.3 => github.com/lixiaojun629/cobra v0.0.10
github.com/spf13/pflag v1.0.3 => github.com/lixiaojun629/pflag v1.0.5
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lixiaojun629/cobra v0.0.9 h1:wk3qMaSJ/wpQMfGiaj+m6tV+Qp5gxtIIlabF3wG7WHo=
github.com/lixiaojun629/cobra v0.0.9/go.mod h1:6VKYqzoixuRlMBmzm3rHPS0sRYVhT3zXEfrt+Qf8eMs=
github.com/lixiaojun629/cobra v0.0.10 h1:t/BZXAogMO3W4Y2OxcE/W8SOhfVcbSL0LwINfoYVFCI=
github.com/lixiaojun629/cobra v0.0.10/go.mod h1:6VKYqzoixuRlMBmzm3rHPS0sRYVhT3zXEfrt+Qf8eMs=
github.com/lixiaojun629/pflag v1.0.5 h1:plFJ2SBJd2S2Fc7ZwwFZ3682IvxBiUkhRuJS40OvEMs=
github.com/lixiaojun629/pflag v1.0.5/go.mod h1:uchrjsiFxJj1XOBpO4YJCZwpqXHsCHovxY91tyFoUrg=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
Expand Down
5 changes: 0 additions & 5 deletions vendor/github.com/spf13/cobra/doc/douku_docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ github.com/russross/blackfriday
github.com/satori/go.uuid
# github.com/sirupsen/logrus v1.3.0
github.com/sirupsen/logrus
# github.com/spf13/cobra v0.0.3 => github.com/lixiaojun629/cobra v0.0.9
# github.com/spf13/cobra v0.0.3 => github.com/lixiaojun629/cobra v0.0.10
github.com/spf13/cobra
github.com/spf13/cobra/doc
# github.com/spf13/pflag v1.0.3 => github.com/lixiaojun629/pflag v1.0.5
Expand Down

0 comments on commit 9664593

Please sign in to comment.