clear-repo

Remove all contents from one or more Pulp repositories.

This command will remove contents from repositories and record information on what was removed. Removal may optionally be filtered to selected content types.

usage: pubtools-pulp-clear-repo [-h] [--debug] [--udcache-url UDCACHE_URL]
                                [--udcache-user UDCACHE_USER]
                                [--udcache-password UDCACHE_PASSWORD]
                                [--cdn-url CDN_URL] [--cdn-cert CDN_CERT]
                                [--cdn-key CDN_KEY]
                                [--cdn-ca-cert CDN_CA_CERT]
                                [--cdn-arl-template [CDN_ARL_TEMPLATE [CDN_ARL_TEMPLATE ...]]]
                                [--fastpurge-host FASTPURGE_HOST]
                                [--fastpurge-client-token FASTPURGE_CLIENT_TOKEN]
                                [--fastpurge-client-secret FASTPURGE_CLIENT_SECRET]
                                [--fastpurge-access-token FASTPURGE_ACCESS_TOKEN]
                                [--fastpurge-root-url FASTPURGE_ROOT_URL]
                                [--pulp-url PULP_URL] [--pulp-user PULP_USER]
                                [--pulp-password PULP_PASSWORD]
                                [--pulp-certificate PULP_CERTIFICATE]
                                [--pulp-certificate-key PULP_CERTIFICATE_KEY]
                                [--pulp-insecure]
                                [--pulp-throttle PULP_THROTTLE] [--pulp-fake]
                                [--skip SKIP] [--content-type CONTENT_TYPE]
                                repo [repo ...]

Positional Arguments

repo

Repositories to be cleared

Named Arguments

--debug, -d

Show debug logs; can be provided up to three times to enable more logs

Default: 0

--skip

skip given comma-separated sub-steps

--content-type

remove only content of these comma-separated type(s). e.g. –content-type=(rpm, srpm, modulemd, iso, modulemd_defaults, package_langpacks, or erratum and so on)

Unified Downloads Cache environment

--udcache-url

Base URL of UD cache flush API; if omitted, UD cache flush features are disabled.

--udcache-user

Username for UD cache flush

--udcache-password

Password for UD cache flush (or set UDCACHE_PASSWORD)

Default: “”

CDN Client environment

--cdn-url

Base URL of CDN, if omitted, CDN won’t be requested for special data (e.g. headers for ARLs)

--cdn-cert

Client certificate for CDN client

--cdn-key

Client key for CDN client

--cdn-ca-cert

CA certificate for CDN

--cdn-arl-template

ARL template used for flushing cache by ARL

Default: []

Akamai FastPurge environment

--fastpurge-host

FastPurge hostname (xxx.purge.akamaiapis.net)

--fastpurge-client-token

Fast Purge client token

--fastpurge-client-secret

FastPurge client secret (or set FASTPURGE_SECRET environment variable)

Default: “”

--fastpurge-access-token

FastPurge access token

--fastpurge-root-url

Root URL of CDN for all cache purges (or set FASTPURGE_ROOT_URL environment variable). If omitted, FastPurge features are disabled.

Default: “”

Pulp environment

--pulp-url

Pulp server URL

--pulp-user

Pulp username

--pulp-password

Pulp password (or set PULP_PASSWORD environment variable)

--pulp-certificate

Pulp certificate. Can also be a single file (.pem)

--pulp-certificate-key

Pulp certificate key

--pulp-insecure

Allow unverified HTTPS connection to Pulp

Default: False

--pulp-throttle

Allows to enqueue or run only specified number of Pulp tasks at one moment (or set PULP_THROTTLE environment variable)

--pulp-fake

Use a fake in-memory Pulp client rather than interacting with a real server. For development/testing only, may have limited functionality.

Default: False

Example

A typical invocation of clear-repo would look like this:

pubtools-pulp-clear-repo \
  --pulp-url https://pulp.example.com/ \
  --pulp-user admin \
  --pulp-password XXXXX \
  my-repo1 my-repo2 ...

All content of the mentioned repositories would be removed.

Example: skipping publish

If you know that there’s no point in publishing Pulp repositories (for example, you’re about to push new content into repos after clearing them), you can speed up the task by skipping publish:

pubtools-pulp-clear-repo \
  --pulp-url https://pulp.example.com/ \
  --pulp-user admin \
  --pulp-password XXXXX \
  --skip publish \
  my-repo1 my-repo2 ...

Example: with cache flush

If your Pulp server is configured to publish to an Akamai CDN, usage of the Akamai FastPurge API for cache flushing may be enabled to flush cache after publishing repositories.

This is enabled by providing a value for --fastpurge-root-url. FastPurge credentials may also be provided; if omitted, the command will attempt to use a local edgerc file for authentication.

pubtools-pulp-clear-repo \
  --pulp-url https://pulp.example.com/ \
  --pulp-user admin \
  --pulp-password XXXXX \
  --fastpurge-root-url https://cdn.example.com/ \
  my-repo1 my-repo2 ...