8.6. API を使用してラベルを追加および管理する


Red Hat Quay 管理者は、以下の手順を使用して、API を使用してタグのラベルを追加および管理できます。

手順

  1. リポジトリー内の特定のマニフェストの詳細を取得するには 、GET/api/v1/repository/{repository}/manifest/{manifestref} コマンドを使用します。

    $ curl -X GET \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Accept: application/json" \
      https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>
    Copy to Clipboard Toggle word wrap
  2. 特定のマニフェストのラベルのリストを取得するには、GET/api/v1/repository/{repository}/manifest/{manifestref}/labels コマンドを使用します。

    $ curl -X GET \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Accept: application/json" \
      https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels
    Copy to Clipboard Toggle word wrap

    出力例

    {"labels": [{"id": "e9f717d2-c1dd-4626-802d-733a029d17ad", "key": "org.opencontainers.image.url", "value": "https://github.com/docker-library/busybox", "source_type": "manifest", "media_type": "text/plain"}, {"id": "2d34ec64-4051-43ad-ae06-d5f81003576a", "key": "org.opencontainers.image.version", "value": "1.36.1-glibc", "source_type": "manifest", "media_type": "text/plain"}]}
    Copy to Clipboard Toggle word wrap

  3. 特定のマニフェストに関する情報を取得するには 、GET/api/v1/repository/{repository}/manifest/{manifestref}/labels/{labelid} コマンドを使用します。

    $ curl -X GET \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Accept: application/json" \
      https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<label_id>
    Copy to Clipboard Toggle word wrap

    出力例

    {"id": "e9f717d2-c1dd-4626-802d-733a029d17ad", "key": "org.opencontainers.image.url", "value": "https://github.com/docker-library/busybox", "source_type": "manifest", "media_type": "text/plain"}
    Copy to Clipboard Toggle word wrap

  4. POST/api/v1/repository/{repository}/manifest/{manifestref}/labels コマンドを使用して、特定のリポジトリー内のマニフェストに追加のラベルを追加できます。以下に例を示します。

    $ curl -X POST \
      -H "Authorization: Bearer <bearer_token>" \
      -H "Content-Type: application/json" \
      --data '{
        "key": "<key>",
        "value": "<value>",
        "media_type": "<media_type>"
      }' \
      https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels
    Copy to Clipboard Toggle word wrap

    出力例

    {"label": {"id": "346593fd-18c8-49db-854f-4cb1fb76ff9c", "key": "example-key", "value": "example-value", "source_type": "api", "media_type": "text/plain"}}
    Copy to Clipboard Toggle word wrap

  5. DELETE/api/v1/repository/{repository}/manifest/{manifestref}/labels/{labelid} コマンドを使用してラベルを削除できます。

    $ curl -X DELETE \
      -H "Authorization: Bearer <bearer_token>" \
      https://<quay-server.example.com>/api/v1/repository/<repository>/manifest/<manifestref>/labels/<labelid>
    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