6.21. Red Hat Quay API を使用して現在のユーザーオプションを管理する


リポジトリーにスターを付けたり、アカウントに関する情報を取得したりするなどの一部のユーザーオプションは、Red Hat Quay API で利用できます。

手順

  1. GET /api/v1/user/ エンドポイントを使用して、認証されたユーザーのユーザー情報を取得します。

    $ curl -X GET "https://quay-server.example.com/api/v1/user/" \
      -H "Authorization: Bearer <your_access_token>"
    Copy to Clipboard Toggle word wrap

    出力例

    {"anonymous": false, "username": "quayadmin", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "can_create_repo": true, "is_me": true, "verified": true, "email": "test@gmil.com", "logins": [], "invoice_email": false, "invoice_email_address": null, "preferred_namespace": false, "tag_expiration_s": 1209600, "prompts": [], "company": null, "family_name": null, "given_name": null, "location": null, "is_free_account": true, "has_password_set": true, "quotas": [{"id": 4, "limit_bytes": 2199023255552, "limits": [{"id": 3, "type": "Reject", "limit_percent": 100}]}], "quota_report": {"quota_bytes": 2280675, "configured_quota": 2199023255552, "running_backfill": "complete", "backfill_status": "complete"}, "organizations": [{"name": "test", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "can_create_repo": true, "public": false, "is_org_admin": true, "preferred_namespace": false}, {"name": "sample", "avatar": {"name": "sample", "hash": "ba560c68f1d26e8c6b911ac9b5d10d513e7e43e576cc2baece1b8a46f36a29a5", "color": "#b5cf6b", "kind": "org"}, "can_create_repo": true, "public": false, "is_org_admin": true, "preferred_namespace": false}], "super_user": true}
    Copy to Clipboard Toggle word wrap

  2. GET /api/v1/users/{username} エンドポイントを使用して、指定されたユーザーのユーザー情報を取得します。

    $ curl -X GET "https://quay-server.example.com/api/v1/users/example_user" \
      -H "Authorization: Bearer <your_access_token>"
    Copy to Clipboard Toggle word wrap

    出力例

    {"anonymous": false, "username": "testuser", "avatar": {"name": "testuser", "hash": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a", "color": "#6b6ecf", "kind": "user"}, "super_user": false}
    Copy to Clipboard Toggle word wrap

  3. POST /api/v1/user/starred エンドポイントを使用して、リポジトリーにスターを付けます。

    $ curl -X POST "https://quay-server.example.com/api/v1/user/starred" \
      -H "Authorization: Bearer <your_access_token>" \
      -H "Content-Type: application/json" \
      -d '{
            "namespace": "<namespace>",
            "repository": "<repository_name>"
          }'
    Copy to Clipboard Toggle word wrap

    出力例

    {"namespace": "test", "repository": "testrepo"}
    Copy to Clipboard Toggle word wrap

  4. GET /api/v1/user/starred エンドポイントを使用して、スター付きリポジトリーをすべてリストします。

    $ curl -X GET "https://quay-server.example.com/api/v1/user/starred?next_page=<next_page_token>" \
      -H "Authorization: Bearer <your_access_token>"
    Copy to Clipboard Toggle word wrap

    出力例

    {"repositories": [{"namespace": "test", "name": "testrepo", "description": "This repository is now under maintenance.", "is_public": true}]}
    Copy to Clipboard Toggle word wrap

  5. DELETE /api/v1/user/starred/{repository} エンドポイントを使用して、リポジトリーからスターを削除します。

    $ curl -X DELETE "https://quay-server.example.com/api/v1/user/starred/namespace/repository-name" \
      -H "Authorization: Bearer <your_access_token>"
    Copy to Clipboard Toggle word wrap

    このコマンドは CLI に出力を返しません。

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat