KSC Open API
13.0
Kaspersky Security Center API description
|
Creates the new host record.
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) nRootGroupId = oHostGroup.GroupIdGroups().RetVal() nNewGroupId = oHostGroup.AddGroup({'name': 'Test group', 'parentId': nRootGroupId}).RetVal() strPartOfName = "MyTestHost" strWinDomain = "MYTESTDOMAIN" strDnsDomain = "mytestdomain.com" for i in range(10): oHostPars = KlAkOAPI.Params.KlAkParams() oHostPars.AddString("KLHST_WKS_DN", strPartOfName + "-" + str(i)) oHostPars.AddInt("KLHST_WKS_GROUPID", nNewGroupId) oHostPars.AddString("KLHST_WKS_WINHOSTNAME", (strPartOfName + "-" + str(i)).upper() ) oHostPars.AddString("KLHST_WKS_DNSNAME", (strPartOfName + "-" + str(i)).lower() ) oHostPars.AddString("KLHST_WKS_WINDOMAIN", strWinDomain) oHostPars.AddString("KLHST_WKS_DNSDOMAIN", strDnsDomain) strAddedHost = oHostGroup.AddHost(oHostPars) |