Installs a signed license key file in an Ops Manager installation to add coverage after you generate a license key in the Key Portal. If Ops Manager accepts the license key, it recalculates the license key status and returns it, and records a License installed audit event.
필수 역할
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 PUT request with the license key file contents as the body.
기본 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
PUT /admin/licenses요청 경로 매개변수
이 엔드포인트는 HTTP 요청 경로 매개변수를 사용하지 않습니다.
요청 쿼리 매개변수
이 엔드포인트는 다음 쿼리 매개변수를 허용합니다.
이름 | 유형 | 필요성 | 설명 | 기본값 |
|---|---|---|---|---|
pretty | 부울 | 옵션 | 응답 본문이 pretty-print 형식인지 여부를 나타내는 플래그입니다. |
|
envelope | 부울 | 옵션 | 응답을 엔벨로프에 래핑할지 여부를 나타내는 플래그입니다. 일부 API 클라이언트는 HTTP 응답 헤더 또는 상태 코드에 액세스할 수 없습니다. 이 문제를 해결하려면 쿼리에서 envelope=true를 설정합니다. 하나의 결과를 반환하는 엔드포인트의 경우 응답 본문에는 다음이 포함됩니다.
|
|
요청 본문 매개변수
Send the contents of the license key file as the request body. Set the Content-Type header to application/json. The endpoint doesn't use named body parameters.
응답
Ops Manager가 라이선스 키를 수락하면 응답에는 재계산된 라이선스 키 상태가 포함됩니다. 응답에는 다음 필드가 포함됩니다.
필드 | 유형 | 설명 |
|---|---|---|
| 객체 | Aggregated license key status of the Ops Manager installation. This field is |
| 문자열 | License key state of the installation. Ops Manager returns one of |
| 문자열 | Identifies what produced the |
| 부울 | Indicates whether the state is |
| 객체 | Next scheduled change to the license key state. This field is |
| 문자열 | 미래의 변화를 주도하는 평가자. |
| 문자열 | 현재 상태가 종료되는 날짜 및 시간. |
| 문자열 | 현 상태를 따르는 상태. |
| 객체 배열 | 갱신 경고가 열려 있습니다. Ops Manager는 주문 만료일 이전에 갱신 경고를 표시합니다. 자세한 내용은 Ops Manager 라이선스 키 개요를 참조하세요. |
| 문자열 | 경고를 제기한 평가자. |
| 문자열 | 경고 메시지가 발생한 날짜와 시간입니다. |
| 객체 배열 | Subjects that the warning covers. Each object contains an |
| 객체 배열 | Contribution of each evaluator to the |
| 문자열 | 판결을 내린 평가자. |
| 문자열 | 평가자가 계산했음을 명시하십시오. |
| 문자열 | Date and time when the breach takes effect, such as the order end date. This date is in the future while the state is |
| 문자열 | Date and time when the renewal warning window opens. This field is |
| 객체 | Details that are specific to the evaluator. This field is |
| 객체 | Next change to the verdict state. The object contains |
| 객체 배열 | Ops Manager 설치에 포함된 라이선스 키입니다. |
| 문자열 | 라이선스 키의 고유 식별자입니다. 이 값을 사용하여 라이선스 키를 해제할 수 있습니다. Ops Manager 인터페이스에서는 이 값이 라이선스 키 ID로 표시됩니다. |
| 부울 | Ops Manager가 해당 라이선스 키를 적용 범위에 사용할 수 있는지 여부를 나타냅니다. |
| 문자열 | MongoDB가 라이선스 키를 생성한 날짜 및 시간. |
| 문자열 | 라이선스 키가 설치된 날짜 및 시간입니다. |
| 문자열 | Status of the license key. Ops Manager returns one of |
| 문자열 | Reason code for a |
| 문자열 | Sentence that describes why the license key is |
| 문자열 | Date and time when the coverage of the license key ends. This field is |
| 객체 배열 | Grants that the license key contains. For a |
| 문자열 | Type of the grant, such as |
| 문자열 | Identifier of the grant. This field is |
| 문자열 | 보조금 지급이 시작되는 날짜 및 시간. |
| 문자열 | 보조금 지급이 종료되는 날짜와 시간. |
| 객체 배열 | Entitlements that the grant carries. Each object uses the fields described for |
| 객체 | Entitlements that are active now, grouped by entitlement type. Each key is an entitlement type, such as |
| 문자열 | 권한 유형. |
| 문자열 | Product name that the entitlement applies to. This field is |
| 부울 | 자격이 유효한지 여부를 나타냅니다. |
| 객체 | Validity window of the entitlement. The object contains |
오류
If Ops Manager rejects the license key, the response has the HTTP status from the following table. The errorCode field of the response body contains the error code, and the detail field contains the message.
The messages use the word artifact to refer to a license key.
오류 코드 | HTTP Status | 메시지 |
|---|---|---|
| 400 | 이 파일을 읽을 수 없습니다. 파일이 손상되었거나 서명 후 수정되었을 수 있습니다. MongoDB 계정 담당 팀에 문의하여 교체 파일을 받으세요. |
| 400 | 이 파일은 검증할 수 없습니다. 서명 후 수정되었을 수 있습니다. MongoDB 계정 담당 팀에 문의하여 새 파일을 받으세요. |
| 400 | 이 파일은 다른 버전의 Ops Manager용으로 서명되었거나 신뢰할 수 없는 키로 서명되었습니다. 호환되는 파일을 받으려면 MongoDB 계정 담당 팀에 문의하십시오. |
| 400 | 이 파일의 서명 인증서는 이 Ops Manager에 유효하지 않습니다. 인증서를 교체하려면 MongoDB 계정 담당 팀에 문의하십시오. |
| 403 | 이 아티팩트는 특정 Ops Manager 인스턴스에 연결되어 있으므로 현재 인스턴스에는 설치할 수 없습니다. MongoDB 계정 담당 팀에 문의하십시오. |
| 409 | 이 아티팩트는 이 Ops Manager에 이미 설치된 아티팩트보다 최신 버전이 아닙니다. MongoDB 계정 팀에서 제공한 최신 아티팩트를 설치하십시오. |
요청 예시
Use curl to send a PUT request to the /admin/licenses endpoint:
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request PUT \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/licenses?pretty=true" \ --data @{LICENSE-KEY-FILE}응답 예시
다음 예시는 요청이 성공적으로 처리되었을 때의 응답 헤더와 응답 본문을 보여줍니다.
응답 헤더
다음 헤더는 권한 없음 응답과 권한 성공 응답을 보여줍니다.
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}응답 본문
다음 예시는 응답 본문을 보여줍니다.
{ "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": {}}오류 응답 예시
다음 예는 Ops Manager가 라이선스 키를 거부할 때의 응답 본문을 보여줍니다.
{ "error": 409, "reason": "Conflict", "detail": "This artifact is not newer than one already installed on this Ops Manager. Install the latest artifact issued by your MongoDB account team.", "errorCode": "ARTIFACT_OUTDATED", "parameters": []}