Use the Ops Manager API to check the license key status of your Ops Manager installation and to install or release a license key. To learn how Ops Manager calculates license key status, see Ops Manager License Keys Overview. To manage license keys in the Ops Manager interface, see Manage License Keys in Ops Manager.
Prerequisites
Before you begin, ensure that you have the following:
An API key with the
Global Ownerrole.A license key file that you generated in the Key Portal. To learn how, see Manage License Keys in Ops Manager.
Install a License Key
Use the following procedure to install a license key and confirm that Ops Manager applies it.
Check the current license key status
Send a GET request to the /admin/licenses endpoint:
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request GET \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/licenses?pretty=true"The response includes the enforcement.effectiveState field and the licenses array. For a description of each field, see Get the License Key Status of an Installation.
Install the license key
Send a PUT request to the /admin/licenses endpoint. Use the contents of your license key file as the request body:
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}If Ops Manager accepts the license key, Ops Manager recalculates the status and returns it. If Ops Manager rejects the license key, the response contains an error. To resolve an error, see Troubleshoot Install Errors.
Confirm the new license key status
In the response from the previous step, check the following fields:
enforcement.effectiveStateisLICENSED.The new license key appears in the
licensesarray with astatusofACTIVE.
If the state is not what you expect, call the Recompute the License Key Status on Demand endpoint to recalculate the status, and then check the fields again.
Release a License Key
Use the following procedure to release a license key from your Ops Manager installation.
Important
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.
Release the license key
Send a DELETE request to the /admin/licenses/{artifactId} endpoint. Replace {ARTIFACT-ID} with the artifactId value:
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"Ops Manager recalculates the status and returns it. To learn more, see Release a License Key from Ops Manager.
Retrieve the Key Manager ID
The Key Manager ID identifies your Ops Manager installation, including every instance in a high-availability setup. The API returns the Key Manager ID in the holderId field. To retrieve it, send a GET request to the /admin/artifacts/identity endpoint. To learn more, see Get the Key Manager ID of an Installation.
Rotate the Identity Key
Your Ops Manager installation generates an identity key: a key pair that the installation uses to prove its identity when it connects to MongoDB. If you suspect that someone outside your organization obtained the private key, rotate the key to replace it with a new key pair. Your installation must be able to connect to MongoDB to rotate the key. To learn more, see Rotate the Identity Key of an Installation.
Troubleshoot Install Errors
When Ops Manager rejects a license key, the response has an HTTP status of 400, 403, or 409 and a JSON body that describes the error. The following fields identify the error:
Field | Description |
|---|---|
| Error code, such as |
| Message that describes the error and how to proceed. |
For the list of error codes, HTTP statuses, and messages, see Troubleshoot Install Errors.
Related Pages
For more information about license keys, see the following pages: