@@ -112,9 +112,12 @@ def _validate_parameters(ctx, param, value): # pylint: disable=unused-argument
112112@click .option ('--mask' , help = "String-based object mask" )
113113@click .option ('--limit' , type = click .INT , help = "Result limit" )
114114@click .option ('--offset' , type = click .INT , help = "Result offset" )
115- @click .option ('--orderBy' , type = click .STRING , help = "an object filter that adds an order by clause"
116- "E.G --orderBy subnets.id default DESC"
117- " --orderBy subnets.id=ASC" )
115+ @click .option ('--orderBy' , type = click .STRING ,
116+ help = "To set the sort direction, ASC or DESC can be provided."
117+ "This should be of the form: '--orderBy nested.property' default DESC or "
118+ "'--orderBy nested.property=ASC', e.g. "
119+ " --orderBy subnets.id default DESC"
120+ " --orderBy subnets.id=ASC" )
118121@click .option ('--output-python / --no-output-python' ,
119122 help = "Show python example code instead of executing the call" )
120123@click .option ('--json-filter' , callback = _validate_filter ,
@@ -144,17 +147,19 @@ def cli(env, service, method, parameters, _id, _filters, mask, limit, offset, or
144147 --json-filter '{"virtualGuests":{"hostname":{"operation":"^= test"}}}' --limit=10
145148 slcli -v call-api SoftLayer_User_Customer addBulkPortalPermission --id=1234567 \\
146149 '[{"keyName": "NETWORK_MESSAGE_DELIVERY_MANAGE"}]'
150+ slcli call-api Account getVirtualGuests \\
151+ --orderBy virttualguests.id=ASC
147152 """
148153
149154 if _filters and json_filter :
150155 raise exceptions .CLIAbort ("--filter and --json-filter cannot be used together." )
151156
152157 object_filter = _build_filters (_filters )
153158 if orderby :
154- _filters = utils .build_filter_orderby (orderby )
155- object_filter . update ( _filters )
159+ orderby = utils .build_filter_orderby (orderby )
160+ object_filter = utils . dict_merge ( object_filter , orderby )
156161 if json_filter :
157- object_filter . update (json_filter )
162+ object_filter = utils . dict_merge (json_filter , object_filter )
158163
159164 args = [service , method ] + list (parameters )
160165 kwargs = {
0 commit comments