Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • S slapos.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 38
    • Merge requests 38
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • slapos.core
  • Merge requests
  • !353

cli/request: Add --parameters-file option

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Xavier Thompson requested to merge xavier_thompson/slapos.core:cli_request_parameters_file into master Dec 08, 2021
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 1

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.

Edited Dec 08, 2021 by Xavier Thompson
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cli_request_parameters_file
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7