Red Hat Quay API Guide Red Hat Quay 3.12 Red Hat Quay API Guide Red Hat OpenShift Documentation Team

Commands:
https://docs.quay.io/api/swagger/
FEATURE_REFERRERS_API: true
echo -n '<username>:<password>' | base64
abcdeWFkbWluOjE5ODlraWROZXQxIQ==
curl --location '<quay-server.example.com>/v2/auth?service=<quay-server.example.com>&scope=repository:quay/listocireferrs:pull,push' --header 'Authorization: Basic <base64_username:password_encode_token>' -k | jq
{ "token": "<example_secret> }
FEATURE_ASSIGN_OAUTH_TOKEN: true
This will prompt user <username> to generate a token with the following permissions: repo:create
Token assigned successfully
https://<yourquayhost>/api/v1/discovery.
export SERVER_HOSTNAME=<yourhostname> sudo podman run -p 8888:8080 -e API_URL=https://USDSERVER_HOSTNAME:8443/api/v1/discovery docker.io/swaggerapi/swagger-ui
BROWSER_API_CALLS_XHR_ONLY: false
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 POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -H "Accept: application/json" -d '{ "starttime": "<MM/DD/YYYY>", "endtime": "<MM/DD/YYYY>", "callback_email": "your.email@example.com" }' "http://<quay-server.example.com>/api/v1/user/exportlogs"
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/organization/{orgname}/aggregatelogs"
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -H "Accept: application/json" -d '{ "starttime": "<MM/DD/YYYY>", "endtime": "<MM/DD/YYYY>", "callback_email": "org.logs@example.com" }' "http://<quay-server.example.com>/api/v1/organization/{orgname}/exportlogs"
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" "<quay-server.example.com>/api/v1/repository/<repository_name>/<namespace>/aggregatelogs?starttime=2024-01-01&endtime=2024-06-18""
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -H "Accept: application/json" -d '{ "starttime": "2024-01-01", "endtime": "2024-06-18", "callback_url": "http://your-callback-url.example.com" }' "http://<quay-server.example.com>/api/v1/repository/{repository}/exportlogs"
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" https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<label_id>
curl -X DELETE -H "Authorization: Bearer <bearer_token>" https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<labelid>
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "key": "<key>", "value": "<value>", "media_type": "<media_type>" }' 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
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 POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{ "name": "<new_organization_name>" }' "https://<quay-server.example.com>/api/v1/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>"
curl -X PUT -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{"role": "admin"}' https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>
curl -X DELETE -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>
curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository>/permissions/user/<username>/
curl -X PUT -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "role": "write" }' https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes/<prototypeid>
curl -X DELETE -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes/<prototype_id>
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "role": "<admin_read_or_write>", "delegate": { "name": "<username>", "kind": "user" }, "activating_user": { "name": "<robot_name>" } }' https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes
curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/organization/<organization_name>/prototypes
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" -d '{ "repository": "<new_repository_name>", "visibility": "<public>", "description": "<This is a description of the new repository>." }' "https://quay-server.example.com/api/v1/repository"
curl -X GET -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>"
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>
curl -X DELETE -H "Authorization: Bearer <bearer_token>" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/notification/<uuid>
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "event": "<event>", "method": "<method>", "config": { "<config_key>": "<config_value>" }, "eventConfig": { "<eventConfig_key>": "<eventConfig_value>" } }' https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/notification/
curl -X POST -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/organization/<orgname>/robots/<robot_shortname>/regenerate"
curl -X POST -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>/regenerate"
curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_name>"
curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_shortname>"
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>" "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>"
curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/user/robots/<robot_name>"
curl -X DELETE -H "Authorization: Bearer <bearer_token>" "<quay-server.example.com>/api/v1/user/robots/<robot_shortname>"
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 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/"
curl -X DELETE -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/superuser/users/{username}"
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/organizations/"
curl -X POST -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "manifest_digest": <manifest_digest> }' quay-server.example.com/api/v1/repository/quayadmin/busybox/tag/test/restore
curl -X PUT -H "Authorization: Bearer <bearer_token>" -H "Content-Type: application/json" --data '{ "manifest_digest": "<manifest_digest>" }' https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/tag/<tag>
curl -X GET -H "Authorization: Bearer <bearer_token>" -H "Accept: application/json" https://<quay-server.example.com>/api/v1/repository/<namespace>/<repository_name>/tag/
curl -X PUT -H "Authorization: Bearer <your_access_token>" "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members/<member_name>"
If the user is merely invited to join the team, then the invite is removed instead.
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 GET -H "Authorization: Bearer <your_access_token>" "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/members"
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 DELETE -H "Authorization: Bearer <your_access_token>" "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/invite/<email>"
curl -k -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer <bearer_token>" --data '{"role": "creator"}' https://<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>"
{ "is_enabled": True, "external_reference": "quay.io/redhat/quay", "sync_interval": 5000, "sync_start_date": datetime(2020, 0o1, 0o2, 6, 30, 0), "external_registry_username": "fakeUsername", "external_registry_password": "fakePassword", "external_registry_config": { "verify_tls": True, "unsigned_images": False, "proxy": { "http_proxy": "http://insecure.proxy.corp", "https_proxy": "https://secure.proxy.corp", "no_proxy": "mylocalhost", }, }, }
{ "root_rule": {"rule_kind": "tag_glob_csv", "rule_value": ["latest", "foo", "bar"]}, }