CM License API Update
Luke Hebert
- 2 minutes read - 254 wordsCloudera Manager makes license management straightforward through its REST API. If you need to swap in a new license file without opening a browser, a single curl call does the job.
Updating the License
Send a POST request to the /api/v4/cm/license endpoint on your Cloudera Manager host. You will need:
- The new license file on the machine where you run the command.
- Valid Cloudera Manager credentials (the default is
admin:admin). - The
Content-Type: multipart/form-dataheader.
curl -i -X POST \
-F license=@<license file> \
-u admin:admin \
-H "Content-Type: multipart/form-data" \
http://<hostname>:7180/api/v4/cm/licenseReplace <license file> with the path to your .lic file and <hostname> with the address of your Cloudera Manager server.
What to Expect
A successful response returns HTTP 200 with a JSON body confirming the new license details, including the expiration date and the number of nodes covered. If the request fails, check the following:
- The license file is valid and not expired.
- The credentials have permission to manage the cluster.
- Port
7180is reachable from the machine running the command.
The -i flag prints response headers alongside the body, which is handy for confirming the status code at a glance. Drop it if you only need the JSON payload.
Verifying the Change
After the update, you can confirm the active license by issuing a GET against the same endpoint:
curl -i -X GET \
-u admin:admin \
http://<hostname>:7180/api/v4/cm/licenseThe response will include the license type, expiration, and node count so you can verify everything looks correct before moving on.