Questo contenuto non è disponibile nella lingua selezionata.
Chapter 6. Red Hat Quay API examples
The remainder of this chapter provides Red Hat Quay API examples for the features in which they are available.
6.1. Managing a user application by using the API
Red Hat Quay users can create, list information about, and delete a user application that can be used as an alternative to using your password for Docker, Podman, or other service providers. User application tokens work like your username and password, but are encrypted and do not provide any information to third parties regarding who is accessing Red Hat Quay.
After creation via the CLI, the user application token is listed under User Settings of the Red Hat Quay UI. Note that this differs from an application token that is created under user settings, and should be considered a different application entirely.
Use the following procedure to create a user application token.
Prerequisites
- You have created an OAuth 2 access token.
Procedure
- Create a user application by entering the - POST /api/v1/user/apptokenAPI call:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"token": {"uuid": "6b5aa827-cee5-4fbe-a434-4b7b8a245ca7", "title": "MyAppToken", "last_accessed": null, "created": "Wed, 08 Jan 2025 19:32:48 -0000", "expiration": null, "token_code": "K2YQB1YO0ABYV5OBUYOMF9MCUABN12Y608Q9RHFXBI8K7IE8TYCI4WEEXSVH1AXWKZCKGUVA57PSA8N48PWED9F27PXATFUVUD9QDNCE9GOT9Q8ACYPIN0HL"}}- {"token": {"uuid": "6b5aa827-cee5-4fbe-a434-4b7b8a245ca7", "title": "MyAppToken", "last_accessed": null, "created": "Wed, 08 Jan 2025 19:32:48 -0000", "expiration": null, "token_code": "K2YQB1YO0ABYV5OBUYOMF9MCUABN12Y608Q9RHFXBI8K7IE8TYCI4WEEXSVH1AXWKZCKGUVA57PSA8N48PWED9F27PXATFUVUD9QDNCE9GOT9Q8ACYPIN0HL"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can obtain information about your application, including when the application expires, by using the - GET /api/v1/user/apptokencommand. For example:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "http://quay-server.example.com/api/v1/user/apptoken" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "http://quay-server.example.com/api/v1/user/apptoken"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - {"tokens": [{"uuid": "6b5aa827-cee5-4fbe-a434-4b7b8a245ca7", "title": "MyAppToken", "last_accessed": null, "created": "Wed, 08 Jan 2025 19:32:48 -0000", "expiration": null}], "only_expiring": null}- {"tokens": [{"uuid": "6b5aa827-cee5-4fbe-a434-4b7b8a245ca7", "title": "MyAppToken", "last_accessed": null, "created": "Wed, 08 Jan 2025 19:32:48 -0000", "expiration": null}], "only_expiring": null}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can obtain information about a specific user application by entering the - GET /api/v1/user/apptoken/{token_uuid}command:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "http://quay-server.example.com/api/v1/user/apptoken/<token_uuid>" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "http://quay-server.example.com/api/v1/user/apptoken/<token_uuid>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"token": {"uuid": "6b5aa827-cee5-4fbe-a434-4b7b8a245ca7", "title": "MyAppToken", "last_accessed": null, "created": "Wed, 08 Jan 2025 19:32:48 -0000", "expiration": null, "token_code": "K2YQB1YO0ABYV5OBUYOMF9MCUABN12Y608Q9RHFXBI8K7IE8TYCI4WEEXSVH1AXWKZCKGUVA57PSA8N48PWED9F27PXATFUVUD9QDNCE9GOT9Q8ACYPIN0HL"}}- {"token": {"uuid": "6b5aa827-cee5-4fbe-a434-4b7b8a245ca7", "title": "MyAppToken", "last_accessed": null, "created": "Wed, 08 Jan 2025 19:32:48 -0000", "expiration": null, "token_code": "K2YQB1YO0ABYV5OBUYOMF9MCUABN12Y608Q9RHFXBI8K7IE8TYCI4WEEXSVH1AXWKZCKGUVA57PSA8N48PWED9F27PXATFUVUD9QDNCE9GOT9Q8ACYPIN0HL"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete or revoke a user application token by using the - DELETE /api/v1/user/apptoken/{token_uuid}endpoint:- curl -X DELETE \ -H "Authorization: Bearer <access_token>" \ "http://quay-server.example.com/api/v1/user/apptoken/<token_uuid>" - $ curl -X DELETE \ -H "Authorization: Bearer <access_token>" \ "http://quay-server.example.com/api/v1/user/apptoken/<token_uuid>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. You can return a list of tokens by entering one of the aforementioned commands. 
6.2. Discovering Red Hat Quay API endpoints
Red Hat Quay API endpoints are discoverable by using the API.
Use the following procedure to discover available API endpoints.
Prerequisites
- You have created an OAuth 2 access token.
Procedure
- Enter the following - GET /api/v1/discoverycommand to list all of the API endpoints available in the swagger API format:- curl -X GET "https://<quay-server.example.com>/api/v1/discovery?query=true" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/discovery?query=true" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - --- : "Manage the tags of a repository."}, {"name": "team", "description": "Create, list and manage an organization's teams."}, {"name": "trigger", "description": "Create, list and manage build triggers."}, {"name": "user", "description": "Manage the current user."}, {"name": "userfiles", "description": ""}]} ---- --- : "Manage the tags of a repository."}, {"name": "team", "description": "Create, list and manage an organization's teams."}, {"name": "trigger", "description": "Create, list and manage build triggers."}, {"name": "user", "description": "Manage the current user."}, {"name": "userfiles", "description": ""}]} ---- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.3. Obtaining Red Hat Quay API error details
Red Hat Quay API error details are discoverable by using the API.
Use the following procedure to discover error details.
Prerequisites
- You have created an OAuth 2 access token.
Procedure
- You can obtain error details of the API by entering the - GET /api/v1/error/{error_type}endpoint. Note that you must include one of the following error codes:- Expand - HTTP Code - Description - Schema - 200 - Successful invocation - 400 - Bad Request - 401 - Session required - 403 - Unauthorized access - 404 - Not found - curl -X GET "https://<quay-server.example.com>/api/v1/error/<error_type>" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/error/<error_type>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - curl: (7) Failed to connect to quay-server.example.com port 443 after 0 ms: Couldn't connect to server - curl: (7) Failed to connect to quay-server.example.com port 443 after 0 ms: Couldn't connect to server- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.4. Global messages
Global messages can be created, obtained, or deleted by using the Red Hat Quay API. Use the following procedure to create, obtain, or delete a global message.
Prerequisites
- You have created an OAuth 2 access token.
Procedure
- Create a message by using the - POST /api/v1/messageendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
- Use the - GET /api/v1/messagescommand to return the list of global messages:- curl -X GET "https://<quay-server.example.com>/api/v1/messages" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/messages" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"messages": [{"uuid": "ecababd4-3451-4458-b5db-801684137444", "content": "Hi", "severity": "info", "media_type": "text/plain"}]}- {"messages": [{"uuid": "ecababd4-3451-4458-b5db-801684137444", "content": "Hi", "severity": "info", "media_type": "text/plain"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Delete the global message by using the - DELETE /api/v1/message/{uuid}endpoint:- curl -X DELETE "https://<quay-server.example.com>/api/v1/message/<uuid>" \ -H "Authorization: Bearer <access_token>"- $ curl -X DELETE "https://<quay-server.example.com>/api/v1/message/<uuid>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
6.5. Viewing usage logs by using the API
Logs can be viewed by Organization or repository by using the API. They can also be aggregated (grouped), or listed with more detailed. Logs can also be viewed by user, a specific date range, or by page.
6.5.1. Viewing aggregated logs
					Aggregated logs can be viewed by Organization, repository, a specific user, or the current user. You can also pass in optional commands like performer, starttime/endtime, and next_page to filter results.
				
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Use the - GET /api/v1/user/aggregatelogsAPI endpoint to return the aggregated (or grouped) logs for the current user:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "https://<quay-server.example.com>/api/v1/user/aggregatelogs" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "https://<quay-server.example.com>/api/v1/user/aggregatelogs"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"aggregated": [{"kind": "create_tag", "count": 1, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}, {"kind": "manifest_label_add", "count": 1, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}, {"kind": "push_repo", "count": 2, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}, {"kind": "revert_tag", "count": 1, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}]}- {"aggregated": [{"kind": "create_tag", "count": 1, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}, {"kind": "manifest_label_add", "count": 1, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}, {"kind": "push_repo", "count": 2, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}, {"kind": "revert_tag", "count": 1, "datetime": "Tue, 18 Jun 2024 00:00:00 -0000"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - You can also pass in the - performerand- starttime/endtimequeries to obtain aggregated logs for a specific user between a specific time period. For example:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "<quay-server.example.com>/api/v1/user/aggregatelogs?performer=<username>&starttime=<MM/DD/YYYY>&endtime=<MM/DD/YYYY>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "<quay-server.example.com>/api/v1/user/aggregatelogs?performer=<username>&starttime=<MM/DD/YYYY>&endtime=<MM/DD/YYYY>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Aggregated logs can also be viewed by Organization by using the - GET /api/v1/organization/{orgname}/aggregatelogs. For example:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "<quay-server.example.com>/api/v1/organization/{orgname}/aggregatelogs"- $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "<quay-server.example.com>/api/v1/organization/{orgname}/aggregatelogs"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Aggregated logs can also be viewed by repository by using the - GET /api/v1/repository/{repository}/aggregatelogscommand. The following example includes the- starttime/endtimefields:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "<quay-server.example.com>/api/v1/repository/<repository_name>/<namespace>/aggregatelogs?starttime=2024-01-01&endtime=2024-06-18"" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "<quay-server.example.com>/api/v1/repository/<repository_name>/<namespace>/aggregatelogs?starttime=2024-01-01&endtime=2024-06-18""- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.5.2. Viewing detailed logs
					Detailed logs can be viewed by Organization, repository, a specific user, or the current user. You can also pass in optional fields like performer, starttime/endtime, and next_page to filter results.
				
Procedure
- Use the - GET /api/v1/user/logsAPI endpoint to return a list of log entries for a user. For example:- curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" "<quay-server.example.com>/api/v1/user/logs" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" "<quay-server.example.com>/api/v1/user/logs"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - You can also pass in the - performerand- startime/endtimequeries to obtain logs for a specific user between a specific time period. For example:- curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" "http://quay-server.example.com/api/v1/user/logs?performer=quayuser&starttime=01/01/2024&endtime=06/18/2024" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" "http://quay-server.example.com/api/v1/user/logs?performer=quayuser&starttime=01/01/2024&endtime=06/18/2024"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - --- {"start_time": "Mon, 01 Jan 2024 00:00:00 -0000", "end_time": "Wed, 19 Jun 2024 00:00:00 -0000", "logs": [{"kind": "revert_tag", "metadata": {"username": "quayuser", "repo": "busybox", "tag": "test-two", "manifest_digest": "sha256:57583a1b9c0a7509d3417387b4f43acf80d08cdcf5266ac87987be3f8f919d5d"}, "ip": "192.168.1.131", "datetime": "Tue, 18 Jun 2024 18:59:13 -0000", "performer": {"kind": "user", "name": "quayuser", "is_robot": false, "avatar": {"name": "quayuser", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}}}, {"kind": "push_repo", "metadata": {"repo": "busybox", "namespace": "quayuser", "user-agent": "containers/5.30.1 (github.com/containers/image)", "tag": "test-two", "username": "quayuser", } ---- --- {"start_time": "Mon, 01 Jan 2024 00:00:00 -0000", "end_time": "Wed, 19 Jun 2024 00:00:00 -0000", "logs": [{"kind": "revert_tag", "metadata": {"username": "quayuser", "repo": "busybox", "tag": "test-two", "manifest_digest": "sha256:57583a1b9c0a7509d3417387b4f43acf80d08cdcf5266ac87987be3f8f919d5d"}, "ip": "192.168.1.131", "datetime": "Tue, 18 Jun 2024 18:59:13 -0000", "performer": {"kind": "user", "name": "quayuser", "is_robot": false, "avatar": {"name": "quayuser", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}}}, {"kind": "push_repo", "metadata": {"repo": "busybox", "namespace": "quayuser", "user-agent": "containers/5.30.1 (github.com/containers/image)", "tag": "test-two", "username": "quayuser", } ---- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/logsendpoint to return logs for a specified organization:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "http://<quay-server.example.com>/api/v1/organization/{orgname}/logs"- $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "http://<quay-server.example.com>/api/v1/organization/{orgname}/logs"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/repository/{repository}/logsendpoint to return logs for a specified repository:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "http://<quay-server.example.com>/api/v1/repository/{repository}/logs"- $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "http://<quay-server.example.com>/api/v1/repository/{repository}/logs"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.6. Exporting logs by using the API
Detailed logs can be exported to a callback URL or to an email address.
Prerequisites
- You have Created an OAuth access token.
- 
						You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Use the - POST /api/v1/user/exportlogsendpoint to export logs for the current user:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"export_id": "6a0b9ea9-444c-4a19-9db8-113201c38cd4"}- {"export_id": "6a0b9ea9-444c-4a19-9db8-113201c38cd4"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/organization/{orgname}/exportlogsendpoint to export logs for an Organization:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/repository/{repository}/exportlogsendpoint to export logs for a repository:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.7. Adding and managing labels by using the API
Red Hat Quay administrators can add and manage labels for tags with the API by using the following procedure.
Prerequisites
- You have Created an OAuth access token.
- 
						You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Use the - GET /api/v1/repository/{repository}/manifest/{manifestref}command to retrieve the details of a specific manifest in a repository:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref> - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/repository/{repository}/manifest/{manifestref}/labelscommand to retrieve a list of labels for a specific manifest:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"labels": [{"id": "e9f717d2-c1dd-4626-802d-733a029d17ad", "key": "org.opencontainers.image.url", "value": "https://github.com/docker-library/busybox", "source_type": "manifest", "media_type": "text/plain"}, {"id": "2d34ec64-4051-43ad-ae06-d5f81003576a", "key": "org.opencontainers.image.version", "value": "1.36.1-glibc", "source_type": "manifest", "media_type": "text/plain"}]}- {"labels": [{"id": "e9f717d2-c1dd-4626-802d-733a029d17ad", "key": "org.opencontainers.image.url", "value": "https://github.com/docker-library/busybox", "source_type": "manifest", "media_type": "text/plain"}, {"id": "2d34ec64-4051-43ad-ae06-d5f81003576a", "key": "org.opencontainers.image.version", "value": "1.36.1-glibc", "source_type": "manifest", "media_type": "text/plain"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/repository/{repository}/manifest/{manifestref}/labels/{labelid}command to obtain information about a specific manifest:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<label_id> - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<label_id>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": "e9f717d2-c1dd-4626-802d-733a029d17ad", "key": "org.opencontainers.image.url", "value": "https://github.com/docker-library/busybox", "source_type": "manifest", "media_type": "text/plain"}- {"id": "e9f717d2-c1dd-4626-802d-733a029d17ad", "key": "org.opencontainers.image.url", "value": "https://github.com/docker-library/busybox", "source_type": "manifest", "media_type": "text/plain"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can add an additional label to a manifest in a given repository with the - POST /api/v1/repository/{repository}/manifest/{manifestref}/labelscommand. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"label": {"id": "346593fd-18c8-49db-854f-4cb1fb76ff9c", "key": "example-key", "value": "example-value", "source_type": "api", "media_type": "text/plain"}}- {"label": {"id": "346593fd-18c8-49db-854f-4cb1fb76ff9c", "key": "example-key", "value": "example-value", "source_type": "api", "media_type": "text/plain"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete a label using the - DELETE /api/v1/repository/{repository}/manifest/{manifestref}/labels/{labelid}command:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<labelid> - $ curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<labelid>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. You can use one of the commands above to ensure that it was successfully removed. 
6.8. Using the API to mirror a repository
Red Hat Quay administrators can mirror external repositories by using the API.
Prerequisites
- 
						You have set FEATURE_REPO_MIRROR: truein yourconfig.yamlfile.
Procedure
- Create a new repository mirror configuration by using the - POST /api/v1/repository/{repository}/mirrorendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can return information about the mirror configuration by using the - GET /api/v1/repository/{repository}/mirrorendpoint:- curl -X GET "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 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"}- {"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"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can use the - POST /api/v1/repository/{repository}/mirror/sync-nowendpoint 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>"- $ curl -X POST "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror/sync-now" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
- Alternatively, you can cancel the sync with the - POST /api/v1/repository/{repository}/mirror/sync-cancelendpoint.For example:- curl -X POST "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror/sync-cancel" \ - $ curl -X POST "https://<quay-server.example.com>/api/v1/repository/<namespace>/<repo>/mirror/sync-cancel" \- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 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}/mirrorcommand. For example, you might choose to disable automatic synchronizations:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Disables automatic synchronization.
 
6.9. Establishing quota with the Red Hat Quay API
You can establish quota for an organization or users, and tailor quota policies to suit the needs of your registry.
The following sections show you how to establish quota for an organization, a user, and then how to modify those settings.
6.9.1. Managing organization quota with the Red Hat Quay API
When an organization is first created, it does not have an established quota. You can use the API to check, create, change, or delete quota limitations for an organization.
Prerequisites
- You have generated an OAuth access token.
Procedure
- To set a quota for an organization, you can use the - POST /api/v1/organization/{orgname}/quotaendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Created" - "Created"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/quotacommand to return information about the policy, including the ID number, which is required for other organization quota endpoints. For example:- curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq - $ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - [{"id": 1, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}]- [{"id": 1, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - After you obtain the ID number, you can use the - GET /api/v1/organization/{orgname}/quota/{quota_id}command to list the quota policy. For example:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 1, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}- {"id": 1, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can use the - PUT /api/v1/organization/{orgname}/quota/{quota_id}command to modify the existing quota limitation. Note that this requires the policy ID. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 1, "limit_bytes": 21474836480, "limit": "20.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}- {"id": 1, "limit_bytes": 21474836480, "limit": "20.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- An organization’s quota can be deleted with the - DELETE /api/v1/organization/{orgname}/quota/{quota_id}command. For example:- curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>" \ -H "Authorization: Bearer <access_token>"- $ curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
6.9.2. Setting quota limits for an organization with the Red Hat Quay API
You can set specific quota limits for an organization so that, when exceeded, a warning is returned, or the pushed image is denied altogether.
Procedure
- Use the - POST /api/v1/organization/{orgname}/quota/{quota_id}/limitcommand to create a quota policy that rejects images if they exceeded the allotted quota. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Created" - "Created"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/quota/{quota_id}/limitto obtain the ID of the quota limit. For example:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>/limit" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>/limit" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - [{"id": 2, "type": "Reject", "limit_percent": 90}]- [{"id": 2, "type": "Reject", "limit_percent": 90}]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Update the policy with the - PUT /api/v1/organization/{orgname}/quota/{quota_id}/limit/{limit_id}endpoint. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 3, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 2, "type": "Warning", "limit_percent": 80}], "default_config_exists": false}- {"id": 3, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 2, "type": "Warning", "limit_percent": 80}], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete the quota limit with the - DELETE /api/v1/organization/{orgname}/quota/{quota_id}/limit/{limit_id}endpoint:- curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>/limit/<limit_id>" \ -H "Authorization: Bearer <access_token>"- $ curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/<orgname>/quota/<quota_id>/limit/<limit_id>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
6.9.3. Obtaining quota limits for the user with the Red Hat Quay API
You can specify quota and limitations for users so that, when exceeded, a warning is returned, or the pushed image is denied altogether. Quota limits for users must be set on the Red Hat Quay UI. The following APIs can be used to view the quota limits for the user that is logged in.
Procedure
- Use the - GET /api/v1/user/quotacommand to return information about the quota limitations:- curl -X GET "https://<quay-server.example.com>/api/v1/user/quota" \ -H "Authorization: Bearer <access_token>" - $ curl -X GET "https://<quay-server.example.com>/api/v1/user/quota" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - [{"id": 4, "limit_bytes": 2199023255552, "limit": "2.0 TiB", "default_config": false, "limits": [], "default_config_exists": false}]- [{"id": 4, "limit_bytes": 2199023255552, "limit": "2.0 TiB", "default_config": false, "limits": [], "default_config_exists": false}]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After you have received the quota ID, you can pass it in with the - GET /api/v1/user/quota/{quota_id}endpoint to return information about the limitation:- curl -X GET "https://<quay-server.example.com>/api/v1/user/quota/{quota_id}" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/user/quota/{quota_id}" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 4, "limit_bytes": 2199023255552, "limit": "2.0 TiB", "default_config": false, "limits": [], "default_config_exists": false}- {"id": 4, "limit_bytes": 2199023255552, "limit": "2.0 TiB", "default_config": false, "limits": [], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The limitations can be viewed by using the - GET /api/v1/user/quota/{quota_id}/limitendpoint. For example:- curl -X GET "https://<quay-server.example.com>/api/v1/user/quota/{quota_id}/limit" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/user/quota/{quota_id}/limit" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - [{"id": 3, "type": "Reject", "limit_percent": 100}]- [{"id": 3, "type": "Reject", "limit_percent": 100}]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Additional information about the entire policy can be returned using the - GET /api/v1/user/quota/{quota_id}/limit/{limit_id}endpoint:- curl -X GET "https://<quay-server.example.com>/api/v1/user/quota/{quota_id}/limit/{limit_id}" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/user/quota/{quota_id}/limit/{limit_id}" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 4, "limit_bytes": 2199023255552, "limit": "2.0 TiB", "default_config": false, "limits": [{"id": 3, "type": "Reject", "limit_percent": 100}], "default_config_exists": false}- {"id": 4, "limit_bytes": 2199023255552, "limit": "2.0 TiB", "default_config": false, "limits": [{"id": 3, "type": "Reject", "limit_percent": 100}], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.10. Establishing quota with the Red Hat Quay API
Organizations can be created and managed through API endpoints. With the Red Hat Quay API, you can create organizations, view organization information, create proxy caches for an organization, edit users with access to the organization, change organization details, delete organizations, and more.
6.10.1. Creating an organization by using the Red Hat Quay API
Use the following procedure to create a new organization using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following command to create a new organization using the - POST /api/v1/organization/endpoint:- curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{- $ curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{ "name": "<new_organization_name>" }' "https://<quay-server.example.com>/api/v1/organization/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Created" - "Created"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After creation, organization details can be changed, such as adding an email address, with the - PUT /api/v1/organization/{orgname}command. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "user"}, "is_admin": true, "is_member": true, "teams": {"owners": {"name": "owners", "description": "", "role": "admin", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}, "can_view": true, "repo_count": 0, "member_count": 1, "is_synced": false}}, "ordered_teams": ["owners"], "invoice_email": true, "invoice_email_address": "billing@test-org.com", "tag_expiration_s": 1209600, "is_free_account": true, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}- {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "user"}, "is_admin": true, "is_member": true, "teams": {"owners": {"name": "owners", "description": "", "role": "admin", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}, "can_view": true, "repo_count": 0, "member_count": 1, "is_synced": false}}, "ordered_teams": ["owners"], "invoice_email": true, "invoice_email_address": "billing@test-org.com", "tag_expiration_s": 1209600, "is_free_account": true, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.10.2. Deleting an organization by using the Red Hat Quay API
Use the following procedure to delete an organization using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following command to delete an organization using the - DELETE /api/v1/organization/{orgname}endpoint:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay-server.example.com>/api/v1/organization/<organization_name>" - $ curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay-server.example.com>/api/v1/organization/<organization_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The CLI does not return information when deleting an organization from the CLI. To confirm deletion, you can check the Red Hat Quay UI, or you can enter the - GET /api/v1/organization/{orgname}command to see if details are returned for the deleted organization:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://<quay-server.example.com>/api/v1/error/not_found", "status": 404}- {"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://<quay-server.example.com>/api/v1/error/not_found", "status": 404}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.10.3. Retrieving organization member information by using the API
Information about organization members can be retrieved by using the Red Hat Quay API.
Procedure
- Use the - GET /api/v1/organization/{orgname}/membersto return a list of organization members:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/members" \ -H "Authorization: Bearer <access_token>" - $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/members" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"members": [{"name": "quayadmin", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "teams": [{"name": "owners", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}}], "repositories": ["testrepo"]}, {"name": "testuser", "kind": "user", "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "teams": [{"name": "owners", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}}], "repositories": []}]}- {"members": [{"name": "quayadmin", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "teams": [{"name": "owners", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}}], "repositories": ["testrepo"]}, {"name": "testuser", "kind": "user", "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "teams": [{"name": "owners", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}}], "repositories": []}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can use the - GET /api/v1/organization/{orgname}/collaboratorsto return a list of organization collaborators:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/{orgname}/collaborators" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/{orgname}/collaborators" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"collaborators": [user-test]}- {"collaborators": [user-test]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/members/{membername}endpoint to obtain more specific information about a user:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/members/<membername>" \ -H "Authorization: Bearer <access_token>" - $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/members/<membername>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "quayadmin", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "teams": [{"name": "owners", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}}], "repositories": ["testrepo"]}- {"name": "quayadmin", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "teams": [{"name": "owners", "avatar": {"name": "owners", "hash": "6f0e3a8c0eb46e8834b43b03374ece43a030621d92a7437beb48f871e90f8d90", "color": "#c7c7c7", "kind": "team"}}], "repositories": ["testrepo"]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/organization/{orgname}/members/{membername}endpoint to delete a team member.- curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/<orgname>/members/<membername>" \ -H "Authorization: Bearer <access_token>" - $ curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/<orgname>/members/<membername>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
6.10.4. Creating an organization application by using the Red Hat Quay API
Organization applications can be created by using the Red Hat Quay UI.
Organization applications can be created by using the UI, however OAuth 2 access tokens must be created on the UI.
Procedure
- Use the - POST /api/v1/organization/{orgname}/applicationsendpoint to create a new application for your organization. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "new-application", "description": "", "application_uri": "", "client_id": "E6GJSHOZMFBVNHTHNB53", "client_secret": "SANSWCWSGLVAUQ60L4Q4CEO3C1QAYGEXZK2VKJNI", "redirect_uri": "", "avatar_email": null}- {"name": "new-application", "description": "", "application_uri": "", "client_id": "E6GJSHOZMFBVNHTHNB53", "client_secret": "SANSWCWSGLVAUQ60L4Q4CEO3C1QAYGEXZK2VKJNI", "redirect_uri": "", "avatar_email": null}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/applicationsendpoint to return a list of all organization applications. For example:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/applications" \ -H "Authorization: Bearer <access_token>" - $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/applications" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"applications": [{"name": "test", "description": "", "application_uri": "", "client_id": "MCJ61D8KQBFS2DXM56S2", "client_secret": "J5G7CCX5QCA8Q5XZLWGI7USJPSM4M5MQHJED46CF", "redirect_uri": "", "avatar_email": null}, {"name": "new-token", "description": "", "application_uri": "", "client_id": "IG58PX2REEY9O08IZFZE", "client_secret": "2LWTWO89KH26P2CO4TWFM7PGCX4V4SUZES2CIZMR", "redirect_uri": "", "avatar_email": null}, {"name": "second-token", "description": "", "application_uri": "", "client_id": "6XBK7QY7ACSCN5XBM3GS", "client_secret": "AVKBOUXTFO3MXBBK5UJD5QCQRN2FWL3O0XPZZT78", "redirect_uri": "", "avatar_email": null}, {"name": "new-application", "description": "", "application_uri": "", "client_id": "E6GJSHOZMFBVNHTHNB53", "client_secret": "SANSWCWSGLVAUQ60L4Q4CEO3C1QAYGEXZK2VKJNI", "redirect_uri": "", "avatar_email": null}]}- {"applications": [{"name": "test", "description": "", "application_uri": "", "client_id": "MCJ61D8KQBFS2DXM56S2", "client_secret": "J5G7CCX5QCA8Q5XZLWGI7USJPSM4M5MQHJED46CF", "redirect_uri": "", "avatar_email": null}, {"name": "new-token", "description": "", "application_uri": "", "client_id": "IG58PX2REEY9O08IZFZE", "client_secret": "2LWTWO89KH26P2CO4TWFM7PGCX4V4SUZES2CIZMR", "redirect_uri": "", "avatar_email": null}, {"name": "second-token", "description": "", "application_uri": "", "client_id": "6XBK7QY7ACSCN5XBM3GS", "client_secret": "AVKBOUXTFO3MXBBK5UJD5QCQRN2FWL3O0XPZZT78", "redirect_uri": "", "avatar_email": null}, {"name": "new-application", "description": "", "application_uri": "", "client_id": "E6GJSHOZMFBVNHTHNB53", "client_secret": "SANSWCWSGLVAUQ60L4Q4CEO3C1QAYGEXZK2VKJNI", "redirect_uri": "", "avatar_email": null}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Applications can also be returned for a specific client using the - GET /api/v1/organization/{orgname}/applications/{client_id}endpoint. For example:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/applications/<client_id>" \ -H "Authorization: Bearer <access_token>" - $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/<orgname>/applications/<client_id>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "test", "description": "", "application_uri": "", "client_id": "MCJ61D8KQBFS2DXM56S2", "client_secret": "J5G7CCX5QCA8Q5XZLWGI7USJPSM4M5MQHJED46CF", "redirect_uri": "", "avatar_email": null}- {"name": "test", "description": "", "application_uri": "", "client_id": "MCJ61D8KQBFS2DXM56S2", "client_secret": "J5G7CCX5QCA8Q5XZLWGI7USJPSM4M5MQHJED46CF", "redirect_uri": "", "avatar_email": null}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After creation, organization applications can be updated, for example, if you want to add a redirect URI or a new description, using the - PUT /api/v1/organization/{orgname}/applications/{client_id}endpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After creation, application information can be returned by using the - GET /api/v1/app/{client_id}endpoint:- curl -X GET "https://<quay-server.example.com>/api/v1/app/<client_id>" \ -H "Authorization: Bearer <access_token>" - $ curl -X GET "https://<quay-server.example.com>/api/v1/app/<client_id>" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "new-application3", "description": "", "uri": "", "avatar": {"name": "new-application3", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "app"}, "organization": {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "user"}, "is_admin": true, "is_member": true, "teams": {}, "ordered_teams": [], "invoice_email": true, "invoice_email_address": "billing@test-org.com", "tag_expiration_s": 1209600, "is_free_account": true, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}}- {"name": "new-application3", "description": "", "uri": "", "avatar": {"name": "new-application3", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "app"}, "organization": {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "user"}, "is_admin": true, "is_member": true, "teams": {}, "ordered_teams": [], "invoice_email": true, "invoice_email_address": "billing@test-org.com", "tag_expiration_s": 1209600, "is_free_account": true, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Organization applications can be deleted with the - DELETE /api/v1/organization/{orgname}/applications/{client_id}endpoint. For example:- curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/{orgname}/applications/{client_id}" \ -H "Authorization: Bearer <access_token>"- $ curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/{orgname}/applications/{client_id}" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
6.10.5. Configuring a proxy cache for an organization by using the Red Hat Quay API
Proxy caching for an organization can be configured by using the Red Hat Quay API.
Procedure
- Use the - POST /api/v1/organization/{orgname}/proxycacheendpoint to create a proxy cache configuration for the organization.- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/organization/{orgname}/validateproxycacheendpoint to validate the proxy configuration:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/proxycacheendpoint to obtain information about the proxcy cache. For example:- curl -X GET "https://<quay-server.example.com>/api/v1/organization/{orgname}/proxycache" \ -H "Authorization: Bearer <access_token>"- $ curl -X GET "https://<quay-server.example.com>/api/v1/organization/{orgname}/proxycache" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"upstream_registry": "quay.io", "expiration_s": 86400, "insecure": false}- {"upstream_registry": "quay.io", "expiration_s": 86400, "insecure": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/organization/{orgname}/proxycacheendpoint to- curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/{orgname}/proxycache" \ -H "Authorization: Bearer <access_token>"- $ curl -X DELETE "https://<quay-server.example.com>/api/v1/organization/{orgname}/proxycache" \ -H "Authorization: Bearer <access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Deleted" - "Deleted"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.11. Managing repository permissions by using the Red Hat Quay API
Repository permissions can be managed by using the Red Hat Quay API. For example, you can create, view, and delete user and team permissions.
The following procedures show you how to manage repository permissions by using the Red Hat Quay API.
6.11.1. Managing user permissions by using the Red Hat Quay API
Use the following procedure to manage user permissions by using the Red Hat Quay API.
Procedure
- Use the - GET /api/v1/repository/{repository}/permissions/user/{username}endpoint to obtain repository permissions for a user. For example:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<repository_path>/permissions/user/<username>" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<repository_path>/permissions/user/<username>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"role": "read", "name": "testuser", "is_robot": false, "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "is_org_member": false}- $ {"role": "read", "name": "testuser", "is_robot": false, "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "is_org_member": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- All user permissions can be returned with the - GET /api/v1/repository/{repository}/permissions/user/endpoint:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/user/" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/user/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"permissions": {"quayadmin": {"role": "admin", "name": "quayadmin", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "is_org_member": true}, "test+example": {"role": "admin", "name": "test+example", "is_robot": true, "avatar": {"name": "test+example", "hash": "3b03050c26e900500437beee4f7f2a5855ca7e7c5eab4623a023ee613565a60e", "color": "#a1d99b", "kind": "robot"}, "is_org_member": true}}}- {"permissions": {"quayadmin": {"role": "admin", "name": "quayadmin", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "is_org_member": true}, "test+example": {"role": "admin", "name": "test+example", "is_robot": true, "avatar": {"name": "test+example", "hash": "3b03050c26e900500437beee4f7f2a5855ca7e7c5eab4623a023ee613565a60e", "color": "#a1d99b", "kind": "robot"}, "is_org_member": true}}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Alternatively, you can use the - GET /api/v1/repository/{repository}/permissions/user/{username}/transitiveendpoint to return only the repository permission for the user:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<repository_path>/permissions/user/<username>/transitive" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<repository_path>/permissions/user/<username>/transitive"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"permissions": [{"role": "admin"}]}- {"permissions": [{"role": "admin"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can change the user’s permissions, such as making the user an - adminby using the- PUT /api/v1/repository/{repository}/permissions/user/{username}endpoint. For example:- curl -X PUT \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{"role": "<role>"}' \ "https://quay-server.example.com/api/v1/repository/<repository_path>/permissions/user/<username>"- $ curl -X PUT \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{"role": "<role>"}' \ "https://quay-server.example.com/api/v1/repository/<repository_path>/permissions/user/<username>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"role": "admin", "name": "testuser", "is_robot": false, "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "is_org_member": false}- {"role": "admin", "name": "testuser", "is_robot": false, "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "is_org_member": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- User permissions can be deleted by using the - DELETE /api/v1/repository/{repository}/permissions/user/{username}endpoint. For example:- curl -X DELETE \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/user/<username>" - $ curl -X DELETE \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/user/<username>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. 
6.11.2. Managing team permissions by using the Red Hat Quay API
Use the following procedure to manage team permissions by using the Red Hat Quay API.
- Permissions for a specified team can be returned by using the - GET /api/v1/repository/{repository}/permissions/team/{teamname}endpoint:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/<teamname>" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/<teamname>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"role": "write"}- {"role": "write"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Permissions for all teams can be returned with the - GET /api/v1/repository/{repository}/permissions/team/endpoint. For example:- curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/" - $ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"permissions": {"ironmanteam": {"role": "read", "name": "ironmanteam", "avatar": {"name": "ironmanteam", "hash": "8045b2361613622183e87f33a7bfc54e100a41bca41094abb64320df29ef458d", "color": "#969696", "kind": "team"}}, "sillyteam": {"role": "read", "name": "sillyteam", "avatar": {"name": "sillyteam", "hash": "f275d39bdee2766d2404e2c6dbff28fe290969242e9fcf1ffb2cde36b83448ff", "color": "#17becf", "kind": "team"}}}}- {"permissions": {"ironmanteam": {"role": "read", "name": "ironmanteam", "avatar": {"name": "ironmanteam", "hash": "8045b2361613622183e87f33a7bfc54e100a41bca41094abb64320df29ef458d", "color": "#969696", "kind": "team"}}, "sillyteam": {"role": "read", "name": "sillyteam", "avatar": {"name": "sillyteam", "hash": "f275d39bdee2766d2404e2c6dbff28fe290969242e9fcf1ffb2cde36b83448ff", "color": "#17becf", "kind": "team"}}}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Permissions for a specified team can be changed by using the - PUT /api/v1/repository/{repository}/permissions/team/{teamname}command. For example:- curl -X PUT \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{"role": "<role>"}' \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/<teamname>"- $ curl -X PUT \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{"role": "<role>"}' \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/<teamname>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"role": "admin", "name": "superteam", "avatar": {"name": "superteam", "hash": "48cb6d114200039fed5c601480653ae7371d5a8849521d4c3bf2418ea013fc0f", "color": "#9467bd", "kind": "team"}}- {"role": "admin", "name": "superteam", "avatar": {"name": "superteam", "hash": "48cb6d114200039fed5c601480653ae7371d5a8849521d4c3bf2418ea013fc0f", "color": "#9467bd", "kind": "team"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Team permissions can be deleted with the - DELETE /api/v1/repository/{repository}/permissions/team/{teamname}command. For example:- curl -X DELETE \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/<teamname>" - $ curl -X DELETE \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/team/<teamname>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.12. Managing auto-prune policies by using the Red Hat Quay API
Auto-prune policies can be created, retrieved, changed, and delete for organizations, repositories, and users by using the Red Hat Quay API.
Procedure
- Enter the following command to create a repository using the - POST /api/v1/repositoryendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}- {"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can list a repositories with the - GET /api/v1/repositoryendpoint. For example:- curl -X GET \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ "https://quay-server.example.com/api/v1/repository?public=true&starred=false&namespace=<NAMESPACE>" - $ curl -X GET \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ "https://quay-server.example.com/api/v1/repository?public=true&starred=false&namespace=<NAMESPACE>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"repositories": [{"namespace": "quayadmin", "name": "busybox", "description": null, "is_public": false, "kind": "image", "state": "MIRROR", "is_starred": false, "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552}}]}- {"repositories": [{"namespace": "quayadmin", "name": "busybox", "description": null, "is_public": false, "kind": "image", "state": "MIRROR", "is_starred": false, "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552}}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Visibility can be changed from public to private with the - POST /api/v1/repository/{repository}/changevisibilityendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"success": true}- {"success": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can check the Red Hat Quay UI, or you can enter the following - GET /api/v1/repository/{repository}command to return details about a repository:- curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://quay-server.example.com/api/v1/error/not_found", "status": 404}- {"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://quay-server.example.com/api/v1/error/not_found", "status": 404}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Repository descriptions can be updated with the - PUT /api/v1/repository/{repository}endpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"success": true}- {"success": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following command to delete a repository using the - DELETE /api/v1/repository/{repository}endpoint:- curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>" - $ curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.12.1. Creating an auto-prune policy for a namespace by using the Red Hat Quay API
You can use Red Hat Quay API endpoints to manage auto-pruning policies for an namespace.
Prerequisites
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
- You have created an OAuth access token.
- You have logged into Red Hat Quay.
Procedure
- Enter the following - POST /api/v1/organization/{orgname}/autoprunepolicy/command create a new policy that limits the number of tags allowed in an organization:- curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags", "value": 10}' http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/- $ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags", "value": 10}' http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Alternatively, you can can set tags to expire for a specified time after their creation date: - curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{- $ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{ "method": "creation_date", "value": "7d"}' http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "73d64f05-d587-42d9-af6d-e726a4a80d6e"}- {"uuid": "73d64f05-d587-42d9-af6d-e726a4a80d6e"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional. You can add an additional policy to an organization and pass in the - tagPatternand- tagPatternMatchesfields to prune only tags that match the given regex pattern. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- SettingtagPatternMatchestotruemakes it so that tags that match the given regex pattern will be pruned. In this example, tags that match^v*are pruned.
 - Example output - {"uuid": "ebf7448b-93c3-4f14-bf2f-25aa6857c7b0"}- {"uuid": "ebf7448b-93c3-4f14-bf2f-25aa6857c7b0"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can update your organization’s auto-prune policy by using the - PUT /api/v1/organization/{orgname}/autoprunepolicy/{policy_uuid}command. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. Continue to the next step. 
- Check your auto-prune policy by entering the following command: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/ - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"policies": [{"uuid": "ebf7448b-93c3-4f14-bf2f-25aa6857c7b0", "method": "creation_date", "value": "4d", "tagPattern": "^v*", "tagPatternMatches": true}, {"uuid": "da4d0ad7-3c2d-4be8-af63-9c51f9a501bc", "method": "number_of_tags", "value": 10, "tagPattern": null, "tagPatternMatches": true}, {"uuid": "17b9fd96-1537-4462-a830-7f53b43f94c2", "method": "creation_date", "value": "7d", "tagPattern": "^v*", "tagPatternMatches": true}]}- {"policies": [{"uuid": "ebf7448b-93c3-4f14-bf2f-25aa6857c7b0", "method": "creation_date", "value": "4d", "tagPattern": "^v*", "tagPatternMatches": true}, {"uuid": "da4d0ad7-3c2d-4be8-af63-9c51f9a501bc", "method": "number_of_tags", "value": 10, "tagPattern": null, "tagPatternMatches": true}, {"uuid": "17b9fd96-1537-4462-a830-7f53b43f94c2", "method": "creation_date", "value": "7d", "tagPattern": "^v*", "tagPatternMatches": true}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete the auto-prune policy for your organization by entering the following command. Note that deleting the policy requires the UUID. - curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/73d64f05-d587-42d9-af6d-e726a4a80d6e - $ curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/73d64f05-d587-42d9-af6d-e726a4a80d6e- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.12.2. Creating an auto-prune policy for a namespace for the current user by using the API
You can use Red Hat Quay API endpoints to manage auto-pruning policies for your account.
						The use of /user/ in the following commands represents the user that is currently logged into Red Hat Quay.
					
Prerequisites
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
- You have created an OAuth access token.
- You have logged into Red Hat Quay.
Procedure
- Enter the following - POSTcommand create a new policy that limits the number of tags for the current user:- curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags", "value": 10}' http://<quay-server.example.com>/api/v1/user/autoprunepolicy/- $ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags", "value": 10}' http://<quay-server.example.com>/api/v1/user/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859"}- {"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Check your auto-prune policy by entering the following command: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/ - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Alternatively, you can include the UUID: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/8c03f995-ca6f-4928-b98d-d75ed8c14859 - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/8c03f995-ca6f-4928-b98d-d75ed8c14859- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"policies": [{"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859", "method": "number_of_tags", "value": 10}]}- {"policies": [{"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859", "method": "number_of_tags", "value": 10}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete the auto-prune policy by entering the following command. Note that deleting the policy requires the UUID. - curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/8c03f995-ca6f-4928-b98d-d75ed8c14859 - $ curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/8c03f995-ca6f-4928-b98d-d75ed8c14859- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859"}- {"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.12.3. Creating an auto-prune policy for a repository using the Red Hat Quay API
You can use Red Hat Quay API endpoints to manage auto-pruning policies for an repository.
Prerequisites
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
- You have created an OAuth access token.
- You have logged into Red Hat Quay.
Procedure
- Enter the following - POST /api/v1/repository/{repository}/autoprunepolicy/command create a new policy that limits the number of tags allowed in an organization:- curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags","value": 2}' http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/- $ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags","value": 2}' http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Alternatively, you can can set tags to expire for a specified time after their creation date: - curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "creation_date", "value": "7d"}' http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/- $ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "creation_date", "value": "7d"}' http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7"}- {"uuid": "ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional. You can add an additional policy and pass in the - tagPatternand- tagPatternMatchesfields to prune only tags that match the given regex pattern. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- SettingtagPatternMatchestofalsemakes it so that tags that all tags that do not match the given regex pattern are pruned. In this example, all tags but^test.are pruned.
 - Example output - {"uuid": "b53d8d3f-2e73-40e7-96ff-736d372cd5ef"}- {"uuid": "b53d8d3f-2e73-40e7-96ff-736d372cd5ef"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can update your policy for the repository by using the - PUT /api/v1/repository/{repository}/autoprunepolicy/{policy_uuid}command and passing in the UUID. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output. Continue to the next step to check your auto-prune policy. 
- Check your auto-prune policy by entering the following command: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/ - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Alternatively, you can include the UUID: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7 - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"policies": [{"uuid": "ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7", "method": "number_of_tags", "value": 10}]}- {"policies": [{"uuid": "ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7", "method": "number_of_tags", "value": 10}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete the auto-prune policy by entering the following command. Note that deleting the policy requires the UUID. - curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7 - $ curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7"}- {"uuid": "ce2bdcc0-ced2-4a1a-ac36-78a9c1bed8c7"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.12.4. Creating an auto-prune policy on a repository for a user with the API
					You can use Red Hat Quay API endpoints to manage auto-pruning policies on a repository for user accounts that are not your own, so long as you have admin privileges on the repository.
				
Prerequisites
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
- You have created an OAuth access token.
- You have logged into Red Hat Quay.
- 
							You have adminprivileges on the repository that you are creating the policy for.
Procedure
- Enter the following - POST /api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/command create a new policy that limits the number of tags for the user:- curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags","value": 2}' https://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/- $ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags","value": 2}' https://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "7726f79c-cbc7-490e-98dd-becdc6fefce7"}- {"uuid": "7726f79c-cbc7-490e-98dd-becdc6fefce7"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional. You can add an additional policy for the current user and pass in the - tagPatternand- tagPatternMatchesfields to prune only tags that match the given regex pattern. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "b3797bcd-de72-4b71-9b1e-726dabc971be"}- {"uuid": "b3797bcd-de72-4b71-9b1e-726dabc971be"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can update your policy for the current user by using the - PUT /api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/<policy_uuid>command. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Updating a policy does not return output in the CLI. 
- Check your auto-prune policy by entering the following command: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/ - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Alternatively, you can include the UUID: - curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/7726f79c-cbc7-490e-98dd-becdc6fefce7 - $ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/7726f79c-cbc7-490e-98dd-becdc6fefce7- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "81ee77ec-496a-4a0a-9241-eca49437d15b", "method": "creation_date", "value": "7d", "tagPattern": "^v*", "tagPatternMatches": true}- {"uuid": "81ee77ec-496a-4a0a-9241-eca49437d15b", "method": "creation_date", "value": "7d", "tagPattern": "^v*", "tagPatternMatches": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can delete the auto-prune policy by entering the following command. Note that deleting the policy requires the UUID. - curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/<policy_uuid> - $ curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/repository/<user_account>/<user_repository>/autoprunepolicy/<policy_uuid>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"uuid": "7726f79c-cbc7-490e-98dd-becdc6fefce7"}- {"uuid": "7726f79c-cbc7-490e-98dd-becdc6fefce7"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.13. Creating and configuring repositories by using the Red Hat Quay API
Repositories can be created, retrieved, changed, and deleted by using the Red Hat Quay API.
6.13.1. Creating and configuring repositories by using the Red Hat Quay API
Repositories can be created, retrieved, changed, and deleted by using the Red Hat Quay API.
Procedure
- Enter the following command to create a repository using the - POST /api/v1/repositoryendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}- {"namespace": "quayadmin", "name": "<new_repository_name>", "kind": "image"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can list a repositories with the - GET /api/v1/repositoryendpoint. For example:- curl -X GET \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ "https://quay-server.example.com/api/v1/repository?public=true&starred=false&namespace=<NAMESPACE>" - $ curl -X GET \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ "https://quay-server.example.com/api/v1/repository?public=true&starred=false&namespace=<NAMESPACE>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"repositories": [{"namespace": "quayadmin", "name": "busybox", "description": null, "is_public": false, "kind": "image", "state": "MIRROR", "is_starred": false, "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552}}]}- {"repositories": [{"namespace": "quayadmin", "name": "busybox", "description": null, "is_public": false, "kind": "image", "state": "MIRROR", "is_starred": false, "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552}}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Visibility can be changed from public to private with the - POST /api/v1/repository/{repository}/changevisibilityendpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"success": true}- {"success": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can check the Red Hat Quay UI, or you can enter the following - GET /api/v1/repository/{repository}command to return details about a repository:- curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://quay-server.example.com/api/v1/error/not_found", "status": 404}- {"detail": "Not Found", "error_message": "Not Found", "error_type": "not_found", "title": "not_found", "type": "http://quay-server.example.com/api/v1/error/not_found", "status": 404}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Repository descriptions can be updated with the - PUT /api/v1/repository/{repository}endpoint:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"success": true}- {"success": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following command to delete a repository using the - DELETE /api/v1/repository/{repository}endpoint:- curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>" - $ curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.13.2. Creating notifications by using the API
Use the following procedure to add notifications.
Prerequisites
- You have created a repository.
- You have administrative privileges for the repository.
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following - POST /api/v1/repository/{repository}/notificationcommand to create a notification on your repository:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. Instead, you can enter the following - GET /api/v1/repository/{repository}/notification/{uuid}command to obtain information about the repository notification:- {"uuid": "240662ea-597b-499d-98bb-2b57e73408d6", "title": null, "event": "repo_push", "method": "quay_notification", "config": {"target": {"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}}}, "event_config": {}, "number_of_failures": 0}- {"uuid": "240662ea-597b-499d-98bb-2b57e73408d6", "title": null, "event": "repo_push", "method": "quay_notification", "config": {"target": {"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}}}, "event_config": {}, "number_of_failures": 0}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can test your repository notification by entering the following - POST /api/v1/repository/{repository}/notification/{uuid}/testcommand:- curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<repository>/notification/<uuid>/test - $ curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<repository>/notification/<uuid>/test- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {}- {}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can reset repository notification failures to 0 by entering the following - POST /api/v1/repository/{repository}/notification/{uuid}command:- curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<repository>/notification/<uuid> - $ curl -X POST \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<repository>/notification/<uuid>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following - DELETE /api/v1/repository/{repository}/notification/{uuid}command to delete a repository notification:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/notification/<uuid> - $ curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/notification/<uuid>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. Instead, you can enter the following - GET /api/v1/repository/{repository}/notification/command to retrieve a list of all notifications:- curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/notification - $ curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/notification- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"notifications": []}- {"notifications": []}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.14. Creating and configuring robot accounts by using the Red Hat Quay API
Robot accounts can be created, retrieved, changed, and deleted for both organizations and users by using the Red Hat Quay API.
6.14.1. Creating a robot account by using the Red Hat Quay API
Use the following procedure to create a robot account using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following command to create a new robot account for an organization using the - PUT /api/v1/organization/{orgname}/robots/{robot_shortname}endpoint:- curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_name>" - $ curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "orgname+robot-name", "created": "Fri, 10 May 2024 15:11:00 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}- {"name": "orgname+robot-name", "created": "Fri, 10 May 2024 15:11:00 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following command to create a new robot account for the current user with the - PUT /api/v1/user/robots/{robot_shortname}endpoint:- curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/user/robots/<robot_name>" - $ curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/user/robots/<robot_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "quayadmin+robot-name", "created": "Fri, 10 May 2024 15:24:57 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}- {"name": "quayadmin+robot-name", "created": "Fri, 10 May 2024 15:24:57 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.14.2. Obtaining robot account information by using the Red Hat Quay API
Robot account information, such as permissions, can be obtained for both organizations and users by using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Use the - GET /api/v1/organization/{orgname}/robots/{robot_shortname}API endpoint to return information for a robot for an organization:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/organization/<ORGNAME>/robots/<ROBOT_SHORTNAME>" - curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/organization/<ORGNAME>/robots/<ROBOT_SHORTNAME>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "test+example", "created": "Mon, 25 Nov 2024 16:25:16 -0000", "last_accessed": null, "description": "", "token": "BILZ6YTVAZAKOGMD9270OKN3SOD9KPB7OLKEJQOJE38NBBRUJTIH7T5859DJL31Q", "unstructured_metadata": {}}- {"name": "test+example", "created": "Mon, 25 Nov 2024 16:25:16 -0000", "last_accessed": null, "description": "", "token": "BILZ6YTVAZAKOGMD9270OKN3SOD9KPB7OLKEJQOJE38NBBRUJTIH7T5859DJL31Q", "unstructured_metadata": {}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/organization/{orgname}/robots/{robot_shortname}/permissionsendpoint to return the list of permissions for a specific organization robot:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/organization/<ORGNAME>/robots/<ROBOT_SHORTNAME>/permissions" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/organization/<ORGNAME>/robots/<ROBOT_SHORTNAME>/permissions"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"permissions": [{"repository": {"name": "testrepo", "is_public": true}, "role": "admin"}]}- {"permissions": [{"repository": {"name": "testrepo", "is_public": true}, "role": "admin"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/user/robots/{robot_shortname}API endpoint to return the user’s robot with the specified name:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/user/robots/<ROBOT_SHORTNAME>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/user/robots/<ROBOT_SHORTNAME>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "quayadmin+mirror_robot", "created": "Wed, 15 Jan 2025 17:22:09 -0000", "last_accessed": null, "description": "", "token": "QBFYWIWZOS1I0P0R9N1JRNP1UZAOPUIR3EB4ASPZKK9IA1SFC12LTEF7OJHB05Z8", "unstructured_metadata": {}}- {"name": "quayadmin+mirror_robot", "created": "Wed, 15 Jan 2025 17:22:09 -0000", "last_accessed": null, "description": "", "token": "QBFYWIWZOS1I0P0R9N1JRNP1UZAOPUIR3EB4ASPZKK9IA1SFC12LTEF7OJHB05Z8", "unstructured_metadata": {}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/user/robots/{robot_shortname}/permissionsAPI endpoint to return a list of permissions for the user robot:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/user/robots/<ROBOT_SHORTNAME>/permissions" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/user/robots/<ROBOT_SHORTNAME>/permissions"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"permissions": [{"repository": {"name": "busybox", "is_public": false}, "role": "write"}]}- {"permissions": [{"repository": {"name": "busybox", "is_public": false}, "role": "write"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.14.3. Deleting a robot account by using the Red Hat Quay API
Use the following procedure to delete a robot account using the Red Hat Quay API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following command to delete a robot account for an organization using the - DELETE /api/v1/organization/{orgname}/robots/{robot_shortname}endpoint:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_shortname>" - curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_shortname>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The CLI does not return information when deleting a robot account with the API. To confirm deletion, you can check the Red Hat Quay UI, or you can enter the following - GET /api/v1/organization/{orgname}/robotscommand to see if details are returned for the robot account:- curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"robots": []}- {"robots": []}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following command to delete a robot account for the current user with the - DELETE /api/v1/user/robots/{robot_shortname}endpoint:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>" - $ curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The CLI does not return information when deleting a robot account for the current user with the API. To confirm deletion, you can check the Red Hat Quay UI, or you can enter the following - GET /api/v1/user/robots/{robot_shortname}command to see if details are returned for the robot account:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"message":"Could not find robot with specified username"}- {"message":"Could not find robot with specified username"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.15. Searching against registry context
				You can use search API endpoints to perform searches against all registry context.
			
Procedure
- Use the - GET /api/v1/find/repositoriesendpoint to get a list of apps and repositories that match the specified query:- curl -X GET "https://quay-server.example.com/api/v1/find/repositories?query=<repo_name>&page=1&includeUsage=true" \ -H "Authorization: Bearer <bearer_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/find/repositories?query=<repo_name>&page=1&includeUsage=true" \ -H "Authorization: Bearer <bearer_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"results": [], "has_additional": false, "page": 2, "page_size": 10, "start_index": 10}- {"results": [], "has_additional": false, "page": 2, "page_size": 10, "start_index": 10}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/find/allendpoint to get a list of entities and resources that match the specified query:- curl -X GET "https://quay-server.example.com/api/v1/find/all?query=<mysearchterm>" \ -H "Authorization: Bearer <bearer_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/find/all?query=<mysearchterm>" \ -H "Authorization: Bearer <bearer_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"results": [{"kind": "repository", "title": "repo", "namespace": {"title": "user", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "name": "quayadmin", "score": 1, "href": "/user/quayadmin"}, "name": "busybox", "description": null, "is_public": false, "score": 4.0, "href": "/repository/quayadmin/busybox"}]}- {"results": [{"kind": "repository", "title": "repo", "namespace": {"title": "user", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "name": "quayadmin", "score": 1, "href": "/user/quayadmin"}, "name": "busybox", "description": null, "is_public": false, "score": 4.0, "href": "/repository/quayadmin/busybox"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/entities/{prefix}endpoint to get a list of entities that match the specified prefix.- curl -X GET "https://quay-server.example.com/api/v1/entities/<prefix>?includeOrgs=<true_or_false>&includeTeams=<true_or_false>&namespace=<namespace>" \ -H "Authorization: Bearer <bearer_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/entities/<prefix>?includeOrgs=<true_or_false>&includeTeams=<true_or_false>&namespace=<namespace>" \ -H "Authorization: Bearer <bearer_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"results": [{"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}}]}- {"results": [{"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.16. View Clair security scans by using the API
You can view Clair security scans by using the API.
Procedure
- Use the - GET /api/v1/repository/{repository}/manifest/{manifestref}/securityendpoint to retrieve security information about a specific manifest in a repository. For example:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/manifest/<manifest_digest>/security?vulnerabilities=<true_or_false>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ -H "Accept: application/json" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/manifest/<manifest_digest>/security?vulnerabilities=<true_or_false>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"status": "queued", "data": null}- {"status": "queued", "data": null}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.17. Managing your deployment as a superuser with the Red Hat Quay API
Through the Red Hat Quay UI, superusers have the ability to create, list, change, and delete aspects of the registry, such as users, service keys, a user’s quota, and more.
6.17.1. Creating a user account by using the Red Hat Quay API
Use the following procedure to create a new user for your Red Hat Quay repository by using the API.
Prerequisites
- You are logged into your Red Hat Quay deployment as a superuser.
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following command to create a new user using the - POST /api/v1/superuser/users/endpoint:- curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{- $ curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{ "username": "newuser", "email": "newuser@example.com" }' "https://<quay-server.example.com>/api/v1/superuser/users/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"username": "newuser", "email": "newuser@example.com", "password": "123456789", "encrypted_password": "<example_encrypted_password>/JKY9pnDcsw="}- {"username": "newuser", "email": "newuser@example.com", "password": "123456789", "encrypted_password": "<example_encrypted_password>/JKY9pnDcsw="}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Navigate to your Red Hat Quay registry endpoint, for example, - quay-server.example.comand login with the username and password generated from the API call. In this scenario, the username is- newuserand the password is- 123456789. Alternatively, you can log in to the registry with the CLI. For example:- podman login <quay-server.example.com> - $ podman login <quay-server.example.com>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - username: newuser password: 123456789 - username: newuser password: 123456789- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional. You can obtain a list of all users, including superusers, by using the - GET /api/v1/superuser/users/endpoint:- curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/superuser/users/" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/superuser/users/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"users": [{"kind": "user", "name": "quayadmin", "username": "quayadmin", "email": "quay@quay.com", "verified": true, "avatar": {"name": "quayadmin", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}, "super_user": true, "enabled": true}, {"kind": "user", "name": "newuser", "username": "newuser", "email": "newuser@example.com", "verified": true, "avatar": {"name": "newuser", "hash": "f338a2c83bfdde84abe2d3348994d70c34185a234cfbf32f9e323e3578e7e771", "color": "#9edae5", "kind": "user"}, "super_user": false, "enabled": true}]}- {"users": [{"kind": "user", "name": "quayadmin", "username": "quayadmin", "email": "quay@quay.com", "verified": true, "avatar": {"name": "quayadmin", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}, "super_user": true, "enabled": true}, {"kind": "user", "name": "newuser", "username": "newuser", "email": "newuser@example.com", "verified": true, "avatar": {"name": "newuser", "hash": "f338a2c83bfdde84abe2d3348994d70c34185a234cfbf32f9e323e3578e7e771", "color": "#9edae5", "kind": "user"}, "super_user": false, "enabled": true}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.17.2. Deleting a user by using the Red Hat Quay API
Use the following procedure to delete a user from Red Hat Quay using the API.
After deleting the user, any repositories that this user had in his private account become unavailable.
Prerequisites
- You are logged into your Red Hat Quay deployment as a superuser.
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following - DELETE /api/v1/superuser/users/{username}command to delete a user from the command line:- curl -X DELETE -H "Authorization: Bearer <insert token here>" https://<quay-server.example.com>/api/v1/superuser/users/<username> - $ curl -X DELETE -H "Authorization: Bearer <insert token here>" https://<quay-server.example.com>/api/v1/superuser/users/<username>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The CLI does not return information when deleting a user from the CLI. To confirm deletion, you can check the Red Hat Quay UI by navigating to Superuser Admin Panel - Users, or by entering the following - GET /api/v1/superuser/users/command. You can then check to see if they are present.- curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/superuser/users/" - $ curl -X GET -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/superuser/users/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.17.3. Managing organizations as a superuser with the Red Hat Quay API
Superusers have the ability to list, change, and delete organizations by using the Red Hat Quay API.
Procedure
- Use the - GET /api/v1/superuser/organizationsendpoint to list all organizations:- curl -L -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/organizations?name=<organization_name>" - $ curl -L -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/organizations?name=<organization_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"organizations": [{"name": "fed_test", "email": "fe11fc59-bd09-459a-a21c-b57692d151c9", "avatar": {"name": "fed_test", "hash": "e2ce1fb42ec2e0602362beb64b5ebd1e6ad291b710a0355f9296c16157bef3cb", "color": "#ff7f0e", "kind": "org"}, "quotas": [{"id": 3, "limit_bytes": 10737418240, "limits": []}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}, {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}]}- {"organizations": [{"name": "fed_test", "email": "fe11fc59-bd09-459a-a21c-b57692d151c9", "avatar": {"name": "fed_test", "hash": "e2ce1fb42ec2e0602362beb64b5ebd1e6ad291b710a0355f9296c16157bef3cb", "color": "#ff7f0e", "kind": "org"}, "quotas": [{"id": 3, "limit_bytes": 10737418240, "limits": []}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}, {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - PUT /api/v1/superuser/organizations/{name}endpoint to change or update information for an organization:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}- {"name": "test", "email": "new-contact@test-org.com", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/superuser/organizations/{name}endpoint to delete and organization:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/organizations/<organization_name>" - $ curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/organizations/<organization_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.17.4. Listing logs as a superuser with the Red Hat Quay API
Red Hat Quay superusers can list usage logs for the current system.
Procedure
- Use the - GET /api/v1/superuser/logsendpoint to list the usage logs for the current system:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/logs?starttime=<start_time>&endtime=<end_time>&page=<page_number>&next_page=<next_page_token>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/logs?starttime=<start_time>&endtime=<end_time>&page=<page_number>&next_page=<next_page_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"start_time": "Mon, 17 Feb 2025 19:29:14 -0000", "end_time": "Wed, 19 Feb 2025 19:29:14 -0000", "logs": [{"kind": "login_success", "metadata": {"type": "quayauth", "useragent": "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0"}, "ip": "192.168.1.131", "datetime": "Tue, 18 Feb 2025 19:28:15 -0000", "namespace": {"kind": "user", "name": "quayadmin", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}}}], "next_page": "gAAAAABntN-KbPJDI0PpcHmWjRCmQTLiCprE_KXiOSidbGZ7Ireu8pVTgGUIstijNhmiLzlAv_S3HOsCrKWnuBmoQYZ3F53Uxg=="}- {"start_time": "Mon, 17 Feb 2025 19:29:14 -0000", "end_time": "Wed, 19 Feb 2025 19:29:14 -0000", "logs": [{"kind": "login_success", "metadata": {"type": "quayauth", "useragent": "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0"}, "ip": "192.168.1.131", "datetime": "Tue, 18 Feb 2025 19:28:15 -0000", "namespace": {"kind": "user", "name": "quayadmin", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}}}], "next_page": "gAAAAABntN-KbPJDI0PpcHmWjRCmQTLiCprE_KXiOSidbGZ7Ireu8pVTgGUIstijNhmiLzlAv_S3HOsCrKWnuBmoQYZ3F53Uxg=="}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/superuser/registrysize/end point to obtain information about the size of the registry:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/registrysize/" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/registrysize/"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"size_bytes": 0, "last_ran": null, "running": false, "queued": false}- {"size_bytes": 0, "last_ran": null, "running": false, "queued": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/superuser/registrysize/end point to define registry size information:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.17.5. Managing organization quota with the Red Hat Quay API
Quota can be managed with the Red Hat Quay API with superuser admin privileges. These endpoints allow superusers to manage quota policies for all organizations within the registry.
Procedure
- Use the - POST /api/v1/superuser/organization/{namespace}/quotaAPI endpoint to create a quota policy for an organization:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Created" - "Created"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/superuser/organization/{namespace}/quotaAPI endpoint to obtain information about the policy, including the quota ID:- curl -X GET "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X GET "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - [{"id": 2, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}], "default_config_exists": false}]- [{"id": 2, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}], "default_config_exists": false}]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - PUT /api/v1/superuser/organization/{namespace}/quota/{quota_id}API endpoint to change the quota policy:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 2, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}], "default_config_exists": false}- {"id": 2, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/superuser/organization/{namespace}/quota/{quota_id}API endpoint to- curl -X DELETE "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota/<quota_id>" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X DELETE "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota/<quota_id>" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.17.6. Managing user quota with the Red Hat Quay API
As a superuser, you can manage user quota for specified organizations.
Procedure
- Use the - POST /api/v1/superuser/users/{namespace}/quotaendpoint to create a quota policy for specific users within an organization:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Created" - "Created"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/superuser/users/{namespace}/quotaendpoint to return a list of a user’s allotted quota:- curl -X GET "https://quay-server.example.com/api/v1/superuser/users/<username>/quota" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X GET "https://quay-server.example.com/api/v1/superuser/users/<username>/quota" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - [{"id": 6, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}]- [{"id": 6, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - PUT /api/v1/superuser/users/{namespace}/quota/{quota_id}endpoint to adjust the user’s policy:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"id": 6, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}- {"id": 6, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/superuser/users/{namespace}/quota/{quota_id}endpoint to delete a user’s policy:- curl -X DELETE "https://quay-server.example.com/api/v1/superuser/users/<username>/quota/<quota_id>" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X DELETE "https://quay-server.example.com/api/v1/superuser/users/<username>/quota/<quota_id>" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.17.7. Retrieving build information with the Red Hat Quay API
As a superuser, you can retrieve information about builds with the Red Hat Quay API.
Procedure
- Use the - GET /api/v1/superuser/{build_uuid}/buildendpoint to return information about a build:- curl -X GET "https://quay-server.example.com/api/v1/superuser/<build_uuid>/build" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X GET "https://quay-server.example.com/api/v1/superuser/<build_uuid>/build" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/superuser/{build_uuid}/statusAPI endpoint to return the status for the builds specified by the build uuids:- curl -X GET "https://quay-server.example.com/api/v1/superuser/<build_uuid>/status" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X GET "https://quay-server.example.com/api/v1/superuser/<build_uuid>/status" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/superuser/{build_uuid}/logsAPI endpoint to return the build logs for the build specified by the build uuid:- curl -X GET "https://quay-server.example.com/api/v1/superuser/<build_uuid>/logs" \ -H "Authorization: Bearer <ACCESS_TOKEN>" - $ curl -X GET "https://quay-server.example.com/api/v1/superuser/<build_uuid>/logs" \ -H "Authorization: Bearer <ACCESS_TOKEN>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.17.8. Managing service keys as a superuser with the Red Hat Quay API
Superusers have the ability to create, list, change, and delete service keys by using the Red Hat Quay API.
Procedure
- Use the - POST /api/v1/superuser/keysendpoint to create a service key:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"message":""}- {"message":""}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/superuser/approvedkeys/{kid}endpoint to approved a service key:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
- Use the - GET /api/v1/superuser/keysendpoint to list service keys:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/keys" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/keys"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"keys":[{"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Wed, 05 Feb 2025 22:03:37 GMT","jwk":{"e":"AQAB","kid":"<example>","kty":"RSA","n":"<example>"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool"},"name":"http://quay-server.example.com:80","rotation_duration":null,"service":"quay"}]}- {"keys":[{"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Wed, 05 Feb 2025 22:03:37 GMT","jwk":{"e":"AQAB","kid":"<example>","kty":"RSA","n":"<example>"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool"},"name":"http://quay-server.example.com:80","rotation_duration":null,"service":"quay"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/superuser/keys/{kid}endpoint to retrieve information about a service account by its kid:- curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/keys/<kid>" - $ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/keys/<kid>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Wed, 05 Feb 2025 22:03:37 GMT","jwk":{"e":"AQAB","kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","kty":"RSA","n":"5iMX7RQ_4F_zdb1qonMsuWUDauCOqEyRpD8L_EhgnwDxrgMHuOlJ4_7sEOrOa3Jkx3QhwIW6LJCP69PR5X0wvz6vmC1DoWEaWv41bAq23Knzj7gUU9-N_fkZPZN9NQwZ-D-Zqg9L1c_cJF93Dy93py8_JswWFDj1FxMaThJmrX68wBwjhF-JLYqgCAGFyezzJ3oTpO-esV9v6R7skfkaqtx_cjLZk_0cKB4VKTtxiy2A8D_5nANTOSSbZLXNh2Vatgh3yrOmnTTNLIs0YO3vFIuylEkczHlln-40UMAzRB3HNspUySyzImO_2yGdrA762LATQrOzJN8E1YKCADx5CQ"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool"},"name":"http://quay-server.example.com:80","rotation_duration":null,"service":"quay"}- {"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Wed, 05 Feb 2025 22:03:37 GMT","jwk":{"e":"AQAB","kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","kty":"RSA","n":"5iMX7RQ_4F_zdb1qonMsuWUDauCOqEyRpD8L_EhgnwDxrgMHuOlJ4_7sEOrOa3Jkx3QhwIW6LJCP69PR5X0wvz6vmC1DoWEaWv41bAq23Knzj7gUU9-N_fkZPZN9NQwZ-D-Zqg9L1c_cJF93Dy93py8_JswWFDj1FxMaThJmrX68wBwjhF-JLYqgCAGFyezzJ3oTpO-esV9v6R7skfkaqtx_cjLZk_0cKB4VKTtxiy2A8D_5nANTOSSbZLXNh2Vatgh3yrOmnTTNLIs0YO3vFIuylEkczHlln-40UMAzRB3HNspUySyzImO_2yGdrA762LATQrOzJN8E1YKCADx5CQ"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool"},"name":"http://quay-server.example.com:80","rotation_duration":null,"service":"quay"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - PUT /api/v1/superuser/keys/{kid}endpoint to update your service key, such as the metadata:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Mon, 03 Mar 2025 10:40:00 GMT","jwk":{"e":"AQAB","kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","kty":"RSA","n":"5iMX7RQ_4F_zdb1qonMsuWUDauCOqEyRpD8L_EhgnwDxrgMHuOlJ4_7sEOrOa3Jkx3QhwIW6LJCP69PR5X0wvz6vmC1DoWEaWv41bAq23Knzj7gUU9-N_fkZPZN9NQwZ-D-Zqg9L1c_cJF93Dy93py8_JswWFDj1FxMaThJmrX68wBwjhF-JLYqgCAGFyezzJ3oTpO-esV9v6R7skfkaqtx_cjLZk_0cKB4VKTtxiy2A8D_5nANTOSSbZLXNh2Vatgh3yrOmnTTNLIs0YO3vFIuylEkczHlln-40UMAzRB3HNspUySyzImO_2yGdrA762LATQrOzJN8E1YKCADx5CQ"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool","environment":"production"},"name":"quay-service-key-updated","rotation_duration":null,"service":"quay"}- {"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Mon, 03 Mar 2025 10:40:00 GMT","jwk":{"e":"AQAB","kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","kty":"RSA","n":"5iMX7RQ_4F_zdb1qonMsuWUDauCOqEyRpD8L_EhgnwDxrgMHuOlJ4_7sEOrOa3Jkx3QhwIW6LJCP69PR5X0wvz6vmC1DoWEaWv41bAq23Knzj7gUU9-N_fkZPZN9NQwZ-D-Zqg9L1c_cJF93Dy93py8_JswWFDj1FxMaThJmrX68wBwjhF-JLYqgCAGFyezzJ3oTpO-esV9v6R7skfkaqtx_cjLZk_0cKB4VKTtxiy2A8D_5nANTOSSbZLXNh2Vatgh3yrOmnTTNLIs0YO3vFIuylEkczHlln-40UMAzRB3HNspUySyzImO_2yGdrA762LATQrOzJN8E1YKCADx5CQ"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool","environment":"production"},"name":"quay-service-key-updated","rotation_duration":null,"service":"quay"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/superuser/keys/{kid}endpoint to delete a service key:- curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/keys/<kid>" - $ curl -X DELETE \ -H "Authorization: Bearer <bearer_token>" \ "https://<quay_server>/api/v1/superuser/keys/<kid>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.18. Managing tags with the Red Hat Quay API
Tags can be changed, restored, deleted, or listed by using the Red Hat Quay API.
Procedure
- Use the - PUT /api/v1/repository/{repository}/tag/{tag}endpoint to change which image a tag points to or create a new tag:- curl -X PUT "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/<tag_name>" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"manifest_digest": "<MANIFEST_DIGEST>"}'- $ curl -X PUT "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/<tag_name>" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"manifest_digest": "<MANIFEST_DIGEST>"}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - "Updated" - "Updated"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/repository/{repository}/tag/{tag}/restoreendpoint to restore a repository tag back to a previous image in the repository:- curl -X POST "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/<tag_name>/restore" \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json" \ -d '{"manifest_digest": "sha256:<your_manifest_digest>"}'- $ curl -X POST "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/<tag_name>/restore" \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json" \ -d '{"manifest_digest": "sha256:<your_manifest_digest>"}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {}- {}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/repository/{repository}/tag/endpoint to obtain a list of repository tags:- curl -X GET "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/" \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json" - $ curl -X GET "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/" \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"tags": [{"name": "test", "reversion": true, "start_ts": 1740496373, "manifest_digest": "sha256:d08334991a3dba62307016833083d6433f489ab0f7d36d0a4771a20b4569b2f6", "is_manifest_list": false, "size": 2280303, "last_modified": "Tue, 25 Feb 2025 15:12:53 -0000"}, {"name": "test", "reversion": false, "start_ts": 1740495442, "end_ts": 1740496373, "manifest_digest": "sha256:d08334991a3dba62307016833083d6433f489ab0f7d36d0a4771a20b4569b2f6", "is_manifest_list": false, "size": 2280303, "last_modified": "Tue, 25 Feb 2025 14:57:22 -0000", "expiration": "Tue, 25 Feb 2025 15:12:53 -0000"}, {"name": "test", "reversion": false, "start_ts": 1740495408, "end_ts": 1740495442, "manifest_digest": "sha256:d08334991a3dba62307016833083d6433f489ab0f7d36d0a4771a20b4569b2f6", "is_manifest_list": false, "size": 2280303, "last_modified": "Tue, 25 Feb 2025 14:56:48 -0000", "expiration": "Tue, 25 Feb 2025 14:57:22 -0000"}], "page": 1, "has_additional": false}- {"tags": [{"name": "test", "reversion": true, "start_ts": 1740496373, "manifest_digest": "sha256:d08334991a3dba62307016833083d6433f489ab0f7d36d0a4771a20b4569b2f6", "is_manifest_list": false, "size": 2280303, "last_modified": "Tue, 25 Feb 2025 15:12:53 -0000"}, {"name": "test", "reversion": false, "start_ts": 1740495442, "end_ts": 1740496373, "manifest_digest": "sha256:d08334991a3dba62307016833083d6433f489ab0f7d36d0a4771a20b4569b2f6", "is_manifest_list": false, "size": 2280303, "last_modified": "Tue, 25 Feb 2025 14:57:22 -0000", "expiration": "Tue, 25 Feb 2025 15:12:53 -0000"}, {"name": "test", "reversion": false, "start_ts": 1740495408, "end_ts": 1740495442, "manifest_digest": "sha256:d08334991a3dba62307016833083d6433f489ab0f7d36d0a4771a20b4569b2f6", "is_manifest_list": false, "size": 2280303, "last_modified": "Tue, 25 Feb 2025 14:56:48 -0000", "expiration": "Tue, 25 Feb 2025 14:57:22 -0000"}], "page": 1, "has_additional": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/repository/{repository}/tag/{tag}endpoint to delete a tag from a repository:- curl -X DELETE "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/<tag_name>" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X DELETE "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/tag/<tag_name>" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.19. Managing teams by using the API
Team can be managing by using the Red Hat Quay API.
6.19.1. Managing team members and repository permissions by using the API
Use the following procedures to add a member to a team (by direct invite or by email), or to remove a member from a team.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the - PUT /api/v1/organization/{orgname}/team/{teamname}/members/{membername}command to add or invite a member to an existing team:- curl -X PUT \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members/<member_name>" - $ curl -X PUT \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members/<member_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "testuser", "kind": "user", "is_robot": false, "avatar": {"name": "testuser", "hash": "d51d17303dc3271ac3266fb332d7df919bab882bbfc7199d2017a4daac8979f0", "color": "#5254a3", "kind": "user"}, "invited": false}- {"name": "testuser", "kind": "user", "is_robot": false, "avatar": {"name": "testuser", "hash": "d51d17303dc3271ac3266fb332d7df919bab882bbfc7199d2017a4daac8979f0", "color": "#5254a3", "kind": "user"}, "invited": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the - DELETE /api/v1/organization/{orgname}/team/{teamname}/members/{membername}command to remove a member of a team:- curl -X DELETE \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members/<member_name>" - $ curl -X DELETE \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members/<member_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not an output in the CLI. To ensure that a member has been deleted, you can enter the - GET /api/v1/organization/{orgname}/team/{teamname}/memberscommand and ensure that the member is not returned in the output.- curl -X GET \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members" - $ curl -X GET \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "owners", "members": [{"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}, "invited": false}, {"name": "test-org+test", "kind": "user", "is_robot": true, "avatar": {"name": "test-org+test", "hash": "aa85264436fe9839e7160bf349100a9b71403a5e9ec684d5b5e9571f6c821370", "color": "#8c564b", "kind": "robot"}, "invited": false}], "can_edit": true}- {"name": "owners", "members": [{"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "b28d563a6dc76b4431fc7b0524bbff6b810387dac86d9303874871839859c7cc", "color": "#17becf", "kind": "user"}, "invited": false}, {"name": "test-org+test", "kind": "user", "is_robot": true, "avatar": {"name": "test-org+test", "hash": "aa85264436fe9839e7160bf349100a9b71403a5e9ec684d5b5e9571f6c821370", "color": "#8c564b", "kind": "robot"}, "invited": false}], "can_edit": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can enter the - PUT /api/v1/organization/{orgname}/team/{teamname}/invite/{email}command to invite a user, by email address, to an existing team:- curl -X PUT \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/invite/<email>" - $ curl -X PUT \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/invite/<email>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can enter the - DELETE /api/v1/organization/{orgname}/team/{teamname}/invite/{email}command to delete the invite of an email address to join a team. For example:- curl -X DELETE \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/invite/<email>" - $ curl -X DELETE \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/invite/<email>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.19.2. Setting the role of a team within an organization by using the API
Use the following procedure to view and set the role a team within an organization using the API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- Enter the following - GET /api/v1/organization/{orgname}/team/{teamname}/permissionscommand to return a list of repository permissions for the organization’s team. Note that your team must have been added to a repository for this command to return information.- curl -X GET \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/permissions" - $ curl -X GET \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/permissions"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"permissions": [{"repository": {"name": "api-repo", "is_public": true}, "role": "admin"}]}- {"permissions": [{"repository": {"name": "api-repo", "is_public": true}, "role": "admin"}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You can create or update a team within an organization to have a specified role of admin, member, or creator using the - PUT /api/v1/organization/{orgname}/team/{teamname}command. For example:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"name": "testteam", "description": "", "can_view": true, "role": "creator", "avatar": {"name": "testteam", "hash": "827f8c5762148d7e85402495b126e0a18b9b168170416ed04b49aae551099dc8", "color": "#ff7f0e", "kind": "team"}, "new_team": false}- {"name": "testteam", "description": "", "can_view": true, "role": "creator", "avatar": {"name": "testteam", "hash": "827f8c5762148d7e85402495b126e0a18b9b168170416ed04b49aae551099dc8", "color": "#ff7f0e", "kind": "team"}, "new_team": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.19.3. Deleting a team within an organization by using the API
Use the following procedure to delete a team within an organization by using the API.
Prerequisites
- You have Created an OAuth access token.
- 
							You have set BROWSER_API_CALLS_XHR_ONLY: falsein yourconfig.yamlfile.
Procedure
- You can delete a team within an organization by entering the - DELETE /api/v1/organization/{orgname}/team/{teamname}command:- curl -X DELETE \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>" - $ curl -X DELETE \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI. 
6.20. Managing builds by using the Red Hat Quay API
Builds can be managed by using the Red Hat Quay API.
Procedure
- Use the - GET /api/v1/repository/{repository}/trigger/endpoint to list the triggers for the specified repository:- curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"triggers": [{"id": "32ca5eae-a29f-46c7-8f44-3221ca417c92", "service": "custom-git", "is_active": false, "build_source": null, "repository_url": null, "config": {}, "can_invoke": true, "enabled": true, "disabled_reason": null}]}- {"triggers": [{"id": "32ca5eae-a29f-46c7-8f44-3221ca417c92", "service": "custom-git", "is_active": false, "build_source": null, "repository_url": null, "config": {}, "can_invoke": true, "enabled": true, "disabled_reason": null}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/repository/{repository}/trigger/{trigger_uuid}/activateendpoint to activate the specified build trigger.- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/repository/{repository}/trigger/{trigger_uuid}/startendpoint to manually start the build from the specified trigger:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/repository/{repository}/trigger/{trigger_uuid}/buildsendpoint to list the builds started by the specified trigger:- curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid/builds?limit=10" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid/builds?limit=10" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/repository/{repository}/trigger/{trigger_uuid}endpoint to get information for the specified build trigger:- curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - PUT /api/v1/repository/{repository}/trigger/{trigger_uuid}endpoint to update the specified build trigger:- curl -X PUT "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid" \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json" \ -d '{"enabled": true}'- $ curl -X PUT "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid" \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json" \ -d '{"enabled": true}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/repository/{repository}/trigger/{trigger_uuid}endpoint to delete the specified build trigger:- curl -X DELETE "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X DELETE "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/trigger/example-trigger-uuid" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
6.21. Managing current user options by using the Red Hat Quay API
Some user options, like starring a repository, or getting information about your account, are available with the Red Hat Quay API.
Procedure
- Use the - GET /api/v1/user/endpoint to get user information for the authenticated user.- curl -X GET "https://quay-server.example.com/api/v1/user/" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/user/" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"anonymous": false, "username": "quayadmin", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "can_create_repo": true, "is_me": true, "verified": true, "email": "test@gmil.com", "logins": [], "invoice_email": false, "invoice_email_address": null, "preferred_namespace": false, "tag_expiration_s": 1209600, "prompts": [], "company": null, "family_name": null, "given_name": null, "location": null, "is_free_account": true, "has_password_set": true, "quotas": [{"id": 4, "limit_bytes": 2199023255552, "limits": [{"id": 3, "type": "Reject", "limit_percent": 100}]}], "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552, "running_backfill": "complete", "backfill_status": "complete"}, "organizations": [{"name": "test", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "can_create_repo": true, "public": false, "is_org_admin": true, "preferred_namespace": false}, {"name": "sample", "avatar": {"name": "sample", "hash": "ba560c68f1d26e8c6b911ac9b5d10d513e7e43e576cc2baece1b8a46f36a29a5", "color": "#b5cf6b", "kind": "org"}, "can_create_repo": true, "public": false, "is_org_admin": true, "preferred_namespace": false}], "super_user": true}- {"anonymous": false, "username": "quayadmin", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "can_create_repo": true, "is_me": true, "verified": true, "email": "test@gmil.com", "logins": [], "invoice_email": false, "invoice_email_address": null, "preferred_namespace": false, "tag_expiration_s": 1209600, "prompts": [], "company": null, "family_name": null, "given_name": null, "location": null, "is_free_account": true, "has_password_set": true, "quotas": [{"id": 4, "limit_bytes": 2199023255552, "limits": [{"id": 3, "type": "Reject", "limit_percent": 100}]}], "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552, "running_backfill": "complete", "backfill_status": "complete"}, "organizations": [{"name": "test", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "can_create_repo": true, "public": false, "is_org_admin": true, "preferred_namespace": false}, {"name": "sample", "avatar": {"name": "sample", "hash": "ba560c68f1d26e8c6b911ac9b5d10d513e7e43e576cc2baece1b8a46f36a29a5", "color": "#b5cf6b", "kind": "org"}, "can_create_repo": true, "public": false, "is_org_admin": true, "preferred_namespace": false}], "super_user": true}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/users/{username}endpoint to get user information for the specified user.- curl -X GET "https://quay-server.example.com/api/v1/users/example_user" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/users/example_user" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"anonymous": false, "username": "testuser", "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "super_user": false}- {"anonymous": false, "username": "testuser", "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "super_user": false}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - POST /api/v1/user/starredendpoint to star a repository:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"namespace": "test", "repository": "testrepo"}- {"namespace": "test", "repository": "testrepo"}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - GET /api/v1/user/starredendpoint to list all starred repositories:- curl -X GET "https://quay-server.example.com/api/v1/user/starred?next_page=<next_page_token>" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X GET "https://quay-server.example.com/api/v1/user/starred?next_page=<next_page_token>" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"repositories": [{"namespace": "test", "name": "testrepo", "description": "This repository is now under maintenance.", "is_public": true}]}- {"repositories": [{"namespace": "test", "name": "testrepo", "description": "This repository is now under maintenance.", "is_public": true}]}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - DELETE /api/v1/user/starred/{repository}endpoint to delete a star from a repository:- curl -X DELETE "https://quay-server.example.com/api/v1/user/starred/namespace/repository-name" \ -H "Authorization: Bearer <your_access_token>" - $ curl -X DELETE "https://quay-server.example.com/api/v1/user/starred/namespace/repository-name" \ -H "Authorization: Bearer <your_access_token>"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This command does not return output in the CLI.