{productname} administrators can mirror external repositories by using the API.
-
You have set
FEATURE_REPO_MIRROR: true
in yourconfig.yaml
file.
-
Create a new repository mirror configuration by using the
POST /api/v1/repository/{repository}/mirror
endpoint:$ curl -X POST "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror" \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "is_enabled": <is_enabled>, "external_reference": "<external_reference>", "external_registry_username": "<external_registry_username>", "external_registry_password": "<external_registry_password>", "sync_start_date": "<sync_start_date>", "sync_interval": <sync_interval>, "robot_username": "<robot_username>", "root_rule": { "rule": "<rule>", "rule_type": "<rule_type>" } }'
-
You can return information about the mirror configuration by using the
GET /api/v1/repository/{repository}/mirror
endpoint:$ curl -X GET "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror" \ -H "Authorization: Bearer <access_token>"
Example output{"is_enabled": true, "mirror_type": "PULL", "external_reference": "https://quay.io/repository/argoproj/argocd", "external_registry_username": null, "external_registry_config": {}, "sync_interval": 86400, "sync_start_date": "2025-01-15T12:00:00Z", "sync_expiration_date": null, "sync_retries_remaining": 3, "sync_status": "NEVER_RUN", "root_rule": {"rule_kind": "tag_glob_csv", "rule_value": ["*.latest*"]}, "robot_username": "quayadmin+mirror_robot"}
-
You can use the
POST /api/v1/repository/{repository}/mirror/sync-now
endpoint to sync the repositories. For example:$ curl -X POST "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror/sync-now" \ -H "Authorization: Bearer <access_token>"
This command does not return output in the CLI.
-
Alternatively, you can cancel the sync with the
POST /api/v1/repository/{repository}/mirror/sync-cancel
endpoint.For example:$ curl -X POST "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror/sync-cancel" \
This command does not return output in the CLI.
-
After creating a mirror configuration, you can make changes with the
PUT /api/v1/repository/{repository}/mirror
command. For example, you might choose to disable automatic synchronizations:$ curl -X PUT "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror" \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "is_enabled": <false>, (1) "external_reference": "<external_reference>", "external_registry_username": "<external_registry_username>", "external_registry_password": "<external_registry_password>", "sync_start_date": "<sync_start_date>", "sync_interval": <sync_interval>, "robot_username": "<robot_username>", "root_rule": { "rule": "<rule>", "rule_type": "<rule_type>" } }'
-
Disables automatic synchronization.
-