Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ /
Atlas CLI
/ / / /

Atlas組織は apiKeys を割り当てます

指定された組織 API キーのロールまたは説明を変更します。

パブリック プレビュー: MongoDB Atlas Admin APIから自動的に生成される Atlas APIサブコマンドは、Admin APIの完全なカバレッジを提供し、現在パブリック プレビュー段階です(フィードバックでフィードバックを提供してくださいフォーラム/930808-Atlas-cli)。管理API機能には独自のリリース ライフサイクルがあり、提供されているAPIエンドポイントのドキュメント リンクから確認できます。

このコマンドを使用して組織 API キーのロールを変更すると、指定した値が API キーに割り当てられた既存のロールを上書きします。

apiKeyId 引数の可能な値を表示するには、 Atlas組織 apiKeys list を実行します。

このコマンドを使用するには、ユーザー アカウントまたは組織ユーザー管理者ロールの API キーで認証する必要があります。

コマンド構文
atlas organizations apiKeys assign <apiKeyId> [options]
名前
タイプ
必須
説明

apiKeyId

string

true

キーを識別する一意な 24stringAPI 桁の 。

名前
タイプ
必須
説明

--desc

string

false

API キーの説明。

-h, --help

false

割り当てられるヘルプ

--orgId

string

false

使用する組織ID。 このオプションは、構成ファイルまたは環境変数の 設定を上書きします。

-o, --output

string

false

出力形式。 有効な値は、 JSON 、 JSON -path、go-template、または go-template-file です。 完全な出力を表示するには、 -o JSONオプションを使用します。

--role

string

false

Role or roles that you want to assign to the API key. To assign more than one role, specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. For the full list of accepted values, see the Items Enum for the corresponding Atlas API endpoint: https://www.mongodb.com/ja-jp/docs/api/doc/atlas-admin-api-v2/operation/operation-updateapikey. To learn more about organization level user roles, see: https://dochub.mongodb.org/core/atlas-org-roles. Passing this flag replaces preexisting data.

名前
タイプ
必須
説明

-P, --profile

string

false

構成ファイルから使用するプロファイルの名前。 Atlas CLI のプロファイルの詳細については、 https://docub.mongodb.org/core/atlas-cli-save- connection-settings を参照してください。

コマンドが成功すると、CLI は次のサンプルのような出力を返します。 括弧内の値は 値を表します。

API Key '<Id>' successfully updated.
# Modify the role and description for the API key with the ID 5f24084d8dbffa3ad3f21234 for the organization with the ID 5a1b39eec902201990f12345:
atlas organizations apiKeys assign 5f24084d8dbffa3ad3f21234 --role ORG_MEMBER --desc "User1 Member Key" --orgId 5a1b39eec902201990f12345 --output json

項目一覧