KSC Open API
Kaspersky Security Center API description
|
Works with the host result set. More...
Public Member Functions | |
int | GetItemsCount (wstring strAccessor) |
Returns a number of elements contained in the specified result set. | |
int | GetItemsChunk (wstring strAccessor, int nStart, int nCount,[out] params pChunk) |
Receives the subset of the result set elements by ranges. | |
Release (wstring strAccessor) | |
Releases result set. |
Works with the host result set.
Works with the result set that is the server-side ordered collection of the found hosts.
See also how to use the KlAkOAPI Python package:
server = KlAkOAPI.AdmServer.KlAkAdmServer.Create("https://ksc.example.com:13299", "username", "password", verify = False)
strAccessor = KlAkOAPI.HostGroup.KlAkHostGroup(server).FindHosts("(KLHST_WKS_FQDN=\"" + socket.getfqdn() + "")", \ ["KLHST_WKS_HOSTNAME", "KLHST_WKS_DN"], [], {'KLGRP_FIND_FROM_CUR_VS_ONLY': True}, lMaxLifeTime = 60 * 60).OutPar('strAccessor')
oChunkAccessor = KlAkOAPI.ChunkAccessor.KlAkChunkAccessor(server) nCount = oChunkAccessor.GetItemsCount(strAccessor).RetVal() print("Found hosts for query string:", nCount)
nStart = 0 nStep = 100 while nStart < nCount: oChunk = oChunkAccessor.GetItemsChunk(strAccessor, nStart, nStep) oHosts = oChunk.OutPar('pChunk')['KLCSP_ITERATOR_ARRAY'] for oObj in oHosts: print("Found host: " + oObj["KLHST_WKS_DN"])
nStart += nStep