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

从运维管理器释放许可证密钥

Releases a license key from an Ops Manager installation. Use this endpoint when the installation no longer needs the license key. Ops Manager recalculates the license key status and returns it. Ops Manager records a License released audit event.

重要

After you release a license key, you can't use it again. If you release the only usable license key, your installation has no coverage. The state changes to GRACE, and then to UNLICENSED after 90 days. To generate a new license key, see Get and Install a License Key.

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 DELETE request with the license key ID in the path.

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

DELETE /admin/licenses/{artifactId}

请求路径包含以下参数:

Parameter
类型
必要性
说明

artifactId

字符串

必需

Unique identifier of the license key to release. Retrieve this value from the licenses[n].artifactId field of the Get the License Key Status of an Installation response.

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

名称
类型
必要性
说明
默认

pretty

布尔

Optional

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

false

envelope

布尔

Optional

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

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

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

  • status: HTTP 响应代码

  • content:预期响应正文

false

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

如果运维管理器释放了许可证密钥,则响应将包含重新计算的许可证密钥状态。响应包含以下字段:

字段
类型
说明

enforcement

对象

Aggregated license key status of the Ops Manager installation. This field is null until Ops Manager calculates the status for the first time.

enforcement.effectiveState

字符串

License key state of the installation. Ops Manager returns one of LICENSED, GRACE, EXPIRED, or UNLICENSED. To learn how the states map to the Ops Manager interface, see Ops Manager License Keys Overview.

enforcement.cause

字符串

Identifies what produced the effectiveState value.

enforcement.enforced

布尔

Indicates whether the state is EXPIRED or UNLICENSED. Ops Manager doesn't restrict any operation in these states.

enforcement.transition

对象

Next scheduled change to the license key state. This field is null when no change is scheduled.

enforcement.transition.evaluatorId

字符串

推动下一步变革的评估者。

enforcement.transition.inStateUntil

字符串

当前状态结束的日期和时间。

enforcement.transition.nextState

字符串

遵循当前状态的状态。

enforcement.warnings

对象数组

存在未解决的警告。Ops Manager 会在您的订单到期日之前发出续订警告。要了解更多信息,请参阅Ops Manager 许可证密钥概述。

enforcement.warnings[n].evaluatorId

字符串

提出警告的评估人员。

enforcement.warnings[n].since

字符串

警告开启的日期和时间。

enforcement.warnings[n].subjects

对象数组

Subjects that the warning covers. Each object contains an id and a since date. This array is empty when the warning applies to the whole installation.

enforcement.verdicts

对象数组

Contribution of each evaluator to the effectiveState value.

enforcement.verdicts[n].evaluatorId

字符串

做出判决的评估员。

enforcement.verdicts[n].state

字符串

说明评估者进行了计算。

enforcement.verdicts[n].breachAt

字符串

Date and time when the breach takes effect, such as the order end date. This date is in the future while the state is LICENSED.

enforcement.verdicts[n].warningStart

字符串

Date and time when the renewal warning window opens. This field is null unless the verdict state is LICENSED.

enforcement.verdicts[n].metadata

对象

Details that are specific to the evaluator. This field is null for evaluators that provide none.

enforcement.verdicts[n].transition

对象

Next change to the verdict state. The object contains inStateUntil and nextState fields. This field is null when no change is scheduled.

licenses

对象数组

安装在 Ops Manager 安装程序上的许可证密钥。

licenses[n].artifactId

字符串

许可证密钥的唯一标识符。使用此值释放许可证密钥。Ops Manager 界面会将此值显示为许可证密钥 ID。

licenses[n].usable

布尔

指示运维经理是否可以使用许可证密钥进行覆盖。

licenses[n].generatedAt

字符串

MongoDB 生成许可证密钥的日期和时间。

licenses[n].installedAt

字符串

许可证密钥的安装日期和时间。

licenses[n].status

字符串

Status of the license key. Ops Manager returns one of ACTIVE, EXPIRED, RELEASED, or DENIED. A license key is ACTIVE when it is usable and its order end date is in the future. A license key is EXPIRED when it is usable but its order end date passed.

licenses[n].statusCause

字符串

Reason code for a DENIED license key. Ops Manager returns one of CLAIM_CONFLICT, CLAIM_REVOKED, or VERIFICATION_FAILED. Ops Manager sets this field only for a DENIED license key.

licenses[n].statusReason

字符串

Sentence that describes why the license key is DENIED. Ops Manager sets this field only for a DENIED license key.

licenses[n].termEnd

字符串

Date and time when the coverage of the license key ends. This field is null when the license key has no end date.

licenses[n].grants

对象数组

Grants that the license key contains. For a RELEASED or DENIED license key, Ops Manager returns the grants if the stored license key still passes verification. This array is empty when verification fails.

licenses[n].grants[n].grantType

字符串

Type of the grant, such as contract.

licenses[n].grants[n].grantId

字符串

Identifier of the grant. This field is null when the issuer doesn't set it.

licenses[n].grants[n].startDate

字符串

拨款开始的日期和时间。

licenses[n].grants[n].endDate

字符串

资助终止的日期和时间。

licenses[n].grants[n].entitlements

对象数组

Entitlements that the grant carries. Each object uses the fields described for activeEntitlements.

activeEntitlements

对象

Entitlements that are active now, grouped by entitlement type. Each key is an entitlement type, such as exemption::telemetry. Each value is an array of entitlement objects.

activeEntitlements.<type>[n].type

字符串

权利类型。

activeEntitlements.<type>[n].productName

字符串

Product name that the entitlement applies to. This field is null when the entitlement has no product name.

activeEntitlements.<type>[n].active

布尔

表明该项权利是否生效。

activeEntitlements.<type>[n].window

对象

Validity window of the entitlement. The object contains start and end date fields. This field is null when the window has no bounds.

If you specify an artifactId that doesn't match an installed license key, the endpoint returns the HTTP status 404. The errorCode field of the response body contains ARTIFACT_NOT_FOUND, and the detail field contains No installed artifact with that id.

Use curl to send a DELETE request to the /admin/licenses/{artifactId} endpoint:

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request DELETE \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/licenses/{ARTIFACT-ID}?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}

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

{ "enforcement": { "effectiveState": "LICENSED", "cause": "term:LICENSED", "enforced": false, "transition": { "evaluatorId": "term", "inStateUntil": "2027-06-30T00:00:00Z", "nextState": "GRACE" }, "warnings": [], "verdicts": [ { "evaluatorId": "term", "state": "LICENSED", "breachAt": "2027-06-30T00:00:00Z", "warningStart": "2027-02-28T00:00:00Z", "metadata": null, "transition": { "inStateUntil": "2027-06-30T00:00:00Z", "nextState": "GRACE" } } ] }, "licenses": [ { "artifactId": "{ARTIFACT-ID}", "usable": true, "generatedAt": "2026-10-01T12:00:00Z", "installedAt": "2026-11-04T15:30:00Z", "status": "ACTIVE", "statusCause": null, "statusReason": null, "termEnd": "2027-06-30T00:00:00Z", "grants": [ { "grantType": "contract", "grantId": "{GRANT-ID}", "startDate": "2026-07-01T00:00:00Z", "endDate": "2027-06-30T00:00:00Z", "entitlements": [] } ] } ], "activeEntitlements": {}}