14.4.5. 使用配额限制拒绝推送

如果镜像推送超过定义的配额限制,则会发生软或硬检查:

  • 对于软检查,或警告 ,用户会收到通知。
  • 对于硬检查 或拒绝,该推送将被终止。

14.4.5.1. 设置 reject 和 warning 限制

要设置 rejectwarning 限制,请将 POST 数据发送到 /api/v1/organization/{orgname}/quota/{quota_id}/limit 端点:

拒绝限制命令示例

$ curl -k -X POST -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' -d '{"type":"Reject","threshold_percent":80}'  https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1/limit

警告限制命令示例

$ curl -k -X POST -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' -d '{"type":"Warning","threshold_percent":50}'  https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1/limit