API: maintenance

class pubtools.pulplib.MaintenanceReport(*, last_updated: datetime | None = None, last_updated_by: str | None = None, entries=_Nothing.NOTHING)[source]

Represents the maintenance status of Pulp repositories.

On release-engineering Pulp servers, it’s possible to put individual repositories into “maintenance mode”. When in maintenance mode, external publishes of a repository will be blocked. Other operations remain possible.

This object holds information on the set of repositories currently in maintenance mode.

New in version 1.4.0.

Method generated by attrs for class MaintenanceReport.

last_updated

datetime in UTC when this report was last updated, if it’s the first time the report is created, current time is used.

last_updated_by

Person/party who updated the report last time.

entries

A list of MaintenanceEntry objects, indicating which repositories are in maintenance mode and details. If empty, then it means no repositories are in maintenance mode.

add(repo_ids, **kwargs)[source]

Add entries to maintenance report and update the timestamp. Every entry added to the report represents a repository in maintenance mode.

Parameters:
  • repo_ids (list[str]) –

    A list of repository ids. New entries with these repository ids will be added to the maintenance report.

    Note: it’s users’ responsibility to make sure the repository exists in the Pulp server, this method doesn’t check for the existence of repositories.

  • message (str) (optional) – Reason why put the repo to maintenance.

  • owner (str) (optional) – Who set the maintenance mode.

Returns:

MaintenanceReport

A copy of this maintenance report with added repositories.

remove(repo_ids, **kwargs)[source]

Remove entries from the maintenance report. Remove entries means the removing corresponding repositories from maintenance mode.

Parameters:
  • repo_ids (list[str]) – A list of repository ids. Entries match repository ids will be removed from the maintenance report.

  • owner (str) (optional) – Who unset the maintenance mode.

Returns:

MaintenanceReport

A copy of this maintenance report with removed repositories.

class pubtools.pulplib.MaintenanceEntry(*, repo_id: str, message: str | None = None, owner: str | None = None, started: datetime | None = None)[source]

Details about the maintenance status of a specific repository.

New in version 1.4.0.

Method generated by attrs for class MaintenanceEntry.

repo_id

ID of repository in maintenance.

Note: there is no guarantee that a repository of this ID currently exists in the Pulp server.

message

Why this repository is in maintenance.

owner

Who set this repository in maintenance mode.

started

datetime in UTC at when the maintenance started.