5.6. 使用 Red Hat Quay API 删除软件仓库
使用以下步骤使用 Red Hat Quay API 删除存储库。
先决条件
- 您已创建了 OAuth 访问令牌。
流程
输入以下命令使用
DELETE /api/v1/repository/{repository}
端点删除存储库: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 从 CLI 删除存储库时,CLI 不会返回信息。要确认删除操作,您可以检查 Red Hat Quay UI,或者您可以输入以下
GET /api/v1/repository/{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 输出示例
{"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