kojismokydingo.types

Koji Smoky Dingo - Type Definitions

Python typing compatible definitions for the Koji dict types and enumerations

author:

Christopher O'Brien <obriencj@gmail.com>

license:

GPL v3

class ArchiveInfo[source]

Bases: TypedDict

Data representing a koji archive. These are typically obtained via the getArchive or listArchives XMLRPC calls, or from the kojismokydingo.as_archiveinfo function

arch: str

Only present on Image archives

artifact_id: str

Only present on maven archives. The maven artifact's name

btype: str

Name of this archive's koji BType. eg. 'maven' or 'image'

btype_id: int

ID of this archive's koji BType

build_id: int

ID of koji build owning this archive

buildroot_id: int

ID of the koji buildroot used to produce this archive

checksum: str

hex representation of the checksum for this archive

checksum_type: ChecksumType

type of cryptographic checksum used in the checksum field

extra: dict

additional metadata provided by content generators

filename: str

base filename for this archive

flags: str

Only present on Windows archives

group_id: str

Only present on maven archives. The maven artifact's group

id: int

internal ID

metadata_only: bool
platforms: List[str]

Only present on Windows archives

relpath: str

Only present on Windows archives

size: int

filesize in bytes

type_description: str

this archive's type description

type_extensions: str

space-delimited extensions shared by this archive's type

type_id: int

ID of the archive's type

type_name: str

name of the archive's type. eg. 'zip' or 'pom'

version: str

Only present on maven archives. The maven artifact's version

ArchiveInfos

An Iterable of ArchiveInfo dicts

alias of Iterable[ArchiveInfo]

ArchiveSpec

An archive ID, filename, or info dict

alias of int | str | ArchiveInfo

class ArchiveTypeInfo[source]

Bases: TypedDict

description: str

short title of the type

extensions: str

space separated extensions for this type

id: int

the internal ID of the archive type

name: str

the name of the archive type

class AuthType(value)[source]

Bases: IntEnum

Authentication method types

Normally only used in the kojismokydingo.types.UserInfo dict when obtained via the getLoggedInUser XMLRPC call.

See koji.AUTHTYPES

GSSAPI = 3

user authenticated via GSSAPI

KERB = 1

user authenticated via a Kerberos ticket

NORMAL = 0

user authenticated via password

SSL = 2

user authenticated via an SSL certificate

class BTypeInfo[source]

Bases: TypedDict

id: int

the internal ID of the btype

name: str

the name of the btype

class BuildInfo[source]

Bases: TypedDict

Data representing a koji build. These are typically obtained via the getBuild XMLRPC call, or from the kojismokydingo.as_buildinfo function.

build_id: int

The internal ID for the build record

cg_id: int

The ID of the content generator which has reserved or produced this build

cg_name: str

The name of the content generator which has reserved or produced this build

completion_time: str

ISO-8601 formatted UTC datetime stamp indicating when this build was completed

completion_ts: float

UTC timestamp indicating when this build was completed

creation_event_id: int

koji event ID at the creation of this build record

creation_time: str

ISO-8601 formatted UTC datetime stamp indicating when this build record was created

creation_ts: float

UTC timestamp indicating when this build record was created

draft: bool

Whether this build is flagged as a draft

Since:

koji 1.34.0

epoch: str

epoch of this build, or None if unspecified. This field is typically only used for RPM builds which have specified an epoch in their spec.

extra: dict

flexible additional information for this build, used by content generators

id: int

Same as build_id

maven_artifact_id: str | None

only present on Maven builds which have been loaded with type information

maven_group_id: str | None

only present on Maven builds which have been loaded with type information

maven_version: str | None

only present on Maven builds which have been loaded with type information

name: str

The name component of the NVR of this build. Should match the package_name field.

nvr: str

The unique NVR of the build, comprised of the name, version, and release separated by hyphens

owner_id: int

ID of the koji user that owns this build

owner_name: str

name of the koji user that owns this build

package_id: int

The corresponding package ID for this build.

package_name: str

The corresponding package name for this build. Should match the name field.

platform: str | None

only present on Windows builds which have been loaded with type information

release: str
source: str
start_time: str
start_ts: float
state: int

state of the build, see BuildState

task_id: int
version: str

version portion of the NVR for the build

volume_id: int

ID of the storage volume that the archives for this build will be stored on

volume_name: str

name of the storage that the archives for this build will be stored on

BuildInfos

An Iterable of BuildInfo dicts

alias of Iterable[BuildInfo]

BuildSpec

An indicator for a build in cases where the build may be communicated as its ID, its NVR, or as an already-loaded BuildInfo

alias of int | str | BuildInfo

class BuildState(value)[source]

Bases: IntEnum

Values for a BuildInfo's state.

See koji.BUILD_STATES

BUILDING = 0

The build is still in-progress

CANCELED = 4

The build did not complete successfully due to cancelation

COMPLETE = 1

The build has been completed successfully

DELETED = 2

The build has been deleted

FAILED = 3

The build did not complete successfully due to an error

class BuildrootInfo[source]

Bases: TypedDict

arch: str
br_type: BuildrootType
cg_id: int | None
cg_name: str | None
cg_version: str | None
container_arch: str
container_type: str
create_event_id: int
create_event_time: str
create_ts: float
extra: dict | None
host_arch: str | None
host_id: int
host_name: str
host_os: str | None
id: int
repo_create_event_id: int
repo_create_event_time: str
repo_id: int
repo_state: RepoState
retire_event_id: int
retire_event_time: str
retire_ts: float
state: BuildrootState
tag_id: int
tag_name: str
task_id: int
workdir: str
class BuildrootState(value)[source]

Bases: IntEnum

Values for a BuildrootInfo's br_state

See koji.BR_STATES

BUILDING = 2
EXPIRED = 3
INIT = 0
WAITING = 1
class BuildrootType(value)[source]

Bases: IntEnum

Values for a BuildrootInfo's br_type

See koji.BR_TYPES

EXTERNAL = 1
STANDARD = 0
class CGInfo[source]

Bases: TypedDict

Data representing a koji Content Generator. A dict of these are typically obtained via the listCGs XMLRPC call, mapping their friendly names to the CGInfo structure

id: int

internal identifier

users: List[str]

list of account names with access to perform CGImports using this content generator

CLIHandler

The callable signature used by Koji's CLI command handlers.

alias of Callable[[GOptions, ClientSession, List[str]], int]

class CLIProtocol(*args, **kwargs)[source]

Bases: Protocol

A Protocol variation on the CLIHandler callable definition.

class ChannelInfo[source]

Bases: TypedDict

id: int

internal channel ID

name: str

channel name

class ChecksumType(value)[source]

Bases: IntEnum

Supported checksum types

MD5 = 0
SHA1 = 1
SHA256 = 2
class DecoratedBuildInfo[source]

Bases: dict

archive_btype_ids: List[int]
archive_btype_names: List[str]
archive_cg_ids: List[int]
archive_cg_names: List[str]
build_id: int
cg_id: int
cg_name: str
completion_time: str
completion_ts: float
creation_event_id: int
creation_time: str
creation_ts: float
draft: bool
epoch: str
extra: dict
id: int
maven_artifact_id: str | None
maven_group_id: str | None
maven_version: str | None
name: str
nvr: str
owner_id: int
owner_name: str
package_id: int
package_name: str
platform: str | None
release: str
source: str
start_time: str
start_ts: float
state: int
task_id: int
version: str
volume_id: int
volume_name: str
class DecoratedHostInfo[source]

Bases: dict

arches: str
capacity: float
comment: str
description: str
enabled: bool
id: int
last_update: datetime

The last time that a host checked in with an update

name: str
ready: bool
task_load: float
user_id: int
class DecoratedPermInfo[source]

Bases: dict

A PermInfo decorated with the list of users that have been granted the permission. Obtained via kojismokydingo.users.collect_perminfo

id: int
name: str
users: List[PermUser]
class DecoratedTagExtra[source]

Bases: TypedDict

blocked: bool
name: str
tag_id: int
tag_name: str
value: str
class DecoratedUserInfo[source]

Bases: dict

A UserInfo decorated with additional fields that merge more data together from other calls. Obtained via kojismokydingo.users.collect_userinfo

authtype: AuthType
content_generators: List[NamedCGInfo]

names of granted content generators

groups: List[str] | None
id: int
krb_principal: str
krb_principals: List[str]
ksd_groups: List[UserGroup]

groups that user is a member of

ksd_members: List[UserInfo]

membership if user is a group

name: str
permissions: List[str]

names of granted permissions

statistics: UserStatistics | None

user's interaction statistics

status: UserStatus
usertype: UserType
class GOptions(defaults=None)[source]

Bases: Values

Represents the koji client configuration options as provided by the baseline koji CLI.

Values instances with these fields are fed to kojismokydingo.cli.SmokyDingo instances via their __call__ handlers.

Note that koji uses the optparse package, while koji smoky dingo uses the argparse package.

Returned by the get_options function from within the koji CLI utility, which cannot be imported normally. Default values for these are pulled from the profile configuration if unspecified as base CLI arguments.

authtype: str
cert: str = None
debug: bool = False
force_auth: bool = False
keytab: str = None
noauth: bool = False
password: str = None
plugin_paths: str = None
principal: str = None
profile: str
quiet: bool = False
runas: str = None
server: str
skip_main: bool = False
topdir: str
topurl: str
user: str
weburl: str
class HostInfo[source]

Bases: TypedDict

Data representing a koji host. These are typically obtained via the getHost XMLRPC call

arches: str

space-separated list of architectures this host can handle

capacity: float

maximum capacity for tasks, using the sum of the task weight values

comment: str

text describing the current status or usage

description: str

text describing this host

enabled: bool

whether this host is configured by the hub to take tasks

id: int

internal identifier

name: str

user name of this host's account, normally FQDN.

ready: bool

whether this host is reporting itself as active and prepared to accept tasks

task_load: float

the load of currently running tasks on the host. Compared with the capacity and a given task's weight, this can determine whether a task will 'fit' on the host

user_id: int

the user ID of this host's account. Hosts have a user account of type HOST, which is how they authenticate with the hub

HubVersionSpec

a koji version requirement, specified as either a string or tuple of ints

  • "1.25"

  • (1, 25)

alias of str | Tuple[int, ...]

KeySpec

a key specifier, used as either an index/item lookup on objects, or a unary callable which returns the desired field.

Typically non callable keyspec values are converted into an itemgetter using that value.

alias of Callable[[Any], Any] | Any

class ListTasksOptions[source]

Bases: TypedDict

Specific filter dictionary for listTasks API call

arch: List[str]
channel_id: int | List[int]
completeAfter: float | str
completeBeforer: float | str
createdAfter: float | str
createdBefore: float | str
decode: bool
host_id: int | List[int]
method: str
not_arch: List[str]
not_channel_id: int | List[int]
not_host_id: int | List[int]
not_owner: int | List[int]
not_parent: int | List[int]
not_state: List[int]
owner: int | List[int]
parent: int | List[int]
startedAfter: float | str
startedBefore: float | str
state: List[int]
class NamedCGInfo[source]

Bases: dict

A CGInfo with its name merged into it. Obtained via kojismokydingo.users.collect_cgs

id: int
name: str

friendly name for this content generator

users: List[str]
class PackageInfo[source]

Bases: TypedDict

getPackage XMLRPC call.

id: int

the internal ID for this package

name: str

the package name

PackageSpec

kojismokydingo.as_packageinfo

alias of int | str | PackageInfo

PathSpec

alias of str | PathInfo

class PermInfo[source]

Bases: TypedDict

id: int
name: str
PermSpec

a permission's ID or name

alias of int | str

class QueryOptions[source]

Bases: TypedDict

Various API calls use queryOpts dictionary for altering output format

asList: bool
countOnly: bool
group: str
limit: int
offset: int
order: str
class RPMInfo[source]

Bases: TypedDict

Data representing a koji RPM. These are typically obtained via the listRPMs XMLRPC call, or from the kojismokydingo.as_rpminfo function

arch: str

The RPM's architecture, eg. 'src' or 'x86_64'

build_id: int

The ID of the build owning this RPM

buildroot_id: int

The buildroot used by the task which produced this RPM

buildtime: int

UTC timestamp of the time that this RPM was produced

epoch: str

The RPM's epoch field, or None if not defined

external_repo_id: int

The external repo ID for this RPM record, or 0 if the RPM was built in this koji instance rather than being a reference to an external repository

external_repo_name: str

name identifying the repo that this RPM came from, or 'INTERNAL' if built in this koji instance

extra: dict

Optional extra data

id: int

The internal ID for this RPM

metadata_only: bool
name: str

The RPM's name field

nvr: str

The NVR (Name Version and Release) of the RPM

payloadhash: str

The MD5 in hex of the RPM's payload (the content past the headers)

release: str

The RPM's release field

size: int

The file size of the unsigned copy of the RPM

version: str

The RPM's version field

class RPMSignature[source]

Bases: TypedDict

Data representing an RPM signature in koji. Obtained via the queryRPMSigs XMLRPC API or from the kojismokydingo.bulk_load_rpm_sigs function.

rpm_id: int
sighash: str
sigkey: str
RPMSpec

Ways to indicate an RPM to as_rpminfo

alias of int | str | RPMInfo

class RepoInfo[source]

Bases: TypedDict

Data representing a koji build tag's repository. These are typically obtained via the getRepo or repoInfo XMLRPC calls, or from the kojismokydingo.as_repoinfo function.

create_event: int

koji event ID representing the point that the repo's tag configuration was snapshot from. Note that this doesn't always correlate to the creation time of the repo -- koji has the ability to generate a repository based on older events

create_ts: float

UTC timestamp indicating when this repo was created

creation_time: str

ISO-8601 formatted UTC datetime stamp indicating when this repo was created

dist: bool

whether this is a dist-repo or not

id: int

internal ID for this repository

state: RepoState

the current state of this repository

tag_id: int

ID of the tag from which this repo was generated. This value is not present in the output of the getRepo XMLRPC call as it is presumed that the caller already knows the tag's identity

tag_name: str

name of the tag from which this repo was generated. This value is not present in the output of the getRepo XMLRPC call as it is presumed that the caller already knows the tag's identity

task_id: int

ID of the task which generated this repository

class RepoState(value)[source]

Bases: IntEnum

An enumeration.

EXPIRED = 3
INIT = 0
PROBLEM = 4
READY = 1
class SearchResult[source]

Bases: TypedDict

as returned by the search XMLRPC call

id: int

result ID

name: str

result name

class TagBuildInfo[source]

Bases: dict

Decorated form of BuildInfo as returned by listTagged

Since:

2.1

build_id: int
cg_id: int
cg_name: str
completion_time: str
completion_ts: float
creation_event_id: int
creation_time: str
creation_ts: float
draft: bool
epoch: str
extra: dict
id: int
maven_artifact_id: str | None
maven_group_id: str | None
maven_version: str | None
name: str
nvr: str
owner_id: int
owner_name: str
package_id: int
package_name: str
platform: str | None
release: str
source: str
start_time: str
start_ts: float
state: int
tag_id: int

the ID of the tag this build was found in

tag_name: str

the name of the tag this build was found in

task_id: int
version: str
volume_id: int
volume_name: str
class TagGroupInfo[source]

Bases: TypedDict

getTagGroups XMLRPC call

biarchonly: bool
blocked: bool
description: str
display_name: str
exported: bool
group_id: int
grouplist: List[TagGroupReq]
is_default: bool
langonly: str
name: str
packagelist: List[TagGroupPackage]
tag_id: int
uservisible: bool
class TagGroupPackage[source]

Bases: TypedDict

basearchonly: str
blocked: bool
group_id: int
package: str
requires: str
tag_id: int
type: str
class TagGroupReq[source]

Bases: TypedDict

blocked: bool
group_id: int
is_metapkg: bool
name: str
req_id: int
tag_id: int
type: str
class TagInfo[source]

Bases: TypedDict

Data representing a koji tag. Typically obtained via the getTag XMLRPC call, or the kojismokydingo.as_taginfo and kojismokydingo.bulk_load_tags functions.

arches: str

space-separated list of architectures, or None

extra: Dict[str, str]

inheritable additional configuration data

id: int

internal ID of this tag

locked: bool

when locked, a tag will protest against having addtional builds associated with it

maven_include_all: bool

whether this tag should use the alternative maven-latest logic (including multiple builds of the same package name) when inherited by the build tag of a maven-enabled target

maven_support: bool

whether this tag should generate a maven repository when it is the build tag for a target

name: str
perm: str

name of the required permission to associate builds with this tag, or None

perm_id: int

ID of the required permission to associate builds with this tag, or None

TagInheritance

As returned by the getInheritanceData and getFullInheritance XMLRPC calls. A list of inheritance elements for a tag.

alias of List[TagInheritanceEntry]

class TagInheritanceEntry[source]

Bases: TypedDict

Data representing a single inheritance element. A list of these represents the inheritance data for a tag. Typically obtained via the getFullInheritance XMLRPC call.

child_id: int

the ID of the child tag in the inheritance link. The child tag inherits from the parent tag

currdepth: int

only present from the getFullInheritance call. The inheritance depth this link occurs at. A depth of 1 indicates that the child tag would be the one originally queried for its inheritance tree

filter: list

only present from the getFullInheritance call.

intransitive: bool

if true then this inheritance link would not be inherited. ie. this link only appears at a depth of 1, and is otherwise omitted.

maxdepth: int

additional parents in the inheritance tree from this link are only considered up to this depth, relative from the link's current depth. A maxdepth of 1 indicates that only the immediate parents will be inherited. A maxdepth of 0 indicates that the tag and none of its parents will be inherited. A value of None indicates no restriction.

name: str

the parent tag's name

nextdepth: int

only present from the getFullInheritance call.

noconfig: bool

if True then this inheritance link does not include tag configuration data, such as extras and groups

parent_id: int

the parent tag's internal ID

pkg_filter: str

a regex indicating which package entries may be inherited. If empty, all packages are inherited

priority: int

the inheritance link priority, which provides an ordering for links at the same depth with the same child tag (ie. what order the parent links for a given tag are processed in). Lower priorities are processed first.

class TagPackageInfo[source]

Bases: TypedDict

listPackages XMLRPC call.

blocked: bool

if True this entry represents a block

extra_arches: str

additional architectures, separated by spaces

owner_id: int

ID of the user who is the owner of the package for this tag

owner_name: str

name of the user who is the owner of the package for this tag

package_id: int

ID of the package

package_name: str

name of the package

tag_id: int

ID of the package listing's tag

tag_name: str

name of the package listing's tag

TagSpec

An indicator for a tag in cases where it may be communicated by its ID, its name, or as an already-loaded TagInfo

alias of int | str | TagInfo

class TargetInfo[source]

Bases: TypedDict

Data representing a koji build target. Typically obtained via the getBuildTarget or getBuildTargets XMLRPC calls, or the kojismokydingo.as_targetinfo function.

build_tag: int

internal ID of the target's build tag

build_tag_name: str

name of the target's build tag

dest_tag: int

internal ID of the target's destination tag

dest_tag_name: str

name of the target's destination tag

id: int

internal ID of this build target

name: str

name of this build target

TargetSpec

An indicator for a target in cases where it may be communicated by its ID, its name, or an already-loaded TargetInfo

alias of int | str | TargetInfo

class TaskInfo[source]

Bases: TypedDict

getTaskInfo XMLRPC call or kojismokydingo.as_taskinfo function

arch: str

task architecture, or 'noarch'

awaited: bool | None

True if this task is currently being waiting-for by its parent task. False if this task is no longer being waited-for. None if the task was never waited-for.

channel_id: int

internal ID of the channel from which a host will be selected to take this task

completion_time: str

ISO-8601 formatted UTC datetime stamp indicating when this task was completed, or None if not completed

completion_ts: float

UTC timestamp indicating when this task was completed, or None if not completed

create_time: str

ISO-8601 formatted UTC datetime stamp indicating when this task was created

create_ts: float

UTC timestamp indicating when this task was created

host_id: int

host which has taken this task, or None

id: int

internal task ID

label: str

task label, or None

method: str

task method, indicates the type of work to be done

owner: int

ID of the user that initiated this task

parent: int

ID of the parent task, or None

priority: int
request: List[Any]

The task request info. Only present when the request parameter to the getTaskInfo call is True. Note that the as_taskinfo function does set that parameter to True.

start_time: str

ISO-8601 formatted UTC datetime stamp indicating when this task was started by a host, or None if not yet started

start_ts: float

UTC timestamp indicating when this task was started by a host, or None if not yet started

state: TaskState

the current state of this task

waiting: bool | None

True if this task is currently waiting for any of its subtasks to complete. False if this task is not waiting, or None if the task never needed to wait.

weight: float

value which ascribes the general resources needed to perform this task. hosts have a limit to the number of resources which can be used to run tasks in parallel

TaskSpec

task ID or TaskInfo dict

alias of int | TaskInfo

class TaskState(value)[source]

Bases: IntEnum

An enumeration.

ASSIGNED = 4
CANCELED = 3
CLOSED = 2
FAILED = 5
FREE = 0
OPEN = 1
class UserGroup[source]

Bases: TypedDict

The results of the getUserGroups XMLRPC call

Since:

2.2.0

id: int

the ID of the group

name: str

the name of the group

class UserInfo[source]

Bases: TypedDict

Data representing a koji user account. These are typically obtained via the getUser or getLoggedInUser XMLRPC calls, or the kojismokydingo.as_userinfo function.

authtype: AuthType

Only present from the getLoggedInUser call

groups: List[str] | None

names of groups that this user is a member of

id: int

internal identifer

krb_principal: str

kerberos principal associated with the user. Only used in koji before 1.19 or when using the getLoggedInUser call.

krb_principals: List[str]

list of kerberos principals associated with the user. Used in koji from 1.19 onwards.

name: str

the username

status: UserStatus

status of the account. not present for members from the getGroupMembers call.

usertype: UserType

type of the account

UserSpec

Acceptable ways to specify a user, either by a UserInfo dict, a username str, or a user's int ID

alias of int | str | UserInfo

class UserStatistics[source]

Bases: TypedDict

build_count: int

count of builds owned by this user

last_build: BuildInfo | None

the most recent build by this user

last_task: TaskInfo | None

the most recent task by this user

package_count: int

count of packages owned by this user

task_count: int

count of tasks submitted by this user

class UserStatus(value)[source]

Bases: IntEnum

Valid values for the 'status' item of a UserInfo dict

BLOCKED = 1

account is blocked. May not call XMLRPC endpoints requiring authentication

NORMAL = 0

account is enabled

class UserType(value)[source]

Bases: IntEnum

Valid values for the 'usertype' item of a UserInfo dict

GROUP = 2

Account is a group

HOST = 1

Account is a build host

NORMAL = 0

Account is a normal user