composer.cli package¶
Submodules¶
composer.cli.blueprints module¶
-
composer.cli.blueprints.
blueprints_changes
(socket_path, api_version, args, show_json=False)[source]¶ Display the changes for each of the blueprints
Parameters: blueprints changes <blueprint,…> Display the changes for each blueprint.
-
composer.cli.blueprints.
blueprints_cmd
(opts)[source]¶ Process blueprints commands
Parameters: opts (argparse.Namespace) – Cmdline arguments Returns: Value to return from sys.exit() Return type: int This dispatches the blueprints commands to a function
-
composer.cli.blueprints.
blueprints_delete
(socket_path, api_version, args, show_json=False)[source]¶ Delete a blueprint from the server
Parameters: delete <blueprint> Delete a blueprint from the server
-
composer.cli.blueprints.
blueprints_depsolve
(socket_path, api_version, args, show_json=False)[source]¶ Display the packages needed to install the blueprint
Parameters: blueprints depsolve <blueprint,…> Display the packages needed to install the blueprint.
-
composer.cli.blueprints.
blueprints_diff
(socket_path, api_version, args, show_json=False)[source]¶ Display the differences between 2 versions of a blueprint
Parameters: - blueprints diff <blueprint-name> Display the differences between 2 versions of a blueprint.
- <from-commit> Commit hash or NEWEST <to-commit> Commit hash, NEWEST, or WORKSPACE
-
composer.cli.blueprints.
blueprints_freeze
(socket_path, api_version, args, show_json=False)[source]¶ Handle the blueprints freeze commands
Parameters: blueprints freeze <blueprint,…> Display the frozen blueprint’s modules and packages. blueprints freeze show <blueprint,…> Display the frozen blueprint in TOML format. blueprints freeze save <blueprint,…> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
-
composer.cli.blueprints.
blueprints_freeze_save
(socket_path, api_version, args, show_json=False)[source]¶ Save the frozen blueprint to a TOML file
Parameters: blueprints freeze save <blueprint,…> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
-
composer.cli.blueprints.
blueprints_freeze_show
(socket_path, api_version, args, show_json=False)[source]¶ Show the frozen blueprint in TOML format
Parameters: blueprints freeze show <blueprint,…> Display the frozen blueprint in TOML format.
-
composer.cli.blueprints.
blueprints_list
(socket_path, api_version, args, show_json=False)[source]¶ Output the list of available blueprints
Parameters: blueprints list
-
composer.cli.blueprints.
blueprints_push
(socket_path, api_version, args, show_json=False)[source]¶ Push a blueprint TOML file to the server, updating the blueprint
Parameters: push <blueprint> Push a blueprint TOML file to the server.
-
composer.cli.blueprints.
blueprints_save
(socket_path, api_version, args, show_json=False)[source]¶ Save the blueprint to a TOML file
Parameters: blueprints save <blueprint,…> Save the blueprint to a file, <blueprint-name>.toml
-
composer.cli.blueprints.
blueprints_show
(socket_path, api_version, args, show_json=False)[source]¶ Show the blueprints, in TOML format
Parameters: blueprints show <blueprint,…> Display the blueprint in TOML format.
Multiple blueprints will be separated by
-
composer.cli.blueprints.
blueprints_tag
(socket_path, api_version, args, show_json=False)[source]¶ Tag the most recent blueprint commit as a release
Parameters: blueprints tag <blueprint> Tag the most recent blueprint commit as a release.
-
composer.cli.blueprints.
blueprints_undo
(socket_path, api_version, args, show_json=False)[source]¶ Undo changes to a blueprint
Parameters: blueprints undo <blueprint> <commit> Undo changes to a blueprint by reverting to the selected commit.
-
composer.cli.blueprints.
blueprints_workspace
(socket_path, api_version, args, show_json=False)[source]¶ Push the blueprint TOML to the temporary workspace storage
Parameters: blueprints workspace <blueprint> Push the blueprint TOML to the temporary workspace storage.
composer.cli.cmdline module¶
composer.cli.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
- testmode (int) – unused in this function
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
- testmode (int) – unused in this function
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_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
- testmode (int) – unused in this function
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_info
(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
- testmode (int) – unused in this function
compose info <uuid>
This returns information about the compose, including the blueprint and the dependencies.
-
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
- testmode (int) – unused in this function
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
- testmode (int) – unused in this function
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
- testmode (int) – unused in this function
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
- testmode (int) – unused in this function
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 blueprint 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
- testmode (int) – Set to 1 to simulate a failed compose, set to 2 to simulate a finished one.
compose start <blueprint-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
- testmode (int) – unused in this function
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, testmode=0)[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
- testmode (int) – unused in this function
Add additional details to types that are known to composer-cli. Raw JSON output does not include this extra information.
composer.cli.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
composer.cli.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: projects info <project,…>
composer.cli.sources module¶
-
composer.cli.sources.
sources_add
(socket_path, api_version, args, show_json=False)[source]¶ Add or change a source
Parameters: sources add <source.toml>
-
composer.cli.sources.
sources_cmd
(opts)[source]¶ Process sources commands
Parameters: opts (argparse.Namespace) – Cmdline arguments Returns: Value to return from sys.exit() Return type: int
-
composer.cli.sources.
sources_delete
(socket_path, api_version, args, show_json=False)[source]¶ Delete a source
Parameters: sources delete <source-name>
-
composer.cli.sources.
sources_info
(socket_path, api_version, args, show_json=False)[source]¶ Output info on a list of projects
Parameters: sources info <source-name>
composer.cli.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
(blueprint_name)[source]¶ Convert a blueprint name into a filename.toml
Parameters: blueprint_name (str) – The blueprint’s name Returns: The blueprint 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
Module contents¶
-
composer.cli.
main
(opts)[source]¶ Main program execution
Parameters: opts (argparse.Namespace) – Cmdline arguments