6.19.2. API を使用して組織内のチームのロールを設定する
API を使用して組織内のチームのロールを表示および設定するには、次の手順に従います。
前提条件
- OAuth アクセストークンを作成 している。
手順
組織のチームのリポジトリー権限のリストを返すには、次の
GET/api/v1/organization/{orgname}/team/{teamname}/permissionsコマンドを入力します。このコマンドで情報を取得するには、チームがリポジトリーに追加されている必要があることに注意してください。$ curl -X GET \ -H "Authorization: Bearer <your_access_token>" \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>/permissions"出力例
{"permissions": [{"repository": {"name": "api-repo", "is_public": true}, "role": "admin"}]}PUT/api/v1/organization/{orgname}/team/{teamname}コマンドを使用して、組織内のチームを作成または更新し、指定されたロールを admin、member、または creator にすることができます。以下に例を示します。$ curl -X PUT \ -H "Authorization: Bearer <your_access_token>" \ -H "Content-Type: application/json" \ -d '{ "role": "<role>" }' \ "<quay-server.example.com>/api/v1/organization/<organization_name>/team/<team_name>"出力例
{"name": "testteam", "description": "", "can_view": true, "role": "creator", "avatar": {"name": "testteam", "hash": "827f8c5762148d7e85402495b126e0a18b9b168170416ed04b49aae551099dc8", "color": "#ff7f0e", "kind": "team"}, "new_team": false}