Skip to content

Commit 6ad8fe3

Browse files
committed
Consistency
* CLI: Renames bmetal to bmc (and creates an alias for bmc). * CLI: Renames hardware to server (and creates an alias for hardware). * CLI: Orders command list and options. * CLI: Removes periods at the end of option descriptions. * General: Adds contribution docs to bootstrap devs. This does most if not all of the work for issue softlayer#144
1 parent 3fb84d3 commit 6ad8fe3

File tree

23 files changed

+323
-263
lines changed

23 files changed

+323
-263
lines changed

SoftLayer/CLI/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
SoftLayer Command-line Client
88
99
The available modules are:
10-
cci Manage, delete, order compute instances
10+
bmc Interact with bare metal instances
11+
cci Manage, delete, order compute instances. Also available with 'vm'
1112
config View and edit configuration for this tool
1213
dns Manage DNS
1314
firewall Firewall rule and security management
14-
hardware View hardware details
15-
bmetal Interact with bare metal instances
16-
network Perform various network operations
1715
help Show help
18-
iscsi View iSCSI details
1916
image Manages compute and flex images
17+
iscsi View iSCSI details
2018
metadata Get details about this machine. Also available with 'my' and 'meta'
2119
nas View NAS details
20+
network Perform various network operations
21+
server Manage hardware servers
2222
sshkey Manage SSH keys on your account
2323
ssl Manages SSL
2424

SoftLayer/CLI/environment.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class Environment(object):
4040
aliases = {
4141
'meta': 'metadata',
4242
'my': 'metadata',
43+
'vm': 'cci',
44+
'hardware': 'server',
45+
'bmetal': 'bmc',
4346
}
4447
config = {}
4548
stdout = sys.stdout
Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
2-
usage: sl bmetal [<command>] [<args>...] [options]
3-
sl bmetal [-h | --help]
2+
usage: sl bmc [<command>] [<args>...] [options]
3+
sl bmc [-h | --help]
44
55
Manage bare metal instances
66
77
The available commands are:
8-
create-options Output available available options when creating a server
9-
create Create a new bare metal instance
108
cancel Cancels a bare metal instance
9+
create Create a new bare metal instance
10+
create-options Output available available options when creating a server
1111
1212
For several commands, <identifier> will be asked for. This can be the id,
1313
hostname or the ip address for a piece of hardware.
@@ -23,20 +23,20 @@
2323
from SoftLayer import HardwareManager
2424

2525

26-
class BMetalCreateOptions(CLIRunnable):
26+
class BMCCreateOptions(CLIRunnable):
2727
"""
28-
usage: sl bmetal create-options [options]
28+
usage: sl bmc create-options [options]
2929
3030
Output available available options when creating a bare metal instance.
3131
3232
Options:
3333
--all Show all options. default if no other option provided
34-
--datacenter Show datacenter options
3534
--cpu Show CPU options
36-
--nic Show NIC speed options
35+
--datacenter Show datacenter options
3736
--disk Show disk options
38-
--os Show operating system options
3937
--memory Show memory size options
38+
--nic Show NIC speed options
39+
--os Show operating system options
4040
"""
4141
action = 'create-options'
4242
options = ['datacenter', 'cpu', 'memory', 'os', 'disk', 'nic']
@@ -262,38 +262,35 @@ def _generate_windows_code(description):
262262
return []
263263

264264

265-
class CreateBMetalInstance(CLIRunnable):
265+
class CreateBMCInstance(CLIRunnable):
266266
"""
267-
usage: sl bmetal create [--disk=DISK...] [options]
267+
usage: sl bmc create [--disk=DISK...] [options]
268268
269-
Order/create a bare metal instance. See 'sl bmetal create-options' for valid
269+
Order/create a bare metal instance. See 'sl bmc create-options' for valid
270270
options
271271
272+
NOTE: Due to hardware configurations, the CPU and memory must match
273+
appropriately. See create-options for options
274+
272275
Required:
273-
-H --hostname=HOST Host portion of the FQDN. example: server
274-
-D --domain=DOMAIN Domain portion of the FQDN example: example.com
275276
-c --cpu=CPU Number of CPU cores
276-
-m --memory=MEMORY Memory in mebibytes (n * 1024)
277-
278-
NOTE: Due to hardware configurations, the CPU and memory
279-
must match appropriately. See create-options for
280-
options.
281-
282-
-o OS, --os=OS OS install code.
283-
277+
-D --domain=DOMAIN Domain portion of the FQDN example: example.com
278+
-H --hostname=HOST Host portion of the FQDN. example: server
279+
-m --memory=MEMORY Memory in mebibytes. Example: 2048
280+
-o OS, --os=OS OS install code
284281
--hourly Hourly rate instance type
285282
--monthly Monthly rate instance type
286283
287284
288285
Optional:
289-
-d DC, --datacenter=DC datacenter name
290-
Note: Omitting this value defaults to the first
291-
available datacenter
292-
-n MBPS, --network=MBPS Network port speed in Mbps
286+
-d DC, --datacenter=DC datacenter name Note: Omitting this value defaults
287+
to the first available datacenter
293288
--dry-run, --test Do not create the instance, just get a quote
289+
--export=FILE Exports options to a template file
290+
-n MBPS, --network=MBPS Network port speed in Mbps
294291
-t, --template=FILE A template file that defaults the command-line
295292
options using the long name in INI format
296-
--export=FILE Exports options to a template file
293+
297294
"""
298295
action = 'create'
299296
options = ['confirm']
@@ -400,7 +397,7 @@ def execute(cls, client, args):
400397
output.append(FormattedItem(
401398
'',
402399
' -- ! Prices reflected here are retail and do not '
403-
'take account level discounts and are not guarenteed.')
400+
'take account level discounts and are not guaranteed.')
404401
)
405402
elif args['--really'] or confirm(
406403
"This action will incur charges on your account. Continue?"):
@@ -439,7 +436,7 @@ def _validate_args(cls, args):
439436
@classmethod
440437
def _get_cpu_and_memory_price_ids(cls, bmi_options, cpu_value,
441438
memory_value):
442-
bmi_obj = BMetalCreateOptions()
439+
bmi_obj = BMCCreateOptions()
443440
price_id = None
444441

445442
cpu_regex = re.compile('(\d+)')
@@ -470,7 +467,7 @@ def _get_default_value(cls, bmi_options, option):
470467

471468
@classmethod
472469
def _get_price_id_from_options(cls, bmi_options, option, value):
473-
bmi_obj = BMetalCreateOptions()
470+
bmi_obj = BMCCreateOptions()
474471
price_id = None
475472

476473
for k, v in bmi_obj.get_create_options(bmi_options, option, False):
@@ -483,13 +480,13 @@ def _get_price_id_from_options(cls, bmi_options, option, value):
483480

484481
class CancelInstance(CLIRunnable):
485482
"""
486-
usage: sl bmetal cancel <identifier> [options]
483+
usage: sl bmc cancel <identifier> [options]
487484
488485
Cancel a bare metal instance
489486
490487
Options:
491488
--immediate Cancels the instance immediately (instead of on the billing
492-
anniversary).
489+
anniversary)
493490
"""
494491

495492
action = 'cancel'

SoftLayer/CLI/modules/cci.py

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
Manage, delete, order compute instances
55
66
The available commands are:
7-
network Manage network settings
8-
edit Edit details of a CCI
7+
cancel Cancel a running CCI
98
create Order and create a CCI
109
(see `sl cci create-options` for choices)
11-
manage Manage active CCI
12-
list List CCI's on the account
10+
create-options Output available available options when creating a CCI
1311
detail Output details about a CCI
1412
dns DNS related actions to a CCI
15-
cancel Cancel a running CCI
16-
create-options Output available available options when creating a CCI
17-
reload Reload the OS on a CCI based on its current configuration
13+
edit Edit details of a CCI
14+
list List CCI's on the account
15+
manage Manage active CCI
16+
network Manage network settings
1817
ready Check if a CCI has finished provisioning
18+
reload Reload the OS on a CCI based on its current configuration
1919
2020
For several commands, <identifier> will be asked for. This can be the id,
2121
hostname or the ip address for a CCI.
@@ -54,16 +54,16 @@ class ListCCIs(CLIRunnable):
5454
Cores, memory, primary_ip, backend_ip
5555
5656
Filters:
57-
--hourly Show hourly instances
58-
--monthly Show monthly instances
59-
-H --hostname=HOST Host portion of the FQDN. example: server
60-
-D --domain=DOMAIN Domain portion of the FQDN. example: example.com
6157
-c --cpu=CPU Number of CPU cores
62-
-m --memory=MEMORY Memory in mebibytes (n * 1024)
58+
-D --domain=DOMAIN Domain portion of the FQDN. example: example.com
6359
-d DC, --datacenter=DC datacenter shortname (sng01, dal05, ...)
60+
-H --hostname=HOST Host portion of the FQDN. example: server
61+
-m --memory=MEMORY Memory in mebibytes
6462
-n MBPS, --network=MBPS Network port speed in Mbps
63+
--hourly Show hourly instances
64+
--monthly Show monthly instances
6565
--tags=ARG Only show instances that have one of these tags.
66-
Comma-separated. (production,db)
66+
Comma-separated. (production,db)
6767
6868
For more on filters see 'sl help filters'
6969
"""
@@ -209,12 +209,12 @@ class CreateOptionsCCI(CLIRunnable):
209209
210210
Options:
211211
--all Show all options. default if no other option provided
212-
--datacenter Show datacenter options
213212
--cpu Show CPU options
214-
--nic Show NIC speed options
213+
--datacenter Show datacenter options
215214
--disk Show disk options
216-
--os Show operating system options
217215
--memory Show memory size options
216+
--nic Show NIC speed options
217+
--os Show operating system options
218218
"""
219219
action = 'create-options'
220220
options = ['datacenter', 'cpu', 'nic', 'disk', 'os', 'memory']
@@ -337,39 +337,37 @@ class CreateCCI(CLIRunnable):
337337
Order/create a CCI. See 'sl cci create-options' for valid options
338338
339339
Required:
340-
-H --hostname=HOST Host portion of the FQDN. example: server
341-
-D --domain=DOMAIN Domain portion of the FQDN example: example.com
342-
-c --cpu=CPU Number of CPU cores
343-
-m --memory=MEMORY Memory in mebibytes (n * 1024)
344-
345-
-o OS, --os=OS OS install code. Tip: you can specify <OS>_LATEST
346-
--image=GUID Image GUID. See: 'sl image list' for reference
340+
-c, --cpu=CPU Number of CPU cores
341+
-D, --domain=DOMAIN Domain portion of the FQDN. example: example.com
342+
-H, --hostname=HOST Host portion of the FQDN. example: server
343+
--image=GUID Image GUID. See: 'sl image list' for reference
344+
-m, --memory=MEMORY Memory in mebibytes. example: 2048
345+
-o, --os=OS OS install code. Tip: you can specify <OS>_LATEST
347346
348347
--hourly Hourly rate instance type
349348
--monthly Monthly rate instance type
350349
351350
352351
Optional:
353-
-d DC, --datacenter=DC Datacenter shortname (sng01, dal05, ...)
354-
Note: Omitting this value defaults to the first
355-
available datacenter
356-
-n MBPS, --network=MBPS Network port speed in Mbps
357-
--dedicated Allocate a dedicated CCI (non-shared host)
358-
--dry-run, --test Do not create CCI, just get a quote
359-
360-
-u --userdata=DATA User defined metadata string
361-
-F --userfile=FILE Read userdata from file
362-
-i --postinstall=URI Post-install script to download
363-
(Only HTTPS executes, HTTP leaves file in /root)
364-
-k KEY, --key=KEY The SSH key to add to the root user
365-
--private Forces the CCI to only have access the private
366-
network.
367-
-t, --template=FILE A template file that defaults the command-line
368-
options using the long name in INI format
369-
--like=IDENTIFIER Use the configuration from an existing CCI
370-
--export=FILE Exports options to a template file
371-
--wait=SECONDS Block until CCI is finished provisioning for up to X
372-
seconds before returning
352+
-d, --datacenter=DC Datacenter shortname (sng01, dal05, ...)
353+
Note: Omitting this value defaults to the first
354+
available datacenter
355+
--dedicated Allocate a dedicated CCI (non-shared host)
356+
--dry-run, --test Do not create CCI, just get a quote
357+
--export=FILE Exports options to a template file
358+
-F, --userfile=FILE Read userdata from file
359+
(Only HTTPS executes, HTTP leaves file in /root)
360+
-i, --postinstall=URI Post-install script to download
361+
-k, --key=KEY The SSH key to add to the root user
362+
--like=IDENTIFIER Use the configuration from an existing CCI
363+
-n, --network=MBPS Network port speed in Mbps
364+
--private Forces the CCI to only have access the private
365+
network
366+
-t, --template=FILE A template file that defaults the command-line
367+
options using the long name in INI format
368+
-u, --userdata=DATA User defined metadata string
369+
--wait=SECONDS Block until CCI is finished provisioning for up to X
370+
seconds before returning
373371
"""
374372
action = 'create'
375373
options = ['confirm']
@@ -423,7 +421,7 @@ def execute(cls, client, args):
423421
output.append(FormattedItem(
424422
None,
425423
' -- ! Prices reflected here are retail and do not '
426-
'take account level discounts and are not guarenteed.')
424+
'take account level discounts and are not guaranteed.')
427425
)
428426

429427
if args['--export']:
@@ -765,10 +763,10 @@ class NetworkCCI(CLIRunnable):
765763
Manage network settings
766764
767765
Options:
768-
--speed=SPEED Port speed. 0 disables the port.
769-
[Options: 0, 10, 100, 1000, 10000]
770766
--public Public network
771767
--private Private network
768+
--speed=SPEED Port speed. 0 disables the port.
769+
[Options: 0, 10, 100, 1000, 10000]
772770
"""
773771
action = 'network'
774772

@@ -907,10 +905,10 @@ class EditCCI(CLIRunnable):
907905
Edit CCI details
908906
909907
Options:
910-
-H --hostname=HOST Host portion of the FQDN. example: server
911908
-D --domain=DOMAIN Domain portion of the FQDN example: example.com
912-
-u --userdata=DATA User defined metadata string
913909
-F --userfile=FILE Read userdata from file
910+
-H --hostname=HOST Host portion of the FQDN. example: server
911+
-u --userdata=DATA User defined metadata string
914912
"""
915913
action = 'edit'
916914

SoftLayer/CLI/modules/dns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ class ListZones(CLIRunnable):
8989
List zones and optionally, records
9090
9191
Filters:
92-
--type=TYPE Record type, such as A or CNAME
9392
--data=DATA Record data, such as an IP address
9493
--record=HOST Host record, such as www
9594
--ttl=TTL TTL value in seconds, such as 86400
95+
--type=TYPE Record type, such as A or CNAME
9696
"""
9797
action = 'list'
9898

@@ -209,8 +209,8 @@ class EditRecord(CLIRunnable):
209209
210210
Options:
211211
--data=DATA
212-
--ttl=TTL Time to live [default: 7200]
213212
--id=ID Modify only the given ID
213+
--ttl=TTL Time to live [default: 7200]
214214
"""
215215
action = 'edit'
216216

SoftLayer/CLI/modules/filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
'<= value' Less than or equal to value
2121
2222
Examples:
23-
sl hardware list --datacenter=dal05
24-
sl hardware list --hostname='prod*'
23+
sl server list --datacenter=dal05
24+
sl server list --hostname='prod*'
2525
sl cci list --network=100 --cpu=2
2626
sl cci list --network='< 100' --cpu=2
2727
sl cci list --memory='>= 2048'

SoftLayer/CLI/modules/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class ListImages(CLIRunnable):
2020
List images
2121
2222
Options:
23-
--public Display only public images
2423
--private Display only private images
24+
--public Display only public images
2525
"""
2626
action = 'list'
2727

0 commit comments

Comments
 (0)