KSC Open API  13.1
Kaspersky Security Center API description
int Policy::CopyOrMovePolicy ( int  nPolicy,
int  nNewGroupId,
boolean  bDeleteOrigin,
params  pExtraData 
)

Copy or move policy.

Copies the specified policy and optionally deletes it.

Parameters:
nPolicy(int) source policy id
nNewGroupId(int) id of the AdmGroup (see HostGroup) to place the resulting policy
bDeleteOrigin(boolean) if server must delete nPolicy after copying
pExtraData(params) optional container with extra attributes, may contain following data:
  • KLPOL_DN
  • KLPOL_ACTIVE
Returns:
(int) id of the new policy
See also:
List of policy attributes

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)
            oPolicy = KlAkOAPI.Policy.KlAkPolicy(server)
            oHostGroup = KlAkOAPI.HostGroup.KlAkHostGroup(server)
            nRootGroupId = oHostGroup.GroupIdGroups().RetVal()
            idNewPolicy = oPolicy.CopyOrMovePolicy( idPolicy, nRootGroupId, False, {"KLPOL_DN": "blah-blah-blah", "KLPOL_ACTIVE": False})