Jump to content

KSC 12 OpenAPI - HostMoveRules.AddRules issue


Go to solution Solved by SwiBry,

Recommended Posts

Posted

Hi Kaspersky community,

 

I’m implementing KSC OpenAPI and runnign in some troubles with HostMoveRules.

 

I need to create rules that moves hosts from unasigned devices to a target host group based on hosts DNS domain name.

 

To do so I use the HostMoveRules.AddRule method, with this body :

{
"pRuleInfo": {
"KLHST_MR_Group": 8,
"KLHST_MR_Custom": {
"HRULE_ROAMING_STATUS": 0,
"HRULE_FROM_UNASSIGNED": true,
"HRULE_USE_IP_RANGE": false,
"HRULE_QUERY_PART1": "(KLHST_WKS_FROM_UNASSIGNED<>0)",
"HRULE_USE_CON_IP_RANGE": false,
"KLHST_WKS_WINHOSTNAME": "",
"HRULE_ALIEN": 0,
"KLHST_WKS_DNSNAME": "",
"KLDPNS_ID": 0,
"KLHST_WKS_WINDOMAIN": "",
"KLHST_WKS_DNSDOMAIN": "some.domain.name",
"HRULE_QUERY_PART2": "(KLHST_WKS_DNSDOMAIN=\"some.domain.name\")"
},
"KLHST_MR_Options": 0,
"KLHST_MR_Enabled": true,
"KLHST_MR_Type": 0,
"KLHST_MR_Query": "(&(KLHST_WKS_FROM_UNASSIGNED<>0)(KLHST_WKS_DNSDOMAIN=\"some.domain.name\"))",
"KLHST_MR_DN": "some.domain.name"
}
}

And receive this error :

{
"PxgError": {
"code": 1192,
"file": "c:\\a\\b\\a_6cb29bb7\\s\\csadminkit\\development2\\kloapi\\contentstream\\sax_handler.cpp",
"line": 314,
"message": "Field 'type' is not found for the value with name: KLHST_MR_Custom",
"module": "KLSTD",
"subcode": 0
}
}

I really hope someone out here can help me :)

 

Best regards,

Bryan

  • Solution
Posted

My bad, I figured it out. Bad formating of KLHST_MR_Custom.

RTFM helps some times…

Guest
This topic is now closed to further replies.


×
×
  • Create New...