Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S slapos.core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • 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
None
Milestone
None
Assign milestone
Time tracking
Source branch: cli_request_parameters_file
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7