KSC Open API  13.1
Kaspersky Security Center API description
int HostMoveRules::AddRule ( params  pRuleInfo)

Add extended host moving rule.

Creates new extended host moving rule with specified attributes.

Parameters:
pRuleInfo(params) object containing rule attributes, see List of extended host moving rule attributes. Following attributes are required:
  • KLHST_MR_DN
  • KLHST_MR_Group
  • KLHST_MR_Options
  • KLHST_MR_Query
Returns:
(int) id of created rule.

See also Python code with use of KlAkOAPI Python package below:

            server = KlAkOAPI.AdmServer.KlAkAdmServer.Create("https://ksc.example.com:13299", "username", "password", verify = False)
            oHostMoveRules = KlAkOAPI.HostMoveRules.KlAkHostMoveRules(server)
            oHostMoveRules.AddRule({"KLHST_MR_DN": "My test rule #1", \
                "KLHST_MR_Group": 1, \
                "KLHST_MR_Options": 0, \
                "KLHST_MR_Query": "(&(KLHST_WKS_FROM_UNASSIGNED <> 0)(KLHST_WKS_WINHOSTNAME=\"TEST*"))", \
                "KLHST_MR_Custom": KlAkOAPI.Params.paramParams({"MyComment": "Rule #1"}) })