|
4 | 4 |
|
5 | 5 | from SoftLayer.CLI.command import SLCommand as SLCommand |
6 | 6 | from SoftLayer.CLI import environment |
| 7 | +from SoftLayer.CLI import exceptions |
7 | 8 | from SoftLayer.CLI import formatting |
8 | 9 | from SoftLayer.CLI import helpers |
9 | 10 | from SoftLayer.managers import ImageManager as ImageManager |
@@ -32,6 +33,11 @@ def _parse_create_args(client, args): |
32 | 33 | servers.append({'hostname': fqdn[0], 'domain': fqdn[1]}) |
33 | 34 | data['hardware'] = servers |
34 | 35 |
|
| 36 | + if args.get('extras'): |
| 37 | + try: |
| 38 | + data['extras'] = args.get('extras') |
| 39 | + except ValueError as err: |
| 40 | + raise exceptions.CLIAbort("There was an error when parsing the --extras value: {}".format(err)) |
35 | 41 | if args.get('image'): |
36 | 42 | if args.get('image').isdigit(): |
37 | 43 | image_mgr = ImageManager(client) |
@@ -78,6 +84,8 @@ def _parse_create_args(client, args): |
78 | 84 | @helpers.multi_option('--fqdn', required=True, |
79 | 85 | help="<hostname>.<domain.name.tld> formatted name to use. Specify one fqdn per server") |
80 | 86 | @click.option('--image', help="Image ID. See: 'slcli image list' for reference") |
| 87 | +@click.option('--extras', |
| 88 | + help="JSON string denoting extra data that needs to be sent with the order") |
81 | 89 | @environment.pass_env |
82 | 90 | def cli(env, quote, **args): |
83 | 91 | """View and Order a quote |
|
0 commit comments