8.11.2. Managing tag immutability by using the Red Hat Quay API
To prevent a tag from being changed or deleted, you can manage its immutability by using the Red Hat Quay API. Use the PUT /api/v1/repository/{repository}/tag/{tag} endpoint to set or remove immutability for a tag.
Prerequisites
- You have logged into Red Hat Quay.
-
You have set
FEATURE_IMMUTABLE_TAGStoTruein yourconfig.yamlfile.
Procedure
Use the
PUT /api/v1/repository/{repository}/tag/{tag}endpoint to set immutability for a tag. For example:$ curl -X PUT \ -H "Authorization: Bearer <bearer_token>" \ -H "Content-Type: application/json" \ --data '{ "immutable": true }' \ https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/tag/<tag>Example output
"Updated"Use the
PUT /api/v1/repository/{repository}/tag/{tag}endpoint to remove immutability for a tag. For example:$ curl -X PUT \ -H "Authorization: Bearer <bearer_token>" \ -H "Content-Type: application/json" \ --data '{ "immutable": false }' \ https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/tag/<tag>Example output
"Updated"