|
Expand Up
|
@@ -26,6 +26,7 @@ import ( |
|
|
sdk "github.com/ucloud/ucloud-sdk-go/ucloud" |
|
|
|
|
|
"github.com/ucloud/ucloud-cli/base" |
|
|
"github.com/ucloud/ucloud-cli/pkg/command" |
|
|
) |
|
|
|
|
|
// NewCmdGssh ucloud gssh |
|
Expand Down
Expand Up
|
@@ -200,12 +201,12 @@ func NewCmdGsshCreate() *cobra.Command { |
|
|
req.BandwidthPackage = cmd.Flags().Int("bandwidth-package", 0, "Optional. You can set one of 0, 20, 40 When instance-type is 'Ultimate'") |
|
|
cmd.MarkFlagRequired("location") |
|
|
cmd.MarkFlagRequired("target-ip") |
|
|
cmd.Flags().SetFlagValues("location", "LosAngeles", "Singapore", "Lagos", "HongKong", "Tokyo", "Washington", "Frankfurt") |
|
|
cmd.Flags().SetFlagValues("charge-type", "Month", "Year", "Dynamic", "Trial") |
|
|
cmd.Flags().SetFlagValues("bandwidth-package", "0", "20", "40") |
|
|
cmd.Flags().SetFlagValues("forward-region", "cn-bj2", "cn-sh2", "cn-gd") |
|
|
cmd.Flags().SetFlagValues("instance-type", "Free", "Basic", "Enterprise", "Ultimate") |
|
|
cmd.Flags().SetFlagValuesFunc("target-ip", func() []string { |
|
|
command.SetFlagValues(cmd, "location", "LosAngeles", "Singapore", "Lagos", "HongKong", "Tokyo", "Washington", "Frankfurt") |
|
|
command.SetFlagValues(cmd, "charge-type", "Month", "Year", "Dynamic", "Trial") |
|
|
command.SetFlagValues(cmd, "bandwidth-package", "0", "20", "40") |
|
|
command.SetFlagValues(cmd, "forward-region", "cn-bj2", "cn-sh2", "cn-gd") |
|
|
command.SetFlagValues(cmd, "instance-type", "Free", "Basic", "Enterprise", "Ultimate") |
|
|
command.SetCompletion(cmd, "target-ip", func() []string { |
|
|
eips := getAllEip(*req.ProjectId, base.ConfigIns.Region, nil, nil) |
|
|
for idx, eip := range eips { |
|
|
eips[idx] = strings.SplitN(eip, "/", 2)[1] |
|
Expand Down
Expand Up
|
@@ -242,7 +243,7 @@ func NewCmdGsshDelete() *cobra.Command { |
|
|
gsshIds = cmd.Flags().StringSlice("gssh-id", make([]string, 0), "Required. ID of the GlobalSSH instances you want to delete. Multiple values specified by multiple commas") |
|
|
bindProjectID(req, flags) |
|
|
cmd.MarkFlagRequired("gssh-id") |
|
|
cmd.Flags().SetFlagValuesFunc("gssh-id", func() []string { |
|
|
command.SetCompletion(cmd, "gssh-id", func() []string { |
|
|
return getAllGsshIDNames(*req.ProjectId) |
|
|
}) |
|
|
return cmd |
|
Expand Down
Expand Up
|
@@ -302,7 +303,7 @@ func NewCmdGsshModify() *cobra.Command { |
|
|
gsshModifyPortReq.Port = cmd.Flags().Int("port", 0, "Optional. Port of SSH service.") |
|
|
gsshModifyRemarkReq.Remark = cmd.Flags().String("remark", "", "Optional. Remark of your GlobalSSH.") |
|
|
cmd.MarkFlagRequired("gssh-id") |
|
|
cmd.Flags().SetFlagValuesFunc("gssh-id", func() []string { |
|
|
command.SetCompletion(cmd, "gssh-id", func() []string { |
|
|
return getAllGsshIDNames(project) |
|
|
}) |
|
|
return cmd |
|
Expand Down
|
|