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
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.blueprints.
dict_names
(lst)[source]¶ Return comma-separated list of the dict's name/user fields
root, norm
-
composer.cli.blueprints.
prettyCommitDetails
(change, indent=4)[source]¶ Print the blueprint's change in a nice way
composer.cli.cmdline module¶
composer.cli.compose module¶
-
composer.cli.compose.
compose_cancel
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[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
This dispatches the compose commands to a function
compose_cmd expects api to be passed. eg.
{"version": 1, "backend": "lorax-composer"}
-
composer.cli.compose.
compose_delete
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[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, api=None)[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, api=None)[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_list
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[source]¶ Return a simple list of compose identifiers
-
composer.cli.compose.
compose_log
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[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, api=None)[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, api=None)[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_ostree
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[source]¶ Start a new ostree 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.
api (dict) -- Details about the API server, "version" and "backend"
compose start-ostree [--size XXXX] [--parent PARENT] [--ref REF] <BLUEPRINT> <TYPE> [<IMAGE-NAME> <PROFILE.TOML>]
-
composer.cli.compose.
compose_results
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[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, api=None)[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.
api (dict) -- Details about the API server, "version" and "backend"
compose start [--size XXX] <blueprint-name> <compose-type> [<image-name> <provider> <profile> | <image-name> <profile.toml>]
-
composer.cli.compose.
compose_status
(socket_path, api_version, args, show_json=False, testmode=0, api=None)[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, api=None)[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.compose.
get_parent
(args)[source]¶ Return optional --parent argument, and remaining args
- Parameters
args (list of strings) -- list of arguments
- Returns
(args, parent)
- Return type
-
composer.cli.compose.
get_ref
(args)[source]¶ Return optional --ref argument, and remaining args
- Parameters
args (list of strings) -- list of arguments
- Returns
(args, parent)
- Return type
-
composer.cli.compose.
get_size
(args)[source]¶ Return optional --size argument, and remaining args
- Parameters
args (list of strings) -- list of arguments
- Returns
(args, size)
- Return type
check size argument for int
check other args for --size in wrong place
raise error? Or just return 0?
no size returns 0 in size
multiply by 1024**2 to make it easier on users to specify large sizes
composer.cli.help module¶
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
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
-
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.providers module¶
-
composer.cli.providers.
providers_cmd
(opts)[source]¶ Process providers commands
- Parameters
opts (argparse.Namespace) -- Cmdline arguments
- Returns
Value to return from sys.exit()
- Return type
This dispatches the providers commands to a function
-
composer.cli.providers.
providers_delete
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Delete a profile from a provider
- 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
providers delete <provider> <profile>
-
composer.cli.providers.
providers_info
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Show information about each provider
- 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
providers info <PROVIDER>
-
composer.cli.providers.
providers_list
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Return the list of providers
- 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
providers list
-
composer.cli.providers.
providers_push
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Add a new provider profile or overwrite an existing one
- 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
providers push <profile.toml>
-
composer.cli.providers.
providers_save
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Save a provider's profile 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
testmode (int) -- unused in this function
providers save <provider> <profile>
-
composer.cli.providers.
providers_show
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Return details about a provider
- 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
providers show <provider> <profile>
-
composer.cli.providers.
providers_template
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Return a TOML template for setting the provider's fields
- 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
providers template <provider>
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
-
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.status module¶
-
composer.cli.status.
status_cmd
(opts)[source]¶ Process status commands
- Parameters
opts (argparse.Namespace) -- Cmdline arguments
- Returns
Value to return from sys.exit()
- Return type
composer.cli.upload module¶
-
composer.cli.upload.
upload_cancel
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Cancel the queued or running upload
- 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
upload cancel <build-uuid>
-
composer.cli.upload.
upload_cmd
(opts)[source]¶ Process upload commands
- Parameters
opts (argparse.Namespace) -- Cmdline arguments
- Returns
Value to return from sys.exit()
- Return type
This dispatches the upload commands to a function
-
composer.cli.upload.
upload_delete
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Delete an upload and remove it from the build
- 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
upload delete <build-uuid>
-
composer.cli.upload.
upload_info
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Return detailed information about the upload
- 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
upload info <uuid>
This returns information about the upload, including uuid, name, status, service, and image.
-
composer.cli.upload.
upload_list
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Return the composes and their associated upload uuids and status
- 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
upload list
-
composer.cli.upload.
upload_log
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Return the upload 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
upload log <build-uuid>
-
composer.cli.upload.
upload_reset
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Reset the upload and execute it again
- 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
upload reset <build-uuid>
-
composer.cli.upload.
upload_start
(socket_path, api_version, args, show_json=False, testmode=0)[source]¶ Start upload up a build uuid 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
upload start <build-uuid> <image-name> [<provider> <profile> | <profile.toml>]
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
-
composer.cli.utilities.
get_arg
(args, name, argtype=None)[source]¶ Return optional value from args, and remaining args
- Parameters
args (list of strings) -- list of arguments
name (string) -- The argument to remove from the args list
argtype (type) -- Type to use for checking the argument value
:returns (args, value) :rtype: tuple
This removes the optional argument and value from the argument list, returns the new list, and the value of the argument.
-
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
- Return type
- Returns
(rc, should_exit_now)
Return the correct rc for the program (0 or 1), and whether or not to continue processing the results.
Module contents¶
-
composer.cli.
main
(opts)[source]¶ Main program execution
- Parameters
opts (argparse.Namespace) -- Cmdline arguments