mongocli iam organizations apiKeys describe
返回组织中指定API密钥的详细信息。
要查看ID参数的可能值,请运行mongocli iam organizations apiKeys list。
使用此命令,您必须使用具有组织成员角色的用户帐户或API密钥进行身份验证。
语法
命令语法
mongocli iam organizations apiKeys describe <ID> [options]
参数
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
ID | 字符串 | 是 | 一个唯一24位字符串,用于标识您的API密钥。 |
选项
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
-h, --help | false | describe的帮助信息 | |
--orgId | 字符串 | false | 要使用的组织ID。此选项将覆盖配置文件或环境变量中的设置。 |
-o, --output | 字符串 | false | 输出格式。有效值是json、json-path、go-template或go-template-file。要查看完整的输出,请使用-o json选项。 |
继承选项
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
-P, --profile | 字符串 | false | 从配置文件中使用的配置文件名。要了解MongoCLI的配置文件,请参阅https://dochub.mongodb.org/core/atlas-cli-configuration-file. |
输出
如果命令成功执行,CLI将返回类似于以下示例的输出。括号内的值代表您的值。
ID DESCRIPTION PUBLIC KEY PRIVATE KEY <ID> <Desc> <PublicKey> <PrivateKey>
示例
# Return the JSON-formatted details for the organization API key with the ID 5f24084d8dbffa3ad3f21234 for the organization with the ID 5a1b39eec902201990f12345: mongocli iam organizations apiKeys describe 5f24084d8dbffa3ad3f21234 --orgId 5a1b39eec902201990f12345 -output json