Skip to content

Commit f801c10

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #906 from SoftLayer/issues901
Updated vs upgrade help message
2 parents fb0918e + 506ad1f commit f801c10

File tree

14 files changed

+62
-40
lines changed

14 files changed

+62
-40
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,9 @@ func NewActionNameCommand(sl *metadata.SoftlayerCommand) *ActionNameCommand {
344344
Use: "command-name",
345345
Short: T("A description of the command"),
346346
Long: T(`This is an optional field, you can remove it if the command is simple.
347-
Otherwise create a nice long description of how to use this command. Its good to add some examples.
348-
349-
EXAMPLE:
350-
${COMMAND_NAME} sl newcommand command-name --someFlag test --soomethingElse
351-
This sets a flag and does something else.`)
347+
Otherwise create a nice long description of how to use this command. Its good to add some examples.`),
348+
Example: fmt.Sprintf(`${COMMAND_NAME} sl newcommand command-name --someFlag test --soomethingElse
349+
%s`, T(`This sets a flag and does something else.`)),
352350
Args: metadata.NoArgs,
353351
RunE: func(cmd *cobra.Command, args []string) error {
354352
return thisCmd.Run(args)
@@ -544,6 +542,23 @@ It("return error", func() {
544542
})
545543
```
546544
545+
## Adding Examples
546+
547+
Use the CobraCLI Example property when possible. `vs upgrade` for an example:
548+
549+
```go
550+
cobraCmd := &cobra.Command{
551+
Use: "upgrade " + T("IDENTIFIER"),
552+
Short: T("Upgrade a virtual server instance"),
553+
Long: T(`Note: This virtual server will be rebooted once the upgrade order is placed.
554+
The instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.`) + `
555+
` + T(`The -c and -m options are for dedicated VSI upgrade, most VSIs will need to upgrade with --flavor.
556+
See '${COMMAND_NAME} sl vs options' for flavor keyNames to use.`),
557+
Example: `${COMMAND_NAME} sl vs upgrade 12345678 --flavor B1_8X32X25`,
558+
```
559+
560+
This helps make the strings a bit easier to translate.
561+
547562
548563
# Plugin Support / Release Process
549564
After v1.4.1 `sl` will be a normal plugin, so where are the instructions to build the plugin.

plugin/commands/virtual/upgrade.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ func NewUpgradeCommand(sl *metadata.SoftlayerCommand) (cmd *UpgradeCommand) {
3636
Use: "upgrade " + T("IDENTIFIER"),
3737
Short: T("Upgrade a virtual server instance"),
3838
Long: T(`Note: This virtual server will be rebooted once the upgrade order is placed.
39-
The instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.
40-
41-
EXAMPLE:
42-
${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000
43-
This commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.`),
39+
The instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.`) + `
40+
` + T(`The -c and -m options are for dedicated VSI upgrade, most VSIs will need to upgrade with --flavor.
41+
See '${COMMAND_NAME} sl vs options' for flavor keyNames to use.`),
42+
Example: `${COMMAND_NAME} sl vs upgrade 12345678 --flavor B1_8X32X25`,
4443
Args: metadata.OneArgs,
4544
RunE: func(cmd *cobra.Command, args []string) error {
4645
return thisCmd.Run(args)

plugin/commands/virtual/virtual.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func SetupCobraCommands(sl *metadata.SoftlayerCommand) *cobra.Command {
1919
cobraCmd := &cobra.Command{
2020
Use: "vs",
2121
Short: T("Classic infrastructure Virtual Servers"),
22-
Long: "${COMMAND_NAME} sl vs",
2322
RunE: nil,
2423
}
2524
cobraCmd.AddCommand(NewAuthorizeStorageCommand(sl).Command)

plugin/i18n/v2Resources/active.de_DE.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,8 +4691,8 @@
46914691
"Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC": {
46924692
"other": "Hinweis: Mehr als 6.000 IOPS sind nur verfügbar in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC"
46934693
},
4694-
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.": {
4695-
"other": "Anmerkung: Dieser virtuelle Server wird erneut gestartet, sobald die Upgradeauftrag erteilt wurde.\nDie Instanz wird angehalten, bis die Upgradetransaktion abgeschlossen wurde. Für das Netz ist jedoch kein Warmstart erforderlich.\n\nBEISPIEL:\n ${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 -- network 1000\n Dieser Befehl führt ein Upgrade der virtuellen Serverinstanz mit der ID 12345678 durch und setzt die Anzahl der CPU-Kerne auf 8, den Speicher auf 8192M und die Geschwindigkeit des Netzports auf 1000 Mb/s."
4694+
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.": {
4695+
"other": "Anmerkung: Dieser virtuelle Server wird erneut gestartet, sobald die Upgradeauftrag erteilt wurde.\nDie Instanz wird angehalten, bis die Upgradetransaktion abgeschlossen wurde. Für das Netz ist jedoch kein Warmstart erforderlich."
46964696
},
46974697
"Notes": {
46984698
"other": "Anmerkungen"

plugin/i18n/v2Resources/active.en-US.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,9 @@
308308
"${COMMAND_NAME} sl vlan create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vlan create -t public -d dal09 -n myvlan\n This command creates a public vlan located in datacenter dal09 named \"myvlan\".\n ${COMMAND_NAME} sl vlan create -r bcr01a.dal09 -n myvlan\n This command creates a vlan on router bcr01a.dal09 named \"myvlan\".": {
309309
"other": "${COMMAND_NAME} sl vlan create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vlan create -t public -d dal09 -n myvlan\n This command creates a public vlan located in datacenter dal09 named \"myvlan\".\n ${COMMAND_NAME} sl vlan create -r bcr01a.dal09 -n myvlan\n This command creates a vlan on router bcr01a.dal09 named \"myvlan\"."
310310
},
311-
"EXAMPLE:\n ${COMMAND_NAME} sl vlan detail 12345678\t--no-vs --no-hardware\n This command shows details of vlan with ID 12345678, and not list virtual server or hardware server.": {
312-
"other": "EXAMPLE:\n ${COMMAND_NAME} sl vlan detail 12345678\t--no-vs --no-hardware\n This command shows details of vlan with ID 12345678, and not list virtual server or hardware server."
313-
},
314311
"${COMMAND_NAME} sl vlan edit IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vlan edit 12345678 -n myvlan-rename\n This command updates vlan with ID 12345678 and gives it a new name \"myvlan-rename\".": {
315312
"other": "${COMMAND_NAME} sl vlan edit IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vlan edit 12345678 -n myvlan-rename\n This command updates vlan with ID 12345678 and gives it a new name \"myvlan-rename\"."
316313
},
317-
"EXAMPLE:\n ${COMMAND_NAME} sl vlan list -d dal09 --sortby number\n This commands lists all vlans on current account filtering by datacenter equals to dal09, and sort them by vlan number.\n \nNote: In field Pod, if add (*) indicated that closed soon": {
318-
"other": "EXAMPLE:\n ${COMMAND_NAME} sl vlan list -d dal09 --sortby number\n This commands lists all vlans on current account filtering by datacenter equals to dal09, and sort them by vlan number.\n \nNote: In field Pod, if add (*) indicated that closed soon"
319-
},
320314
"${COMMAND_NAME} sl vs authorize-storage [OPTIONS] IDENTIFIER\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs authorize-storage --username-storage SL01SL30-37 1234567\n Authorize File, Block and Portable Storage to a Virtual Server.": {
321315
"other": "${COMMAND_NAME} sl vs authorize-storage [OPTIONS] IDENTIFIER\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs authorize-storage --username-storage SL01SL30-37 1234567\n Authorize File, Block and Portable Storage to a Virtual Server."
322316
},
@@ -1883,6 +1877,12 @@
18831877
"EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": {
18841878
"other": "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n"
18851879
},
1880+
"EXAMPLE:\n ${COMMAND_NAME} sl vlan detail 12345678\t--no-vs --no-hardware\n This command shows details of vlan with ID 12345678, and not list virtual server or hardware server.": {
1881+
"other": "EXAMPLE:\n ${COMMAND_NAME} sl vlan detail 12345678\t--no-vs --no-hardware\n This command shows details of vlan with ID 12345678, and not list virtual server or hardware server."
1882+
},
1883+
"EXAMPLE:\n ${COMMAND_NAME} sl vlan list -d dal09 --sortby number\n This commands lists all vlans on current account filtering by datacenter equals to dal09, and sort them by vlan number.\n \nNote: In field Pod, if add (*) indicated that closed soon": {
1884+
"other": "EXAMPLE:\n ${COMMAND_NAME} sl vlan list -d dal09 --sortby number\n This commands lists all vlans on current account filtering by datacenter equals to dal09, and sort them by vlan number.\n \nNote: In field Pod, if add (*) indicated that closed soon"
1885+
},
18861886
"EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": {
18871887
"other": "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use."
18881888
},
@@ -4730,8 +4730,8 @@
47304730
"Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC": {
47314731
"other": "Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC"
47324732
},
4733-
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.": {
4734-
"other": "Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps."
4733+
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.": {
4734+
"other": "Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required."
47354735
},
47364736
"Notes": {
47374737
"other": "Notes"
@@ -6281,6 +6281,9 @@
62816281
"Test order": {
62826282
"other": "Test order"
62836283
},
6284+
"The -c and -m options are for dedicated VSI upgrade, most VSIs will need to upgrade with --flavor.\nSee '${COMMAND_NAME} sl vs options' for flavor keyNames to use.": {
6285+
"other": "The -c and -m options are for dedicated VSI upgrade, most VSIs will need to upgrade with --flavor.\nSee '${COMMAND_NAME} sl vs options' for flavor keyNames to use."
6286+
},
62846287
"The ID of one IP address to authorize": {
62856288
"other": "The ID of one IP address to authorize"
62866289
},

plugin/i18n/v2Resources/active.es_ES.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,8 +4691,8 @@
46914691
"Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC": {
46924692
"other": "Nota: IOPS por encima de 6.000 solo disponible en: https://cloud.ibm.com/docs/BlockStorage? topic=BlockStorage-selectDC"
46934693
},
4694-
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.": {
4695-
"other": "Nota: Este servidor virtual rearrancará una vez que se haya presentado la orden de actualización.\nLa instancia se detiene hasta que la transacción de actualización se haya completado. Sin embargo, para la Red no es necesario rearrancar.\n\nEJEMPLO:\n ${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n Este mandato actualiza la instancia de servidor virtual con el ID 12345678 y establece el número de núcleos de CPU en 8, la memoria en 8192M y la velocidad de puerto de red en 1000 Mbps."
4694+
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.": {
4695+
"other": "Nota: Este servidor virtual rearrancará una vez que se haya presentado la orden de actualización.\nLa instancia se detiene hasta que la transacción de actualización se haya completado. Sin embargo, para la Red no es necesario rearrancar."
46964696
},
46974697
"Notes": {
46984698
"other": "Notas"

plugin/i18n/v2Resources/active.fr_FR.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,8 +4691,8 @@
46914691
"Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC": {
46924692
"other": "Remarque : les IOPS supérieures à 6000 sont disponibles uniquement dans : https://cloud.ibm.com/docs/BlockStorage? topic=BlockStorage-selectDC"
46934693
},
4694-
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.": {
4695-
"other": "Remarque : ce serveur virtuel sera réamorcé une fois la commande de mise à niveau passée.\nL' instance est arrêtée jusqu'à la fin de la transaction de mise à niveau. Toutefois, pour le réseau, aucun réamorçage n'est requis.\n\nEXEMPLE :\n ${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n Cette commande met à niveau l'instance de serveur virtuel avec l'ID 12345678 et définit le nombre de coeurs d'UC sur 8, la mémoire sur 8192M, la vitesse du port réseau sur 1000 Mbps."
4694+
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.": {
4695+
"other": "Remarque : ce serveur virtuel sera réamorcé une fois la commande de mise à niveau passée.\nL' instance est arrêtée jusqu'à la fin de la transaction de mise à niveau. Toutefois, pour le réseau, aucun réamorçage n'est requis."
46964696
},
46974697
"Notes": {
46984698
"other": "Notes"

plugin/i18n/v2Resources/active.it_IT.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,8 +4691,8 @@
46914691
"Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC": {
46924692
"other": "Nota: IOPS oltre 6.000 disponibili solo in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC"
46934693
},
4694-
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.": {
4695-
"other": "Nota: questo server virtuale verrà riavviato una volta effettuato l'ordine di aggiornamento.\n L'istanza viene arrestata fino a quando non viene completata la transazione di aggiornamento. Tuttavia, per la rete, non è richiesto alcun riavvio.\n\nESEMPIO:\n ${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n Questo comando aggiorna l'istanza del server virtuale con ID 12345678 e imposta il numero di core CPU su 8, la memoria su 8192M, la velocità della porta di rete su 1000 Mbps."
4694+
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.": {
4695+
"other": "Nota: questo server virtuale verrà riavviato una volta effettuato l'ordine di aggiornamento.\n L'istanza viene arrestata fino a quando non viene completata la transazione di aggiornamento. Tuttavia, per la rete, non è richiesto alcun riavvio."
46964696
},
46974697
"Notes": {
46984698
"other": "Note"

plugin/i18n/v2Resources/active.ja_JP.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,8 +4691,8 @@
46914691
"Note: IOPS above 6,000 available only in: https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-selectDC": {
46924692
"other": "注: 6,000 を超える IOPS は、https://cloud.ibm.com/docs/BlockStorage? topic=BlockStorage-selectDC でのみ使用可能です。"
46934693
},
4694-
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.\n\nEXAMPLE:\n\t${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n\tThis commands upgrades virtual server instance with ID 12345678 and set number of CPU cores to 8, memory to 8192M, network port speed to 1000 Mbps.": {
4695-
"other": "注: この仮想サーバーは、アップグレード注文が placed.\nThe インスタンスは、アップグレード・トランザクションが完了するまで停止されます。 ただし、ネットワークの場合、リブートは行われません。required.\n\nEXAMPLE:\n ${COMMAND_NAME} sl vs upgrade 12345678 -c 8 -m 8192 --network 1000\n このコマンドは、ID 12345678 の仮想サーバー・インスタンスをアップグレードし、CPU コアの数を 8、メモリーを 8192M、ネットワーク・ポート速度を 1000 Mbps に設定します。"
4694+
"Note: This virtual server will be rebooted once the upgrade order is placed.\nThe instance is halted until the upgrade transaction is completed. However for Network, no reboot is required.": {
4695+
"other": "注: この仮想サーバーは、アップグレード注文が placed.\nThe インスタンスは、アップグレード・トランザクションが完了するまで停止されます。 ただし、ネットワークの場合、リブートは行われません。required."
46964696
},
46974697
"Notes": {
46984698
"other": "メモ"

0 commit comments

Comments
 (0)