@@ -19,6 +19,7 @@ import (
1919 "strconv"
2020
2121 "github.com/spf13/cobra"
22+ . "github.com/ucloud/ucloud-cli/util"
2223)
2324
2425//NewCmdGssh ucloud gssh
@@ -37,15 +38,15 @@ func NewCmdGssh() *cobra.Command {
3738
3839//NewCmdGsshList ucloud gssh list
3940func NewCmdGsshList () * cobra.Command {
40- req := client .NewDescribeGlobalSSHInstanceRequest ()
41+ req := BizClient .NewDescribeGlobalSSHInstanceRequest ()
4142 var cmd = & cobra.Command {
4243 Use : "ls" ,
4344 Short : "List all GlobalSSH instances" ,
4445 Long : `List all GlobalSSH instances` ,
4546 Example : "ucloud gssh ls" ,
4647 Run : func (cmd * cobra.Command , args []string ) {
4748 bindGlobalParam (req )
48- resp , err := client .DescribeGlobalSSHInstance (req )
49+ resp , err := BizClient .DescribeGlobalSSHInstance (req )
4950 if err != nil {
5051 fmt .Println ("Error" , err )
5152 } else {
@@ -64,7 +65,7 @@ func NewCmdGsshList() *cobra.Command {
6465
6566//NewCmdGsshCreate ucloud gssh create
6667func NewCmdGsshCreate () * cobra.Command {
67- var gsshCreateReq = client .NewCreateGlobalSSHInstanceRequest ()
68+ var gsshCreateReq = BizClient .NewCreateGlobalSSHInstanceRequest ()
6869 var cmd = & cobra.Command {
6970 Use : "create" ,
7071 Short : "Create GlobalSSH instance" ,
@@ -97,7 +98,7 @@ func NewCmdGsshCreate() *cobra.Command {
9798 fmt .Println ("Area should be one of LosAngeles,Singapore,HongKong,Tokyo,Washington,Frankfurt." )
9899 return
99100 }
100- resp , err := client .CreateGlobalSSHInstance (gsshCreateReq )
101+ resp , err := BizClient .CreateGlobalSSHInstance (gsshCreateReq )
101102 if err != nil {
102103 fmt .Println ("Error:" , err )
103104 } else {
@@ -122,7 +123,7 @@ func NewCmdGsshCreate() *cobra.Command {
122123
123124//NewCmdGsshDelete ucloud gssh delete
124125func NewCmdGsshDelete () * cobra.Command {
125- var gsshDeleteReq = client .NewDeleteGlobalSSHInstanceRequest ()
126+ var gsshDeleteReq = BizClient .NewDeleteGlobalSSHInstanceRequest ()
126127 var gsshIds []string
127128 var cmd = & cobra.Command {
128129 Use : "delete" ,
@@ -134,10 +135,10 @@ func NewCmdGsshDelete() *cobra.Command {
134135 for _ , id := range gsshIds {
135136 gsshDeleteReq .InstanceId = id
136137
137- if global .projectID != "" {
138- gsshDeleteReq .ProjectId = global .projectID
139- }
140- resp , err := client .DeleteGlobalSSHInstance (gsshDeleteReq )
138+ // if global.projectID != "" {
139+ // gsshDeleteReq.ProjectId = global.projectID
140+ // }
141+ resp , err := BizClient .DeleteGlobalSSHInstance (gsshDeleteReq )
141142 if err != nil {
142143 fmt .Println ("Error:" , err )
143144 } else {
@@ -157,8 +158,8 @@ func NewCmdGsshDelete() *cobra.Command {
157158
158159//NewCmdGsshModify ucloud gssh modify
159160func NewCmdGsshModify () * cobra.Command {
160- var gsshModifyPortReq = client .NewModifyGlobalSSHPortRequest ()
161- var gsshModifyRemarkReq = client .NewModifyGlobalSSHRemarkRequest ()
161+ var gsshModifyPortReq = BizClient .NewModifyGlobalSSHPortRequest ()
162+ var gsshModifyRemarkReq = BizClient .NewModifyGlobalSSHRemarkRequest ()
162163 var cmd = & cobra.Command {
163164 Use : "modify" ,
164165 Short : "Modify GlobalSSH instance" ,
@@ -181,7 +182,7 @@ func NewCmdGsshModify() *cobra.Command {
181182 return
182183 }
183184 gsshModifyPortReq .InstanceId = gsshModifyRemarkReq .InstanceId
184- resp , err := client .ModifyGlobalSSHPort (gsshModifyPortReq )
185+ resp , err := BizClient .ModifyGlobalSSHPort (gsshModifyPortReq )
185186 if err != nil {
186187 fmt .Println ("Error:" , err )
187188 } else {
@@ -193,7 +194,7 @@ func NewCmdGsshModify() *cobra.Command {
193194 }
194195 }
195196 if gsshModifyRemarkReq .Remark != "" {
196- resp , err := client .ModifyGlobalSSHRemark (gsshModifyRemarkReq )
197+ resp , err := BizClient .ModifyGlobalSSHRemark (gsshModifyRemarkReq )
197198 if err != nil {
198199 fmt .Println ("Error:" , err )
199200 } else {
0 commit comments