ClearLicense Method
Overloads
ClearLicense(LicenseType, Guid) |
Clears the license for a service. After this method has been called, the service will be unlicensed and might not be available until a new license has been applied. Only the QlikViewServer-license type is currently supported. |
ClearLicense(LicenseType, Guid)
Clears the license for a service. After this method has been called, the service will be unlicensed and might not be available until a new license has been applied. Only the QlikViewServer-license type is currently supported.
Declaration
void ClearLicense(LicenseType licenseType, Guid serviceID)
Parameters
Type | Name | Description |
---|---|---|
LicenseType | licenseType |
The type of license to return. |
System.Guid | serviceID |
The ID if the service. |
Remarks
security
Requires membership of local groups QlikView Management API and QlikView Administrator.
Examples
The following example clears the license for the first QVS found.
The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.
using System;
using System.Collections.Generic;
using System.Linq;
using QMSAPI;
class Program
{
static void Main(string[] args)
{
try
{
// create a QMS API client
IQMS apiClient = new QMSClient();
//retrieve a time limited service key
ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();
//Find a QlikView Server service.
ServiceInfo qlikViewServiceInfo = apiClient.GetServices(ServiceTypes.QlikViewServer).FirstOrDefault();
if( qlikViewServiceInfo != null) {
apiClient.ClearLicense(LicenseType.QlikViewServer, qlikViewServiceInfo.ID);
}
}
catch (Exception ex)
{
Console.WriteLine("An exception occurred: " + ex.Message);
}
// wait for user to press any key
Console.ReadLine();
}
}
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
Thrown if the provided licenseType parameter is unsupported. |
See Also
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!