Skip to content

Add --extras to slcli order quote #1792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SoftLayer/CLI/order/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from SoftLayer.CLI.command import SLCommand as SLCommand
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
from SoftLayer.managers import ImageManager as ImageManager
Expand Down Expand Up @@ -32,6 +33,11 @@ def _parse_create_args(client, args):
servers.append({'hostname': fqdn[0], 'domain': fqdn[1]})
data['hardware'] = servers

if args.get('extras'):
try:
data['extras'] = args.get('extras')
except ValueError as err:
raise exceptions.CLIAbort("There was an error when parsing the --extras value: {}".format(err))
if args.get('image'):
if args.get('image').isdigit():
image_mgr = ImageManager(client)
Expand Down Expand Up @@ -78,6 +84,8 @@ def _parse_create_args(client, args):
@helpers.multi_option('--fqdn', required=True,
help="<hostname>.<domain.name.tld> formatted name to use. Specify one fqdn per server")
@click.option('--image', help="Image ID. See: 'slcli image list' for reference")
@click.option('--extras',
help="JSON string denoting extra data that needs to be sent with the order")
@environment.pass_env
def cli(env, quote, **args):
"""View and Order a quote
Expand Down