From 9e0af6d12c3a875cd72331471844fb920e7bcf1e Mon Sep 17 00:00:00 2001 From: lixiaojun Date: Tue, 31 Dec 2019 11:55:02 +0800 Subject: [PATCH 1/3] update gendoc --- go.mod | 2 +- go.sum | 2 ++ vendor/github.com/spf13/cobra/doc/douku_docs.go | 5 ----- vendor/modules.txt | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index c6546acb02..c8c3631eef 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index cb01cf568d..420a09d651 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/github.com/spf13/cobra/doc/douku_docs.go b/vendor/github.com/spf13/cobra/doc/douku_docs.go index fbb9fb0309..7b5aa27baa 100644 --- a/vendor/github.com/spf13/cobra/doc/douku_docs.go +++ b/vendor/github.com/spf13/cobra/doc/douku_docs.go @@ -14,7 +14,6 @@ package doc import ( - "fmt" "io" "os" "path/filepath" @@ -53,10 +52,6 @@ func GenDoukuTreeCustom(index int, cmd *cobra.Command, dir string, filePrepender return err } - if _, err := io.WriteString(f, fmt.Sprintf("{{indexmenu_n>%d}}\n\n", index)); err != nil { - return err - } - if err := GenMarkdownCustom(cmd, f, linkHandler); err != nil { return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 64058b2eae..931572babf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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 From de2f3ac8dc50bfc33478507bddb16e799eb6a22c Mon Sep 17 00:00:00 2001 From: lixiaojun Date: Fri, 14 Feb 2020 10:49:01 +0800 Subject: [PATCH 2/3] create uhost without data disk --- cmd/uhost.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/uhost.go b/cmd/uhost.go index f5ba623b86..cbb41f85aa 100644 --- a/cmd/uhost.go +++ b/cmd/uhost.go @@ -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) @@ -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'.") @@ -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") From b9e2b89f7c63a7f4d0239275e0d8e6b574d6f45f Mon Sep 17 00:00:00 2001 From: lixiaojun Date: Fri, 14 Feb 2020 10:52:31 +0800 Subject: [PATCH 3/3] ucloud 0.1.30 --- Makefile | 2 +- base/config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 838b3f591a..3c505f6f45 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -export VERSION=0.1.29 +export VERSION=0.1.30 .PHONY : install install: diff --git a/base/config.go b/base/config.go index f7323b11dc..91a6379a7c 100644 --- a/base/config.go +++ b/base/config.go @@ -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{