6.2. Red Hat Quay API を使用したロボットアカウントの作成
Red Hat Quay API を使用してロボットアカウントを作成するには、次の手順に従います。
前提条件
- OAuth アクセストークンを作成し ました。
手順
PUT/api/v1/organization/{orgname}/robots/{robot_shortname}
エンドポイントを使用して組織の新しいロボットアカウントを作成するには、次のコマンドを入力します。curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_name>"
$ curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/organization/<organization_name>/robots/<robot_name>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 出力例
{"name": "orgname+robot-name", "created": "Fri, 10 May 2024 15:11:00 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}
{"name": "orgname+robot-name", "created": "Fri, 10 May 2024 15:11:00 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 次のコマンドを入力して
、PUT/api/v1/user/robots/{robot_shortname}
エンドポイントを使用して現在のユーザーの新しいロボットアカウントを作成します。curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/user/robots/<robot_name>"
$ curl -X PUT -H "Authorization: Bearer <bearer_token>" "https://<quay-server.example.com>/api/v1/user/robots/<robot_name>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 出力例
{"name": "quayadmin+robot-name", "created": "Fri, 10 May 2024 15:24:57 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}
{"name": "quayadmin+robot-name", "created": "Fri, 10 May 2024 15:24:57 -0000", "last_accessed": null, "description": "", "token": "<example_secret>", "unstructured_metadata": null}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow