Skip to content

Commit

Permalink
Merge pull request #20 from lixiaojun629/develop
Browse files Browse the repository at this point in the history
use go modules & bugfix
  • Loading branch information
lixiaojun629 authored Mar 13, 2019
2 parents 1241e33 + ecf72c2 commit 558e18f
Show file tree
Hide file tree
Showing 627 changed files with 101 additions and 198,769 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## Change Log
v0.1.7
* Add udpn, firewall, shared bandwidth and bandwidth package; Refactor vpc, subnet and eip

v0.1.6
* Improve uhost,image and disk-snapshot

v0.1.5
* support batch operation.

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export VERSION=0.1.10
export VERSION=0.1.11

.PHONY : build
build:
go install && mv ../../../../bin/ucloud-cli /usr/local/bin/ucloud
go install && mv ${GOPATH}/bin/ucloud-cli /usr/local/bin/ucloud

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

//Version 版本号
const Version = "0.1.10"
const Version = "0.1.11"

//ConfigIns 配置实例, 程序加载时生成
var ConfigIns = &AggConfig{}
Expand Down
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ func initialize(cmd *cobra.Command) {
}

if global.Debug {
log.SetLevel(log.DebugLevel)
base.ClientConfig.LogLevel = log.DebugLevel
base.BizClient = base.NewClient(base.ClientConfig, base.AuthCredential)
}

userInfo, err := base.LoadUserInfo()
Expand Down
5 changes: 2 additions & 3 deletions cmd/uhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ func NewCmdUHostClone(out io.Writer) *cobra.Command {
req := base.BizClient.NewCreateUHostInstanceRequest()
cmd := &cobra.Command{
Use: "clone",
Short: "Create an uhost with the same configuration as another uhost",
Short: "Create an uhost with the same configuration as another uhost, excluding bound eip and udisk",
Long: "Create an uhost with the same configuration as another uhost, excluding bound eip and udisk",
Run: func(com *cobra.Command, args []string) {
*uhostID = base.PickResourceID(*uhostID)
Expand Down Expand Up @@ -719,8 +719,7 @@ func NewCmdUHostClone(out io.Writer) *cobra.Command {
req.UHostType = &uhostIns.UHostType
req.NetCapability = &uhostIns.NetCapability

for index := 0; index < 2; index++ {
disk := uhostIns.DiskSet[index]
for _, disk := range uhostIns.DiskSet {
item := uhost.UHostDisk{
Size: sdk.Int(disk.Size),
Type: sdk.String(disk.DiskType),
Expand Down
11 changes: 10 additions & 1 deletion cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ func bindZone(req request.Common, flags *pflag.FlagSet) {
req.SetZoneRef(&zone)
}

func bindZoneEmpty(req request.Common, flags *pflag.FlagSet) {
var zone string
flags.StringVar(&zone, "zone", "", "Optional. Override default availability zone, see 'ucloud region'")
flags.SetFlagValuesFunc("zone", func() []string {
return getZoneList(req.GetRegion())
})
req.SetZoneRef(&zone)
}

func bindZoneS(zone, region *string, flags *pflag.FlagSet) {
*zone = base.ConfigIns.Zone
flags.StringVar(zone, "zone", base.ConfigIns.Zone, "Optional. Override default availability zone, see 'ucloud region'")
Expand Down Expand Up @@ -75,7 +84,7 @@ func bindOffset(req interface{}, flags *pflag.FlagSet) {
}

func bindChargeType(req interface{}, flags *pflag.FlagSet) {
chargeType := flags.String("charge-type", "Month", "Optional. Enumeration value.'Year',pay yearly;'Month',pay monthly;'Dynamic', pay hourly(requires permission),'Trial', free trial(need permission)")
chargeType := flags.String("charge-type", "Month", "Optional. Enumeration value.'Year',pay yearly;'Month',pay monthly; 'Dynamic', pay hourly; 'Trial', free trial(need permission)")
v := reflect.ValueOf(req).Elem()
f := v.FieldByName("ChargeType")
f.Set(reflect.ValueOf(chargeType))
Expand Down
14 changes: 14 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module github.com/ucloud/ucloud-cli

go 1.12

require (
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/ucloud/ucloud-sdk-go v0.7.3
)

replace (
github.com/spf13/cobra v0.0.3 => github.com/lixiaojun629/cobra v0.0.5
github.com/spf13/pflag v1.0.3 => github.com/lixiaojun629/pflag v1.0.5
)
64 changes: 64 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man v1.0.8/go.mod h1:N6JayAiVKtlHSnuTCeuLSQVs75hb8q+dYQLjr7cDsKY=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/lixiaojun629/cobra v0.0.5 h1:zGL+RRJEFBUrwy3Ehni/1uVe1K7KtbbCEtz1vD5o7zs=
github.com/lixiaojun629/cobra v0.0.5/go.mod h1:/UrNgAugHQZNoelw+TjY7C7OUQZT6O+B5EzpqMiSUkA=
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=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME=
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/viper v1.3.1 h1:5+8j8FTpnFV4nEImW/ofkzEt8VoOiLXxdYIDsB73T38=
github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/ucloud/ucloud-sdk-go v0.7.3 h1:gGygQn+wcSJIiB6xRAmfwLP/MI3p5yt2mxD4ruPU+Lk=
github.com/ucloud/ucloud-sdk-go v0.7.3/go.mod h1:lM6fpI8y6iwACtlbHUav823/uKPdXsNBlnBpRF2fj3c=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a h1:1n5lsVfiQW3yfsRGu98756EH1YthsFqr/5mxHduZW2A=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
177 changes: 0 additions & 177 deletions vendor/github.com/Sirupsen/logrus/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/Sirupsen/logrus/LICENSE

This file was deleted.

Loading

0 comments on commit 558e18f

Please sign in to comment.