cli Package

cli Package

composer.cli.main(opts)[source]

Main program execution

Parameters:opts (argparse.Namespace) – Cmdline arguments

compose Module

composer.cli.compose.compose_cancel(socket_path, api_version, args, show_json=False, testmode=0)[source]

Cancel a running compose

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose cancel <uuid>

This will cancel a running compose. It does nothing if the compose has finished.

composer.cli.compose.compose_cmd(opts)[source]

Process compose commands

Parameters:opts (argparse.Namespace) – Cmdline arguments
Returns:Value to return from sys.exit()
Return type:int

This dispatches the compose commands to a function

composer.cli.compose.compose_delete(socket_path, api_version, args, show_json=False, testmode=0)[source]

Delete a finished compose’s results

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose delete <uuid,...>

Delete the listed compose results. It will only delete results for composes that have finished or failed, not a running compose.

composer.cli.compose.compose_details(socket_path, api_version, args, show_json=False, testmode=0)[source]

Return detailed information about the compose

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose details <uuid>

This returns information about the compose, including the recipe and the dependencies.

composer.cli.compose.compose_image(socket_path, api_version, args, show_json=False, testmode=0)[source]

Download the compose’s output image

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose image <uuid>

This downloads only the result image, saving it as the image name, which depends on the type of compose that was selected.

composer.cli.compose.compose_log(socket_path, api_version, args, show_json=False, testmode=0)[source]

Show the last part of the compose log

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose log <uuid> [<size>kB]

This will display the last 1kB of the compose’s log file. Can be used to follow progress during the build.

composer.cli.compose.compose_logs(socket_path, api_version, args, show_json=False, testmode=0)[source]

Download a tar of the compose’s logs

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose logs <uuid>

Saves the logs as uuid-logs.tar

composer.cli.compose.compose_metadata(socket_path, api_version, args, show_json=False, testmode=0)[source]

Download a tar file of the compose’s metadata

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose metadata <uuid>

Saves the metadata as uuid-metadata.tar

composer.cli.compose.compose_results(socket_path, api_version, args, show_json=False, testmode=0)[source]

Download a tar file of the compose’s results

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose results <uuid>

The results includes the metadata, output image, and logs. It is saved as uuid.tar

composer.cli.compose.compose_start(socket_path, api_version, args, show_json=False, testmode=0)[source]

Start a new compose using the selected recipe and type

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

compose start <recipe-name> <compose-type>

composer.cli.compose.compose_status(socket_path, api_version, args, show_json=False, testmode=0)[source]

Return the status of all known composes

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

This doesn’t map directly to an API command, it combines the results from queue, finished, and failed so raw JSON output is not available.

composer.cli.compose.compose_types(socket_path, api_version, args, show_json=False)[source]

Return information about the supported compose types

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

Add additional details to types that are known to composer-cli. Raw JSON output does not include this extra information.

modules Module

composer.cli.modules.modules_cmd(opts)[source]

Process modules commands

Parameters:opts (argparse.Namespace) – Cmdline arguments
Returns:Value to return from sys.exit()
Return type:int

projects Module

composer.cli.projects.projects_cmd(opts)[source]

Process projects commands

Parameters:opts (argparse.Namespace) – Cmdline arguments
Returns:Value to return from sys.exit()
Return type:int
composer.cli.projects.projects_info(socket_path, api_version, args, show_json=False)[source]

Output info on a list of projects

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

projects info <project,...>

composer.cli.projects.projects_list(socket_path, api_version, args, show_json=False)[source]

Output the list of available projects

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

projects list

recipes Module

composer.cli.recipes.prettyCommitDetails(change, indent=4)[source]

Print the recipe’s change in a nice way

Parameters:
  • change (dict) – The individual recipe change dict
  • indent (int) – Number of spaces to indent
composer.cli.recipes.prettyDiffEntry(diff)[source]

Generate nice diff entry string.

Parameters:diff (dict) – Difference entry dict
Returns:Nice string
composer.cli.recipes.recipes_changes(socket_path, api_version, args, show_json=False)[source]

Display the changes for each of the recipes

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes changes <recipe,...> Display the changes for each recipe.

composer.cli.recipes.recipes_cmd(opts)[source]

Process recipes commands

Parameters:opts (argparse.Namespace) – Cmdline arguments
Returns:Value to return from sys.exit()
Return type:int

This dispatches the recipes commands to a function

composer.cli.recipes.recipes_delete(socket_path, api_version, args, show_json=False)[source]

Delete a recipe from the server

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

delete <recipe> Delete a recipe from the server

composer.cli.recipes.recipes_depsolve(socket_path, api_version, args, show_json=False)[source]

Display the packages needed to install the recipe

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes depsolve <recipe,...> Display the packages needed to install the recipe.

composer.cli.recipes.recipes_diff(socket_path, api_version, args, show_json=False)[source]

Display the differences between 2 versions of a recipe

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output
recipes diff <recipe-name> Display the differences between 2 versions of a recipe.
<from-commit> Commit hash or NEWEST <to-commit> Commit hash, NEWEST, or WORKSPACE
composer.cli.recipes.recipes_freeze(socket_path, api_version, args, show_json=False)[source]

Handle the recipes freeze commands

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes freeze <recipe,...> Display the frozen recipe’s modules and packages. recipes freeze show <recipe,...> Display the frozen recipe in TOML format. recipes freeze save <recipe,...> Save the frozen recipe to a file, <recipe-name>.frozen.toml.

composer.cli.recipes.recipes_freeze_save(socket_path, api_version, args, show_json=False)[source]

Save the frozen recipe to a TOML file

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes freeze save <recipe,...> Save the frozen recipe to a file, <recipe-name>.frozen.toml.

composer.cli.recipes.recipes_freeze_show(socket_path, api_version, args, show_json=False)[source]

Show the frozen recipe in TOML format

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes freeze show <recipe,...> Display the frozen recipe in TOML format.

composer.cli.recipes.recipes_list(socket_path, api_version, args, show_json=False)[source]

Output the list of available recipes

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes list

composer.cli.recipes.recipes_push(socket_path, api_version, args, show_json=False)[source]

Push a recipe TOML file to the server, updating the recipe

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

push <recipe> Push a recipe TOML file to the server.

composer.cli.recipes.recipes_save(socket_path, api_version, args, show_json=False)[source]

Save the recipe to a TOML file

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes save <recipe,...> Save the recipe to a file, <recipe-name>.toml

composer.cli.recipes.recipes_show(socket_path, api_version, args, show_json=False)[source]

Show the recipes, in TOML format

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes show <recipe,...> Display the recipe in TOML format.

Multiple recipes will be separated by

composer.cli.recipes.recipes_tag(socket_path, api_version, args, show_json=False)[source]

Tag the most recent recipe commit as a release

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes tag <recipe> Tag the most recent recipe commit as a release.

composer.cli.recipes.recipes_undo(socket_path, api_version, args, show_json=False)[source]

Undo changes to a recipe

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes undo <recipe> <commit> Undo changes to a recipe by reverting to the selected commit.

composer.cli.recipes.recipes_workspace(socket_path, api_version, args, show_json=False)[source]

Push the recipe TOML to the temporary workspace storage

Parameters:
  • socket_path (str) – Path to the Unix socket to use for API communication
  • api_version (str) – Version of the API to talk to. eg. “0”
  • args (list of str) – List of remaining arguments from the cmdline
  • show_json (bool) – Set to True to show the JSON output instead of the human readable output

recipes workspace <recipe> Push the recipe TOML to the temporary workspace storage.

utilities Module

composer.cli.utilities.argify(args)[source]

Take a list of human args and return a list with each item

Parameters:args (list of str) – list of strings with possible commas and spaces
Returns:List of all the items
Return type:list of str

Examples:

[“one,two”, “three”, ”,four”, ”,five,”] returns [“one”, “two”, “three”, “four”, “five”]

composer.cli.utilities.frozen_toml_filename(recipe_name)[source]

Convert a recipe name into a filename.toml

Parameters:recipe_name (str) – The recipe’s name
Returns:The recipe name with ‘ ‘ converted to - and .toml appended
Return type:str
composer.cli.utilities.handle_api_result(result, show_json=False)[source]

Log any errors, return the correct value

Parameters:result (dict) – JSON result from the http query
composer.cli.utilities.packageNEVRA(pkg)[source]

Return the package info as a NEVRA

Parameters:pkg (dict) – The package details
Returns:name-[epoch:]version-release-arch
Return type:str
composer.cli.utilities.toml_filename(recipe_name)[source]

Convert a recipe name into a filename.toml

Parameters:recipe_name (str) – The recipe’s name
Returns:The recipe name with ‘ ‘ converted to - and .toml appended
Return type:str

Table Of Contents

Previous topic

composer Package

Next topic

pylorax Package

This Page