6.11.2. Red Hat Quay API を使用してチーム権限を管理する
Red Hat Quay API を使用してチーム権限を管理するには、次の手順に従います。
指定されたチームの権限は、
GET /api/v1/repository/{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>"出力例
{"role": "write"}すべてのチームの権限は、
GET /api/v1/repository/{repository}/permissions/team/エンドポイントを使用して返せます。以下に例を示します。$ curl -X GET \ -H "Authorization: Bearer <access_token>" \ "https://quay-server.example.com/api/v1/repository/<namespace>/<repository>/permissions/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"}}}}指定されたチームの権限は、
PUT /api/v1/repository/{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>"出力例
{"role": "admin", "name": "superteam", "avatar": {"name": "superteam", "hash": "48cb6d114200039fed5c601480653ae7371d5a8849521d4c3bf2418ea013fc0f", "color": "#9467bd", "kind": "team"}}チーム権限は、
DELETE /api/v1/repository/{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>"このコマンドは CLI に出力を返しません。