tryUpdate()
The function tryUpdate() tries to update the current license.
Synopsis
int LicenseServiceClient::tryUpdate(&details);
Parameters
| Parameters | Meaning |
|---|---|
| details | Contains details about the update result in JSON format. |
Return Value
The function returns 0 if the license is successfully updated, and -1 if the function cannot be called. If an error occurs, the function returns a specific error number. For example, it returns 16 if no update is available or if the container is remote, and 15 if the auto-update fails.
Details
The tryUpdate() function attempts to update the current license and returns the result of the update operation.
[
"tryUpdate:",
15
]
The details parameter provides information about the update result in JSON format:
[
"The details of tryUpdate:",
{
"lastUpdateResult": {
"errorcode": 0,
"errortext": "operation \"autoupdate\" completed successfully",
"internalerrorcode": 0,
"internalerrortext": ""
},
"NextUpdateCheck": "2025-11-12T10:16:28.545Z",
"LicenseCentralState": "AVAILABLE"
}
]
[
"The details of tryUpdate:",
{
"lastUpdateResult": {
"errorcode": 15,
"errortext": "gateway call to read auto update licenses for cmcontainer \"130-2111743414\" failed",
"internalerrorcode": "",
"internalerrortext": ""
}
}
]
Example
The tryUpdate() function attempts to update the current license.
#uses "classes/sbl/LicenseServiceClient"
main(mapping event)
{
string details;
LicenseServiceClient licenseServiceClient;
DebugN(licenseServiceClient.tryUpdate(details));
DebugN("Tried to update the license. The details:", details);
}
Assignment
Availability
UI, CTRL
