Lightwell Network API access
Use the Lightwell Network API to integrate Lightwell data into your build pipelines, audit workflows, and automation tooling. You can query information such as a list of repositories, a list of packages within a repository, or retrieve metadata for each package.
To use the Lightwell Network API, perform the following steps:
- Create a service account in the Red Hat Hybrid Console. For more information, see Create a service account and generate credentials.
- Create a new User Access group, and add the Repositories viewer role and the service account that you previously created. For more information, see Add service accounts to a group and Organize service account access by group
Fetch a bearer token for the Lightwell Network API Copy linkLink copied!
Use the credentials generated when you created a service account to fetch a bearer token to access the API. For more information, see Guidelines for how to use service accounts with services.
Copy linkLink copied!
Request the token shortly before you access the Lightwell Network API. The token expires in approximately 15 minutes.
Lightwell Network API usage examples Copy linkLink copied!
The following examples show how to query the Lightwell Network API.
Copy linkLink copied!
- To list package versions across all Lightwell repositories, with the security level set to Remediated:
curl 'https://console.redhat.com/api/content-sources/v1.0/lightwell/package_versions?security_level=remediated' -H "Authorization: Bearer $TOKEN” - To list security advisories for Lightwell remediated packages, filtered by security level:
curl 'https://console.redhat.com/api/content-sources/v1.0/advisories?severity_min=Important' -H "Authorization: Bearer $TOKEN" - To retrieve metadata for a specific Python package by name and version:
curl 'https://console.redhat.com/api/content-sources/v1.0/lightwell/repositories/e4f8a1b2-3c56-4d78-9e01-abcdef123456/python_packages/requests/2.31.0' -H "Authorization: Bearer $TOKEN"where:e4f8a1b2-3c56-4d78-9e01-abcdef123456- Represents the repository UUID (
{UUID}). requests- Represents the Python package name (
{name}). 2.31.0- Represents the package version (
{version}).