6.14.2. Red Hat Quay API を使用してロボットアカウント情報を取得する
Red Hat Quay API を使用すると、組織およびユーザー向けに、権限などのロボットアカウント情報を取得できます。
前提条件
- OAuth アクセストークンを作成 している。
手順
GET /api/v1/organization/{orgname}/robots/{robot_shortname}API エンドポイントを使用して、組織のロボットの情報を返します。curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/organization/<ORGNAME>/robots/<ROBOT_SHORTNAME>"出力例
{"name": "test+example", "created": "Mon, 25 Nov 2024 16:25:16 -0000", "last_accessed": null, "description": "", "token": "string", "unstructured_metadata": {}}GET /api/v1/organization/{orgname}/robots/{robot_shortname}/permissionsエンドポイントを使用して、特定の組織ロボットの権限のリストを返します。$ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/organization/<ORGNAME>/robots/<ROBOT_SHORTNAME>/permissions"出力例
{"permissions": [{"repository": {"name": "testrepo", "is_public": true}, "role": "admin"}]}GET /api/v1/user/robots/{robot_shortname}API エンドポイントを使用して、指定された名前でユーザーのロボットを返します。$ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/user/robots/<ROBOT_SHORTNAME>"出力例
{"name": "quayadmin+mirror_robot", "created": "Wed, 15 Jan 2025 17:22:09 -0000", "last_accessed": null, "description": "", "token": "<token_example>", "unstructured_metadata": {}}GET /api/v1/user/robots/{robot_shortname}/permissionsAPI エンドポイントを使用して、ユーザーロボットの権限のリストを返します。$ curl -X GET \ -H "Authorization: Bearer <bearer_token>" \ "https://quay-server.example.com/api/v1/user/robots/<ROBOT_SHORTNAME>/permissions"出力例
{"permissions": [{"repository": {"name": "busybox", "is_public": false}, "role": "write"}]}