获取已签名的收据,确认您已从 Ops Manager 安装中释放许可证密钥。Ops Manager 仅针对已释放的许可证密钥返回收据。Ops Manager 界面也提供相同的收据下载。
Keep the receipt as proof of the release. If your installation can't connect to MongoDB, upload the receipt in the Key Portal at https://support.mongodb.com/keyportal.
所需角色
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 with the license key ID in the path.
基本 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
GET /admin/artifacts/{artifactId}/receipt请求路径参数
请求路径包含以下参数:
Parameter | 类型 | 必要性 | 说明 |
|---|---|---|---|
| 字符串 | 必需 | 已发布许可证密钥的唯一标识符。 |
请求查询参数
此端点接受以下查询参数:
名称 | 类型 | 必要性 | 说明 | 默认 |
|---|---|---|---|---|
pretty | 布尔 | Optional | 指示响应正文是否采用 pretty-print 格式的标志。 |
|
envelope | 布尔 | Optional | 指示是否将响应包装在信封中的标志。 某些 API 客户端无法访问 HTTP 响应标头或状态代码。要解决这个问题,可在查询中设置 envelope=true。 对于返回一个结果的端点,响应体包括:
|
|
请求正文参数
此端点不使用 HTTP 请求正文参数。
响应
响应包含以下字段:
字段 | 类型 | 说明 |
|---|---|---|
| 对象 | 许可证密钥的发布收据,以 JSON 文档的形式返回。 |
Errors
If you specify an artifactId that doesn't match a released 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 released artifact with that id.
请求示例
Use curl to send a GET request to the /admin/artifacts/{artifactId}/receipt endpoint:
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request GET \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/artifacts/{ARTIFACT-ID}/receipt?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-aliveHTTP/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}响应体
以下示例显示了响应正文:
{ "receipt": { "{RECEIPT-CONTENTS}": "..." }}