REST API package endpoints

The package endpoints under /rhui/api/v1/packages/ list, remove, and upload RPM packages in Red Hat Update Infrastructure repositories. All package endpoints require HTTP Basic authentication or a rhuiSessionId cookie.

Table 1. Package endpoints
Endpoint Description

GET /rhui/api/v1/packages/list/{repo_id}

List RPM packages in a repository.

POST /rhui/api/v1/packages/remove

Remove RPM packages from a custom repository.

POST /rhui/api/v1/packages/upload

Upload RPM packages to a custom repository.

GET /rhui/api/v1/packages/list/{repo_id}

Streams packages from the latest repository version of the named RPM (yum) repository only. The response is always application/x-ndjson, with one JSON object per line. Results are sorted by full RPM filename (name-version-release.arch.rpm) before streaming. Each package line includes mandatory RPM metadata under package; optional field query parameters add further keys from the Pulp RPM package JSON.

Table 2. Parameters
Parameter Type In Description

repo_id

RepoIdValue

path

Required. Red Hat Update Infrastructure repository identifier.

field

PackageListFieldValue

query

Optional. Repeat to include extra Pulp RPM package attributes. Each value must be one of the enum entries; mandatory response keys are ignored if listed. Omit this parameter entirely when no extra fields are needed.

name

PackageListNameFilter

query

Exact match on the RPM package name (Pulp name field, not the filename).

namepart

PackageListNamePartFilter

query

Partial match on the RPM package name (Pulp name field, not the filename).

version

PackageListVersionFilter

query

Exact match on the RPM package version field.

release

PackageListReleaseFilter

query

Partial match on the RPM package release field.

Returns 200 with package list events streamed as PackageListStreamEvent, sorted by filename (application/x-ndjson). Endpoint-specific code: 404 if the requested resource is not found. Common response codes also apply.

POST /rhui/api/v1/packages/remove

Removes matching RPM packages from a custom RPM repository, in the same way as rhui-manager packages remove. Unlike the CLI, this endpoint does not prompt for confirmation. The response returns the disassociate task_href and the list of RPM filenames queued for removal.

Table 3. Request body: PackageRemoveRequest (application/json)
Field Type Required Description

repo_id

string

Yes

Custom RPM repository id to remove packages from. Must identify an existing custom RPM repository.

package

string

Yes

Package name to remove.

vr

string

No

Optional version-release filter (version-release). When set, only that version-release of the package is removed.

Returns 202 with a PackageRemoveResponse object (application/json). Endpoint-specific code: 404 if the requested resource is not found. Common response codes also apply.

POST /rhui/api/v1/packages/upload

Uploads a package file or directory of RPMs into a custom RPM repository, in the same way as rhui-manager packages upload. The operation copies packages to a temporary directory, generates repository metadata, and queues an additive Pulp sync. The response returns the sync task_href and the list of RPM filenames queued for upload.

Table 4. Request body: PackageUploadRequest (application/json)
Field Type Required Description

repo_id

string

Yes

Custom RPM repository id that will receive the packages. Must identify an existing custom RPM repository.

packages

string

Yes

Absolute path on the RHUA to a .rpm file or a directory containing .rpm files. The path must exist and be readable.

Returns 202 with a PackageUploadResponse object (application/json). Endpoint-specific code: 404 if the requested resource is not found. Common response codes also apply.

Table 5. Common response codes
Number Description Response

201

Client configuration RPM created — application/json

ClientRpmResponse

400

Invalid request — application/json

Error

401

Authentication required or invalid credentials — application/json

Error

500

Unexpected internal error — application/json

Error

503

Required session signing configuration is missing or invalid — application/json

Error