cli/request: Add --parameters-file option
Add an alternative way to provide parameters to command-line slapos request
, as a JSON file:
slapos request --parameters-file some-parameters.json
This would be mutually exclusive with the existing --parameters
option.
The JSON file is merely loaded into a Python dict that is passed as the partition_parameter_kw
argument to slap.OpenOrder.request
method.
In comparison the --parameters
option builds a Python dict from key=value
pairs given on the command-line, and then passes it to slap.OpenOrder.request
in exactly the same way.
The --parameters
option has the limitation that values can only be strings
(i.e. the dict is "flat"), whereas --parameters-file
overcomes that limitation, allowing arbitrarily nested list
or dict
values. Note that this is just a limitation of the command-line interface, the underlying slap.OpenOrder.request
accepts any Python dictionnary.