11package subnet
22
33import (
4- "strconv"
5-
4+ "fmt"
65 "github.com/spf13/cobra"
76 "github.ibm.com/SoftLayer/softlayer-cli/plugin/errors"
87 slErr "github.ibm.com/SoftLayer/softlayer-cli/plugin/errors"
98 . "github.ibm.com/SoftLayer/softlayer-cli/plugin/i18n"
109 "github.ibm.com/SoftLayer/softlayer-cli/plugin/managers"
1110 "github.ibm.com/SoftLayer/softlayer-cli/plugin/metadata"
1211 "github.ibm.com/SoftLayer/softlayer-cli/plugin/utils"
12+ "strconv"
13+ "strings"
14+
1315)
1416
1517type CreateCommand struct {
@@ -22,27 +24,22 @@ type CreateCommand struct {
2224}
2325
2426func NewCreateCommand (sl * metadata.SoftlayerCommand ) * CreateCommand {
25- thisCmd := & CreateCommand {
27+ thisCmd := & CreateCommand {
2628 SoftlayerCommand : sl ,
2729 NetworkManager : managers .NewNetworkManager (sl .Session ),
2830 }
2931 cobraCmd := & cobra.Command {
30- Use : "create" ,
32+ Use : "create" + strings . ToUpper ( fmt . Sprintf ( " %s %s %s" , T ( "Network" ), T ( "Quantity" ), T ( "VLAN" ))) ,
3133 Short : T ("Add a new subnet to your account" ),
32- Long : T (`${COMMAND_NAME} sl subnet create NETWORK QUANTITY VLAN_ID [OPTIONS]
33-
34- Add a new subnet to your account. Valid quantities vary by type.
35-
36- Type - Valid Quantities (IPv4)
37- public - 4, 8, 16, 32
38- private - 4, 8, 16, 32, 64
34+ Long : T (`Valid quantities vary by type.
3935
40- Type - Valid Quantities (IPv6)
41- public - 64
36+ - public IPv4: 4, 8, 16, 32
37+ - private IPv4: 4, 8, 16, 32, 64
38+ - public IPv6: 64
4239
4340EXAMPLE:
44- ${COMMAND_NAME} sl subnet create public 16 567
45- This command creates a public subnet with 16 IPv4 addresses and places it on vlan with ID 567.` ),
41+ ${COMMAND_NAME} sl subnet create public 16 567
42+ This command creates a public subnet with 16 IPv4 addresses and places it on vlan with ID 567.` ),
4643 Args : metadata .ThreeArgs ,
4744 RunE : func (cmd * cobra.Command , args []string ) error {
4845 return thisCmd .Run (args )
0 commit comments