为一个组织 API 密钥返回一个访问列表条目
返回指定的组织 API 密钥的一个访问列表条目。资源要求所有 API 请求均源自 API 访问列表上的 IP 地址。要使用此资源,请求的服务账户或 API 密钥必须具有组织成员角色。
路径参数
-
唯一的 24-十六进制数字字符串,用于标识包含项目的组织。 使用 /orgs 端点检索身份验证的用户有权访问权限的所有组织。
格式应符合以下模式:
^([a-f0-9]{24})$
。 -
一个 IP 地址或多个 IP 地址表示为一个 CIDR 区块,用于限制对指定组织 API 资源的请求。添加有子网掩码(如 192.0.2.0/24)的 CIDR 区块时,请使用 URL 编码的值 %2F 代替正斜线 /。
格式应符合以下模式:
^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$
。 -
唯一的 24 进制数字字符串,用于标识您要为其返回访问列表条目的组织 API 密钥。
格式应符合以下模式:
^([a-f0-9]{24})$
。
查询参数
-
指示应用程序是否将响应包装在
envelope
JSON 对象中的标志。某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,请在查询中设置 Envelope=true。返回结果列表的端点将结果对象用作 envelope。应用程序将状态参数添加到响应正文中。默认值为
false
。 -
指示响应正文是否应采用 prettyprint 格式的标记。
默认值为
false
。Prettyprint
GET /API/Atlas/v1.0/orgs/{orgId}/apiKeys/{apiUserId}/accessList/{ipAddress}
curl \
--request GET 'https://cloud.mongodb.com/api/atlas/v1.0/orgs/4888442a3354817a7320eb61/apiKeys/{apiUserId}/accessList/192.0.2.0%2F24' \
--header "Authorization: Bearer $ACCESS_TOKEN"
响应示例 (200)
{
"cidrBlock": "203.0.113.0/24",
"count": 42,
"created": "2025-05-04T09:42:00Z",
"ipAddress": "203.0.113.10",
"lastUsed": "2025-05-04T09:42:00Z",
"lastUsedAddress": "203.0.113.10",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
]
}
响应示例 (401)
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
响应示例 (403)
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
响应示例 (404)
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
响应示例 (500)
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}