对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。

获取安装的密钥管理器 ID

Retrieves the Key Manager ID of an Ops Manager installation. The Key Manager ID identifies the installation, including every instance in a high-availability setup. The Key Portal uses it to issue a license key for your installation. Ops Manager returns it in the holderId field and rejects a license key that MongoDB issued for a different Key Manager ID.

To access this resource, your API key must have the Global Owner role. The Global Owner role is the highest role in Ops Manager. Only users with this role can view and manage license keys.

Send a GET request to retrieve the Key Manager ID.

基本 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

GET /admin/artifacts/identity

此端点不使用 HTTP 请求路径参数。

此端点接受以下查询参数:

名称
类型
必要性
说明
默认

pretty

布尔

Optional

指示响应正文是否采用 pretty-print 格式的标志。

false

envelope

布尔

Optional

指示是否将响应包装在信封中的标志。

某些 API 客户端无法访问 HTTP 响应标头或状态代码。要解决这个问题,可在查询中设置 envelope=true。

对于返回一个结果的端点,响应体包括:

  • status: HTTP 响应代码

  • content:预期响应正文

false

此端点不使用 HTTP 请求正文参数。

响应包含以下字段:

字段
类型
说明

holderId

字符串

Ops Manager 安装的关键管理器 ID。

Use curl to send a GET request to the /admin/artifacts/identity endpoint:

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request GET \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/artifacts/identity?pretty=true"

以下示例显示了成功请求的响应头和响应正文。

以下标头分别显示了未经授权的响应和成功的响应:

HTTP/1.1 401 UnauthorizedContent-Type: application/json;charset=ISO-8859-1Date: {dateInUnixFormat}WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=falseContent-Length: {requestLengthInBytes}Connection: keep-alive
HTTP/1.1 200 OKVary: Accept-EncodingContent-Type: application/jsonStrict-Transport-Security: max-age=300Date: {dateInUnixFormat}Connection: keep-aliveContent-Length: {requestLengthInBytes}X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}

以下示例显示了响应正文:

{ "holderId": "{KEY-MANAGER-ID}"}