Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • S slapos.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 31
    • Merge requests 31
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slapos.core
  • Merge requests
  • !353

Closed
Created Dec 08, 2021 by Xavier Thompson@xavier_thompsonOwner
  • Report abuse
Report abuse

cli/request: Add --parameters-file option

  • Overview 5
  • Commits 1
  • 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
Reviewer
Request review from
Time tracking
Source branch: cli_request_parameters_file
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7