KSC Open API
13.1
Kaspersky Security Center API description
|
Resets counters of viruses found on the specified hosts.
See also how to use the KlAkOAPI Python package: server = KlAkOAPI.AdmServer.KlAkAdmServer.Create("https://ksc.example.com:13299", "username", "password", verify = False) oHostGroup = KlAkOAPI.HostGroup.KlAkHostGroup(server) # fill array with host names oHosts2ZeroVirusCount = [...] # perform asynchronous action strActionGuid = oHostGroup.ZeroVirusCountForHosts(oHosts2ZeroVirusCount).OutPar('strActionGuid') # check for result of asynchronous action asyncActionStateChecker = KlAkOAPI.AsyncActionStateChecker.KlAkAsyncActionStateChecker(server) while True: res = asyncActionStateChecker.CheckActionState(strActionGuid) if res.OutPar('bFinalized'): if res.OutPar('bSuccededFinalized'): # got asynchronous result: success break else: # got asynchronous result: some error occurred err_description = KlAkOAPI.Params.KlAkParams(res.OutPar('pStateData')) print('Error occurred:', err_description['GNRL_EA_DESCRIPTION'], '(error code ' + str(err_description['KLBLAG_ERROR_INFO']['KLBLAG_ERROR_CODE']) + ')') return else: # asynchronous result is not ready yet - need to wait for lNextCheckDelay milliseconds time.sleep(MillisecondsToSeconds(res.OutPar('lNextCheckDelay'))) |