15.3.5. API を使用した現行ユーザーの namespace の自動プルーニングポリシーの作成
Red Hat Quay API エンドポイントを使用して、自分のアカウントの自動プルーニングポリシーを管理できます。
注記
以下のコマンドで使用している /user/ は、現在 Red Hat Quay にログインしているユーザーを表しています。
前提条件
- OAuth アクセストークンを作成している。
- Red Hat Quay にログインしている。
手順
次の
POSTコマンドを入力して、現在のユーザーのタグ数を制限する新しいポリシーを作成します。$ 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/出力例
{"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859"}次のコマンドを入力して、自動プルーニングポリシーを確認します。
$ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/または、UUID を含めることもできます。
$ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/8c03f995-ca6f-4928-b98d-d75ed8c14859出力例
{"policies": [{"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859", "method": "number_of_tags", "value": 10}]}次のコマンドを入力すると、自動プルーニングポリシーを削除できます。ポリシーを削除するには UUID が必要であることに注意してください。
$ curl -X DELETE -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/user/autoprunepolicy/8c03f995-ca6f-4928-b98d-d75ed8c14859出力例
{"uuid": "8c03f995-ca6f-4928-b98d-d75ed8c14859"}