API
API root URL
https://<FQDN>/api/v2
Repomanager exposes an API that allows performing certain actions.
From a client host:
- Register or unregister a host into Repomanager
- Send general host information to Repomanager
- Send packages information to Repomanager
- Retrieve the configuration of a host profile from Repomanager
From a desktop:
- Import source repositories
- Upload a package to a repository
- Rebuild repository metadata
- ...
API key¶
An API key must be retrieved from userspace.
Once generated, copy the key and keep it safe. This key is used to authenticate with the API and to perform certain actions when there is no host Id+token pair available.
Info
If a new API key is generated, the old key becomes invalid and unusable.
Endpoints¶
Info
<REPO_ID> can be retrieved from the URL when you browse repository statistics or from the API when you list repositories from the API.
<SNAPSHOT_ID> can be retrieved from the URL when you browse a snapshot from the repositories list or from the API when you list snapshots of a repository.
Source repositories¶
| Endpoint and method | Authentication | Parameter(s) | Description | Example |
|---|---|---|---|---|
/source/GET |
<APIKEY> |
List all source repositories | ||
/source/<TYPE>/GET |
<APIKEY> |
type (required, in URL: deb or rpm) |
List all source repositories of a specific type | |
/source/<TYPE>/<NAME>GET |
<APIKEY> |
type (required, in URL: deb or rpm)name (required, in URL) |
Retrieve source repository details by name | |
/source/<TYPE>/importPOST |
<APIKEY> |
template (required, YAML file) |
Import source repositories from a YAML template file |
Repositories¶
| Endpoint and method | Authentication | Parameter(s) | Description | Example |
|---|---|---|---|---|
/repo/GET |
<APIKEY> |
List all repositories | ||
/repo/GET |
<APIKEY> |
List all repositories whose name is nginx |
||
/repo/GET |
<APIKEY> |
(RPM repos) List all repositories whose name is nginx and the release version is 8 |
||
/repo/GET |
<APIKEY> |
(DEB repos) List all repositories whose name is nginx, the distribution is bookworm and the section/component is nginx |
||
/repo/<REPO_ID>/GET |
<APIKEY> |
List all snapshots of a repository whose ID is 12 |
||
/repo/<REPO_ID>/GET |
<APIKEY> |
Get the ID of the most recent snapshot of a repository whose ID is 12 |
Snapshots¶
Hosts listing¶
| Endpoint and method | Authentication | Parameter(s) | Description | Example |
|---|---|---|---|---|
/hosts/GET |
<APIKEY> |
List all hosts | ||
/hosts/os/<OS>/<OS_VERSION?>GET |
<APIKEY> |
os (required, in URL)os_version (optional, in URL) |
List hosts by OS name and optionally by OS version. Use %20 to encode spaces in OS names (e.g. linux%20mint). |
With OS version: |
/hosts/kernel/<KERNEL>GET |
<APIKEY> |
kernel (required, in URL) |
List hosts by kernel version | |
/hosts/arch/<ARCH>GET |
<APIKEY> |
arch (required, in URL) |
List hosts by architecture | |
/hosts/profile/<PROFILE>GET |
<APIKEY> |
profile (required, in URL) |
List hosts by profile name | |
/hosts/environment/<ENV>GET |
<APIKEY> |
environment (required, in URL) |
List hosts by environment | |
/hosts/package/<PACKAGE>/<VERSION?>GET |
<APIKEY> |
package (required, in URL)version (optional, in URL) |
List hosts that have the specified package installed, optionally filtered by version | With version: |
/hosts/uptodateGET |
<APIKEY> |
List all up-to-date hosts (hosts with no or few available updates based on configured threshold) | ||
/hosts/outdatedGET |
<APIKEY> |
List all outdated hosts (hosts with available updates exceeding the configured threshold) |
Host profiles¶
| Endpoint and method | Authentication | Parameter(s) | Description | Example |
|---|---|---|---|---|
/profileGET |
<APIKEY>or <HOST_ID> and <HOST_TOKEN> |
Retrieve all available profile configurations | ||
/profile/<PROFILE>GET |
<APIKEY>or <HOST_ID> and <HOST_TOKEN> |
Retrieve profile's global configuration | ||
/profile/<PROFILE>/excludesGET |
<APIKEY>or <HOST_ID> and <HOST_TOKEN> |
Retrieve profile's package exclusion configuration | ||
/profile/<PROFILE>/reposGET |
<APIKEY>or <HOST_ID> and <HOST_TOKEN> |
Retrieve profile's repository configuration |
Host registration and status update¶
Mainly used by the linupdate agent, these endpoints allow to register a host to Repomanager and to send host information (general information, installed packages, available updates, package events) to Repomanager.
