LinuxCommandLibrary

koji-call

Call Koji build system methods

TLDR

Call build function with scratch option

$ koji call build '"[git+https://src.fedoraproject.org/rpms/vim.git#e847a50297a216229050bf4db3d06a139104e7cf]"' \"[target]\" --kwargs '{"opts":{"scratch": True]'
copy

Call build function with arch_override option
$ koji call build '"[git+https://src.fedoraproject.org/rpms/vim.git#e847a50297a216229050bf4db3d06a139104e7cf]"' \"[target]\" --kwargs '{"opts":{"arch_override":"sw_64"]'
copy

Call build function on default channel
$ koji call build '"[git+https://src.fedoraproject.org/rpms/vim.git#e847a50297a216229050bf4db3d06a139104e7cf]"' \"[target]\" --kwargs '{"channel":"default"}'
copy

Display help
$ koji call [[-h|--help]]
copy

SYNOPSIS

koji-call [options] method_name [param1=value1 ...]

PARAMETERS

--help
    Show a help message and exit.

--debug
    Print extensive debug messages to stderr.

--server=
    Specify the Koji hub URL for establishing connections.

--weburl=
    Specify the URL for the Koji web user interface.

--config=
    Use an alternate Koji configuration file instead of the default.

--user=
    Specify the username to use for authentication with the Koji hub.

--password=
    Provide the password for the specified user (use with caution, discouraged).

--keytab=
    Use a Kerberos keytab file for secure authentication.

--principal=
    Specify the Kerberos principal to use for authentication.

--no-krb
    Disable Kerberos authentication for the current connection.

--skip-auth
    Skip authentication entirely. Useful for calling publicly accessible API methods.

--api-url=
    Directly specify the Koji API endpoint URL, overriding config.

--profile=
    Use a named configuration profile defined in the Koji configuration file.

--json-output
    Format the command's output as JSON, suitable for programmatic parsing.

method_name
    The exact name of the Koji hub API method to be invoked (e.g., `listBuilds`, `getTag`).

param=value
    Key-value pairs representing parameters for the specified Koji method. Values are often interpreted as Python literals (e.g., `True`, `False`, `None`, numbers, lists), so strings must typically be quoted.

DESCRIPTION

koji-call is a powerful, low-level command-line utility from the Koji client suite. It provides direct access to the Koji build system's hub API, allowing users to invoke any Koji hub method by name. This command is particularly useful for scripting, automation, and advanced debugging, offering granular control over Koji operations beyond what high-level koji commands provide.

Users specify the method name and its parameters as key-value pairs, which are then passed to the Koji hub. koji-call handles authentication, typically via Kerberos or GSSAPI, using the configured Koji client settings. The output is usually a Python representation of the method's return value, or optionally JSON, making it suitable for programmatic parsing. It's an essential tool for Koji administrators and developers needing to interact with the Koji hub's full range of capabilities.

CAVEATS

koji-call requires precise knowledge of Koji hub API method names and their expected parameter types. Incorrect method names or malformed parameters will result in errors from the Koji hub.

The command's output, especially without --json-output, is often a Python representation that may require further parsing or evaluation in scripting contexts. Using --password on the command line is insecure and generally discouraged; prefer Kerberos or other secure authentication methods.

<B>KOJI API INTERACTION</B>

koji-call is the primary CLI method for direct interaction with the Koji XML-RPC/JSON-RPC API. It bypasses higher-level abstractions, making it suitable for advanced scripting where specific Koji hub functions need to be precisely controlled.

<B>PARAMETER HANDLING</B>

Parameters supplied as `key=value` pairs are often interpreted using Python's `eval` or similar mechanisms on the Koji client side before being sent to the hub. This means that Python literals (e.g., `True`, `False`, `None`, numbers, lists, dictionaries) can often be passed directly, while strings must typically be quoted (e.g., `name="my-build"`).

HISTORY

The Koji build system, developed by Red Hat, has been a cornerstone for building Fedora and other RPM-based distributions since the mid-2000s. koji-call emerged as part of the Koji client toolset, providing a necessary low-level interface to the Koji hub's extensive API. Its development paralleled the growth of Koji itself, offering a flexible way for developers and administrators to automate complex tasks, script custom workflows, and perform advanced diagnostics that might not be covered by the higher-level koji commands. Its design reflects the need for direct programmatic control over the build system's functions.

SEE ALSO

koji(1), koji-debug(1), python(1), curl(1)

Copied to clipboard