Getting started
Service Account​
First, create a service account. This will be used to communicate with the API.
You'll need this for setting up the CLI tool, which will grant you access to the API.
CLI Tool​
In order to interact with the Calunga API you'll need to set up the CLI tool.
Once installed, update the base configuration file (~/.config/pulp/cli.toml) with the following values:
[cli]
base_url = "https://packages.redhat.com"
api_root = "/api/pulp/"
username = "<service-account-name>"
password = "<service-account-password>"
domain = "calunga-ui-dev"
headers = []
verify_ssl = false
format = "json"
dry_run = false
timeout = 0
verbose = 0
Once this is done run:
pulp status
You should see something like this:
{
"versions": [
{
"component": "core",
"version": "3.102.0",
"package": "pulpcore",
"module": "pulpcore.app",
"domain_compatible": true
},
...
"database_connection": {
"connected": true
},
"redis_connection": {
"connected": true
},
"storage": {
"total": null,
"used": 255644123405,
"free": null
},
"content_settings": {
"content_origin": "https://cert.console.redhat.com",
"content_path_prefix": "/api/pulp-content/"
},
"domain_enabled": true
}
Setup domain (done only once)​
- Create a domain:
pulp console populated-domain create --name calunga-ui-dev
- Ask someone to add you to the group: https://internal.console.redhat.com/api/pulp-mgmt/
- Your service account is the one added to the group
Curl​
Once you're in the domain group and have access to the APIs you should be able to make direct API calls using curl.
First set up these ENV variables:
export PULP_USERAME=<service-account>
export PULP_PASSWORD=<service-account-pass>
export PULP_DOMAIN=calunga-ui-dev
Now you're all set:
curl -L -u "$PULP_USERNAME:$PULP_PASSWORD" -H "Accept: application/json" -H "Content-Type: application/json" "https://packages.redhat.com/api/pulp/$PULP_DOMAIN/api/v3/content/python/packages" | jq