Scripted license management
Using REST API calls there is an option for scripted activation and deactivation for MetaDefender Core servers with no Internet connection or if your infrastructure is using automation to create/destroy MetaDefender Core instances. In this chapter the steps of these two scenarios are described.
Requirements
- an installed MetaDefender Core instance without Internet connection
- another computer that has Internet connection and can run your activation scripts
- a manual or automated way to transfer data between the two computers
Activation steps
- In order to activate MetaDefender Core, deployment ID and activation key are needed to generate the license file.
- Activation key should be purchased from OPSWAT.
- MetaDefender Core deployment ID can be queried by using REST API (for details see GET Get Current License InformationAPI page)
Save this deployment ID in your system, you might need this ID when the instance is unavailable at the time of deactivation.
- Activate license and get the license file using the following URL, where <quantity> is 1.
curl -X GET https://activation.dl.opswat.com/activation?key=<activation-key>&deployment=<deployment unique-ID>&quantity=<quantity>
If the activation is successfully, a license file is downloaded. Save this file.
HTTP status codes can be:
HTTP Response | Body | Comment |
---|---|---|
200 Ok | license file | Activation was successfully. |
200 Activation failed | error: '<user conform error message>' | Failed activation |
200 Invalid parameter | error: 'Could not activate your product because the Activation Key you provided is invalid. Check if you typed it correctly or open a support ticket if problem persist.' | Invalid key format |
200 Invalid parameter | error: 'Could not activate your product because the Deployment ID you provided is invalid. Check if you typed it correctly or open a support ticket if problem persist.' | Invalid deployment format |
200 Invalid parameter | error: 'Could not activate your product because the quantity you provided is invalid. Check if you typed it correctly or open a support ticket if problem persist.' | Invalid deployment format |
400 Bad request | Missing key, quantity or deployment | |
500 Internal server error | error: 'Internal server error (<error ID>). Please contact support' |
In case of any activation issue, contact OPSWAT support for help
- Upload license file to MetaDefender Core: The license file should be uploaded to the MetaDefender Core v4 to activate the product. For details see page: POST Upload license keyAPI
Deactivation steps
For deactivation, following infomation is required:
- Activation key
- MetaDefender Core deployment ID: can be queried by using REST API (for details see GET Get Current License InformationAPI page)
Deactivate license using the following URL:
curl -X GET https://activation.dl.opswat.com/deactivation?key=<activation-key>&deployment=<deployment unique-ID>
Response HTTP status codes can be:
HTTP Response | Body | Comment |
---|---|---|
200 Ok | result: ok | Successful deactivation |
200 No active license found | error: 'Could not found any active license with the given parameters' | The license has not been activated yet or it has been deactivated already. |
200 Invalid parameter | error: 'Could not deactivate your product because the Activation Key you provided is invalid. Check if you typed it correctly or open a support ticket if problem persist.' | Invalid key format |
200 Invalid parameter | error: 'Could not deactivate your product because the Deployment ID you provided is invalid. Check if you typed it correctly or open a support ticket if problem persist.' | Invalid deployment format |
400 Bad request | Missing key or deployment | |
500 Internal server error | error: 'Internal server error (<error ID>). Please contact support' |
Important notes
Product activation is tied to several hardware, operating system and software parameters. In case of one or more major hardware or software parameter change the product might turn into deactivated status. Operating system updates, other software updates should not affecting the activation status.
If the product is online activated and has live Internet connection then in case of deployment ID change the product reactivates itself. If the product doesn't have Internet connection then the administrator is responsible to reactivate the product.
Because of the above administrator should consider licensing restrictions of the offline deployments if using any virtualization and/or containerization technologies.