Skip to content

Commit 955b031

Browse files
committed
change 'config_id' to 'config-id' for consistancy
1 parent 8a0f690 commit 955b031

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

cmd/cloudPrivateParentCreate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Private Parents must use a config of category 'bare-metal' or 'bare-metal-r'. Fo
3838
of configs, check 'cloud server options --configs'.`,
3939
Run: func(cmd *cobra.Command, args []string) {
4040
nameFlag, _ := cmd.Flags().GetString("name")
41-
configIdFlag, _ := cmd.Flags().GetInt64("config_id")
41+
configIdFlag, _ := cmd.Flags().GetInt64("config-id")
4242
zoneFlag, _ := cmd.Flags().GetInt64("zone")
4343

4444
validateFields := map[interface{}]interface{}{
@@ -69,11 +69,11 @@ of configs, check 'cloud server options --configs'.`,
6969
func init() {
7070
cloudPrivateParentCmd.AddCommand(cloudPrivateParentCreateCmd)
7171

72-
cloudPrivateParentCreateCmd.Flags().Int64("config_id", -1, "config_id (category must be bare-metal or bare-metal-r)")
72+
cloudPrivateParentCreateCmd.Flags().Int64("config-id", -1, "config-id (category must be bare-metal or bare-metal-r)")
7373
cloudPrivateParentCreateCmd.Flags().String("name", "", "name for your Private Parent")
7474
cloudPrivateParentCreateCmd.Flags().Int64("zone", -1, "id number of the zone to provision the Private Parent in ('cloud server options --zones')")
7575

76-
cloudPrivateParentCreateCmd.MarkFlagRequired("config_id")
76+
cloudPrivateParentCreateCmd.MarkFlagRequired("config-id")
7777
cloudPrivateParentCreateCmd.MarkFlagRequired("zone")
7878
cloudPrivateParentCreateCmd.MarkFlagRequired("name")
7979
}

cmd/cloudServerClone.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Server is not on a Private Parent.`,
5656
diskspaceFlag, _ := cmd.Flags().GetInt64("diskspace")
5757
memoryFlag, _ := cmd.Flags().GetInt64("memory")
5858
vcpuFlag, _ := cmd.Flags().GetInt64("vcpu")
59-
configIdFlag, _ := cmd.Flags().GetInt64("config_id")
59+
configIdFlag, _ := cmd.Flags().GetInt64("config-id")
6060

6161
validateFields := map[interface{}]interface{}{
6262
uniqIdFlag: "UniqId",
@@ -65,10 +65,10 @@ Server is not on a Private Parent.`,
6565
}
6666

6767
if privateParentFlag != "" && configIdFlag != -1 {
68-
lwCliInst.Die(fmt.Errorf("cant pass both --config_id and --private-parent flags"))
68+
lwCliInst.Die(fmt.Errorf("cant pass both --config-id and --private-parent flags"))
6969
}
7070
if privateParentFlag == "" && configIdFlag == -1 {
71-
lwCliInst.Die(fmt.Errorf("must pass --config_id or --private-parent"))
71+
lwCliInst.Die(fmt.Errorf("must pass --config-id or --private-parent"))
7272
}
7373

7474
var privateParentUniqId string
@@ -156,8 +156,8 @@ func init() {
156156
cloudServerCloneCmd.Flags().Int64("vcpu", -1, "amount of vcpus for new Cloud Server (when private-parent)")
157157

158158
// Non Private Parent
159-
cloudServerCloneCmd.Flags().Int64("config_id", -1,
160-
"config_id for new Cloud Server (when !private-parent) (see: 'cloud server options --configs')")
159+
cloudServerCloneCmd.Flags().Int64("config-id", -1,
160+
"config-id for new Cloud Server (when !private-parent) (see: 'cloud server options --configs')")
161161

162162
cloudServerCloneCmd.MarkFlagRequired("uniq-id")
163163
}

cmd/cloudServerCreate.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ Examples:
4343
# Create a Cloud Server on a Private Parent named "private"
4444
'cloud server create --private-parent private --memory 1024 --diskspace 40 --vcpu 2 --zone 40460 --template DEBIAN_10_UNMANAGED'
4545
46-
# Create a Cloud Server on config_id 1
47-
'cloud server create --config_id 1 --template DEBIAN_10_UNMANAGED --zone 40460'
46+
# Create a Cloud Server on config-id 1
47+
'cloud server create --config-id 1 --template DEBIAN_10_UNMANAGED --zone 40460'
4848
4949
# Create a Cloud Server from image id 111
50-
'cloud server create --image-id 111 --zone 40460 --config_id 1'
50+
'cloud server create --image-id 111 --zone 40460 --config-id 1'
5151
5252
# Create a Cloud Server from backup id 111
53-
'cloud server create --backup-id 111 --zone 40460 --config_id 1'
53+
'cloud server create --backup-id 111 --zone 40460 --config-id 1'
5454
5555
These examples use default values for various flags, such as password, type, ssh-key, hostname, etc.
5656
@@ -64,7 +64,7 @@ For a list of backups, see 'cloud backups list'
6464
hostnameFlag, _ := cmd.Flags().GetString("hostname")
6565
ipsFlag, _ := cmd.Flags().GetInt("ips")
6666
pubSshKeyFlag, _ := cmd.Flags().GetString("public-ssh-key")
67-
configIdFlag, _ := cmd.Flags().GetInt("config_id")
67+
configIdFlag, _ := cmd.Flags().GetInt("config-id")
6868
backupPlanFlag, _ := cmd.Flags().GetString("backup-plan")
6969
backupPlanQuotaFlag, _ := cmd.Flags().GetInt("backup-plan-quota")
7070
bandwidthFlag, _ := cmd.Flags().GetString("bandwidth")
@@ -81,7 +81,7 @@ For a list of backups, see 'cloud backups list'
8181

8282
// sanity check flags
8383
if configIdFlag == 0 && privateParentFlag == "" {
84-
lwCliInst.Die(fmt.Errorf("--config_id is a required flag without --private-parent"))
84+
lwCliInst.Die(fmt.Errorf("--config-id is a required flag without --private-parent"))
8585
}
8686
if templateFlag == "" && backupIdFlag == -1 && imageIdFlag == -1 {
8787
lwCliInst.Die(fmt.Errorf("at least one of the following flags must be set --template --image-id --backup-id"))
@@ -263,7 +263,7 @@ func init() {
263263
cloudServerCreateCmd.Flags().Int("ips", 1, "amount of IP addresses")
264264
cloudServerCreateCmd.Flags().String("public-ssh-key", sshPubKeyFile,
265265
"path to file containing the public ssh key you wish to be on the new Cloud Server")
266-
cloudServerCreateCmd.Flags().Int("config_id", 0, "config_id to use")
266+
cloudServerCreateCmd.Flags().Int("config-id", 0, "config-id to use")
267267
cloudServerCreateCmd.Flags().String("backup-plan", "None", "Cloud Server backup plan to use")
268268
cloudServerCreateCmd.Flags().Int("backup-plan-quota", 300, "Quota amount. Should only be used with '--backup-plan Quota'")
269269
cloudServerCreateCmd.Flags().String("bandwidth", "SS.10000", "bandwidth package to use")

cmd/cloudServerOptions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Use this when you need to get a list of available:
3535
3636
*) Regions/Zones
3737
*) Templates (cloud server images provided by LiquidWeb)
38-
*) config_id's (a config_id represents a type of server, for example, config_id 1234 might
38+
*) config-id's (a config-id represents a type of server, for example, config-id 1234 might
3939
represent a configuration with the following hardware specifications:
4040
*) 16GB RAM
4141
*) 300GB Disk
@@ -190,7 +190,7 @@ Be sure to take a look at the flags section for specific flags to pass.`,
190190
if configsFlag {
191191
fmt.Printf(" configs:\n")
192192
for _, cfgInfo := range info["configIds"].([]map[string]interface{}) {
193-
fmt.Printf(" config_id: %d\n", cfgInfo["config_id"])
193+
fmt.Printf(" config-id: %d\n", cfgInfo["config_id"])
194194
fmt.Printf(" description: %s\n", cfgInfo["description"])
195195
fmt.Printf(" active: %d\n", cfgInfo["active"])
196196
fmt.Printf(" available: %d\n", cfgInfo["available"])
@@ -240,7 +240,7 @@ func init() {
240240
cloudServerCmd.AddCommand(cloudServerOptionsCmd)
241241

242242
cloudServerOptionsCmd.Flags().Bool("json", false, "return data in json format. All template, config, zone, and region data will be returned with this option.")
243-
cloudServerOptionsCmd.Flags().Bool("configs", false, "fetch a list of available configs (config_id)")
243+
cloudServerOptionsCmd.Flags().Bool("configs", false, "fetch a list of available configs (config-id)")
244244
cloudServerOptionsCmd.Flags().String("config-category", "all", "valid options for category are storm, ssd, bare-metal and all. Only relevent when --configs is passed.")
245245
cloudServerOptionsCmd.Flags().Bool("zones", false, "fetch a list of available regions and their available zones")
246246
cloudServerOptionsCmd.Flags().Bool("templates", false, "fetch a list of available templates (cloud server images provided by LiquidWeb)")

cmd/cloudServerResize.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var cloudServerResizeCmd = &cobra.Command{
2929
Short: "Resize a Cloud Server",
3030
Long: `Resize a Cloud Server.
3131
32-
Resize a Cloud Server to a new config. Available config_ids can be found in
32+
Resize a Cloud Server to a new config. Available config-id's can be found in
3333
'cloud server options --configs'
3434
3535
You will be billed for the prorated difference of the price of the new
@@ -70,7 +70,7 @@ During all resizes, the Cloud Server is online as the disk synchronizes.
7070
Run: func(cmd *cobra.Command, args []string) {
7171
uniqIdFlag, _ := cmd.Flags().GetString("uniq-id")
7272
diskspaceFlag, _ := cmd.Flags().GetInt64("diskspace")
73-
configIdFlag, _ := cmd.Flags().GetInt64("config_id")
73+
configIdFlag, _ := cmd.Flags().GetInt64("config-id")
7474
memoryFlag, _ := cmd.Flags().GetInt64("memory")
7575
skipFsResizeFlag, _ := cmd.Flags().GetBool("skip-fs-resize")
7676
vcpuFlag, _ := cmd.Flags().GetInt64("vcpu")
@@ -91,7 +91,7 @@ During all resizes, the Cloud Server is online as the disk synchronizes.
9191
}
9292

9393
if configIdFlag == -1 && privateParentFlag == "" {
94-
lwCliInst.Die(fmt.Errorf("flag --config_id required when --private-parent is not given"))
94+
lwCliInst.Die(fmt.Errorf("flag --config-id required when --private-parent is not given"))
9595
}
9696

9797
resizeArgs := map[string]interface{}{
@@ -118,7 +118,7 @@ During all resizes, the Cloud Server is online as the disk synchronizes.
118118

119119
// if already on the given config, nothing to do
120120
if cloudServerDetails.ConfigId == configIdFlag {
121-
lwCliInst.Die(fmt.Errorf("already on config_id [%d]; not initiating a resize", configIdFlag))
121+
lwCliInst.Die(fmt.Errorf("already on config-id [%d]; not initiating a resize", configIdFlag))
122122
}
123123

124124
validateFields[configIdFlag] = "PositiveInt64"
@@ -276,8 +276,8 @@ func init() {
276276
cloudServerResizeCmd.Flags().Int64("memory", -1, "desired memory (when private-parent)")
277277
cloudServerResizeCmd.Flags().Bool("skip-fs-resize", false, "whether or not to skip the fs resize")
278278
cloudServerResizeCmd.Flags().Int64("vcpu", -1, "desired vcpu count (when private-parent)")
279-
cloudServerResizeCmd.Flags().Int64("config_id", -1,
280-
"config_id of your desired config (when !private-parent) (see 'cloud server options --configs')")
279+
cloudServerResizeCmd.Flags().Int64("config-id", -1,
280+
"config-id of your desired config (when !private-parent) (see 'cloud server options --configs')")
281281

282282
cloudServerResizeCmd.MarkFlagRequired("uniq-id")
283283
}

0 commit comments

Comments
 (0)