KSC Open API
Kaspersky Security Center API description
|
Server hierarchy management interface. More...
Public Member Functions | |
array | GetChildServers (int nGroupId) |
Enumerate secondary servers for specified group. | |
params | GetServerInfo (int lServer, array pFields) |
Acquire specified secondary server attributes. | |
int | RegisterServer (wstring wstrDisplName, int nGroupId, binary pCertificate, wstring wstrNetAddress, params pAdditionalInfo) |
Register new secondary server for the specified group. | |
DelServer (int lServer) | |
Remove specified secondary server. | |
UpdateServer (int lServer, params pInfo) | |
Modify specified secondary server attributes on primary server. | |
int | FindSlaveServers (wstring wstrFilter, array pFieldsToReturn, array pFieldsToOrder, params pParams, int lMaxLifeTime,[out] wstring wstrIterator) |
Searches for secondary servers meeting specified criteria. |
Server hierarchy management interface.
With KlAkOAPI Python package server hierarchy object can be created and used as show below:
server = KlAkOAPI.AdmServer.KlAkAdmServer.Create("https://ksc.example.com:13299", "username", "password", verify = False) oServerHierarchy = KlAkOAPI.ServerHierarchy.KlAkServerHierarchy(server) oChildServers = oServerHierarchy.GetChildServers(-1).RetVal() for oChildServer in oChildServers: print("Server's '" + oChildServer["KLSRVH_SRV_DN"] + "', id=" + str(oChildServer["KLSRVH_SRV_ID"]) \ + " status is " + (lambda: 'Inactive' if oChildServer["KLSRVH_SRV_STATUS"] == 0 else 'Active')())
For details see Sample. Creating and destroying primary/secondary relation.