1212
1313
1414@click .command (epilog = "See 'slcli server create-options' for valid options." )
15- @click .option ('--hostname' , '-H' ,
16- help = "Host portion of the FQDN" ,
17- required = True ,
18- prompt = True )
19- @click .option ('--domain' , '-D' ,
20- help = "Domain portion of the FQDN" ,
21- required = True ,
22- prompt = True )
23- @click .option ('--size' , '-s' ,
24- help = "Hardware size" ,
25- required = True ,
26- prompt = True )
27- @click .option ('--os' , '-o' , help = "OS install code" ,
28- required = True ,
29- prompt = True )
30- @click .option ('--datacenter' , '-d' , help = "Datacenter shortname" ,
31- required = True ,
32- prompt = True )
33- @click .option ('--port-speed' ,
34- type = click .INT ,
35- help = "Port speeds" ,
36- required = True ,
37- prompt = True )
38- @click .option ('--billing' ,
39- type = click .Choice (['hourly' , 'monthly' ]),
40- default = 'hourly' ,
41- show_default = True ,
15+ @click .option ('--hostname' , '-H' , required = True , prompt = True , help = "Host portion of the FQDN" )
16+ @click .option ('--domain' , '-D' , required = True , prompt = True , help = "Domain portion of the FQDN" )
17+ @click .option ('--size' , '-s' , required = True , prompt = True , help = "Hardware size" )
18+ @click .option ('--os' , '-o' , required = True , prompt = True , help = "OS Key value" )
19+ @click .option ('--datacenter' , '-d' , required = True , prompt = True , help = "Datacenter shortname" )
20+ @click .option ('--port-speed' , type = click .INT , help = "Port speeds. DEPRECATED, use --network" )
21+ @click .option ('--no-public' , is_flag = True , help = "Private network only. DEPRECATED, use --network." )
22+ @click .option ('--network' , help = "Network Option Key. Use instead of port-speed option" )
23+ @click .option ('--billing' , default = 'hourly' , show_default = True , type = click .Choice (['hourly' , 'monthly' ]),
4224 help = "Billing rate" )
43- @click .option ('--postinstall' , '-i' , help = "Post-install script to download" )
44- @helpers .multi_option ('--key' , '-k' ,
45- help = "SSH keys to add to the root user" )
46- @click .option ('--no-public' ,
47- is_flag = True ,
48- help = "Private network only" )
49- @helpers .multi_option ('--extra' , '-e' , help = "Extra options" )
50- @click .option ('--test' ,
51- is_flag = True ,
52- help = "Do not actually create the server" )
53- @click .option ('--template' , '-t' ,
54- is_eager = True ,
25+ @click .option ('--postinstall' , '-i' , help = "Post-install script. Should be a HTTPS URL." )
26+ @click .option ('--test' , is_flag = True , help = "Do not actually create the server" )
27+ @click .option ('--template' , '-t' , is_eager = True , type = click .Path (exists = True , readable = True , resolve_path = True ),
5528 callback = template .TemplateCallback (list_args = ['key' ]),
56- help = "A template file that defaults the command-line options" ,
57- type = click .Path (exists = True , readable = True , resolve_path = True ))
58- @click .option ('--export' ,
59- type = click .Path (writable = True , resolve_path = True ),
29+ help = "A template file that defaults the command-line options" )
30+ @click .option ('--export' , type = click .Path (writable = True , resolve_path = True ),
6031 help = "Exports options to a template file" )
61- @click .option ('--wait' ,
62- type = click . INT ,
63- help = "Wait until the server is finished provisioning for up to "
64- "X seconds before returning " )
32+ @click .option ('--wait' , type = click . INT ,
33+ help = "Wait until the server is finished provisioning for up to X seconds before returning" )
34+ @ helpers . multi_option ( '--key' , '-k' , help = "SSH keys to add to the root user" )
35+ @ helpers . multi_option ( '--extra' , '-e' , help = "Extra option Key Names " )
6536@environment .pass_env
6637def cli (env , ** args ):
6738 """Order/create a dedicated server."""
@@ -86,6 +57,7 @@ def cli(env, **args):
8657 'port_speed' : args .get ('port_speed' ),
8758 'no_public' : args .get ('no_public' ) or False ,
8859 'extras' : args .get ('extra' ),
60+ 'network' : args .get ('network' )
8961 }
9062
9163 # Do not create hardware server with --test or --export
@@ -116,15 +88,13 @@ def cli(env, **args):
11688
11789 if args ['export' ]:
11890 export_file = args .pop ('export' )
119- template .export_to_template (export_file , args ,
120- exclude = ['wait' , 'test' ])
91+ template .export_to_template (export_file , args , exclude = ['wait' , 'test' ])
12192 env .fout ('Successfully exported options to a template file.' )
12293 return
12394
12495 if do_create :
12596 if not (env .skip_confirmations or formatting .confirm (
126- "This action will incur charges on your account. "
127- "Continue?" )):
97+ "This action will incur charges on your account. Continue?" )):
12898 raise exceptions .CLIAbort ('Aborting dedicated server order.' )
12999
130100 result = mgr .place_order (** order )
0 commit comments