KSC Open API  13.1
Kaspersky Security Center API description
wstring GroupTaskControlApi::ImportTask ( binary  pBlob,
params  pExtraData,
[out] params  pCommitInfo 
)

Prepares task import.

Prepares task import operation. This method does not perform actual import of task: instead, it prepares import operation by saving task blob and associating unique identifier with it, which should be later used in GroupTaskControlApi::CommitImportedTask method. Some tasks have import security restrictions, thus import of task can be allowed or denied. To determine these restrictions, one should analyze info, returned via output parameter pCommitInfo (see detailed parameter descriptions in parameter section), and pass analyze result in bCommit parameter of GroupTaskControlApi::CommitImportedTask.

Parameters:
pBlob(binary) Pointer to memory chunk with imported task data
pExtraData(params) Task import options, which can be one of the following attributes:
  • "PRTS_TASK_GROUPID" - in case of group task, id of parent group (paramInt)
  • "HostList" - in case of global task, array of host identifiers (paramArray of paramString)
  • ".HstQueryId" - in case of query-based task, id of target devices query (paramInt)
pCommitInfo(params) Output commit info , used to decide whether we can continue importing task with GroupTaskControlApi::CommitImportedTask method, or not. Contents of pCommitInfo contains description of task, see Task settings format, except that the contents of TASK_ADDITIONAL_PARAMS was modified in the following way - all attributes in TASK_ADDITIONAL_PARAMS were deleted, except these ones:
  • "klprts-TaskSystemFlag" The flag means that the task is system task and cannot be created or deleted by user (paramBool)
  • "klprts-TaskHasPredefinedTargetList" It means that a list of target computers can not be changed during task's creation (paramBool)
  • "KLTSK_RI_GROUP_TO_MOVE_HOST" Group where destination hosts will be moved after deployment finishes. Attribute absence or value of -1 means "don't move" (paramInt)
Returns:
(wstring) Unique identifier of task blob for later import
Exceptions:
KLERR::Error*Method must throw KLERR::Error* exception with code KLSTD::STDE_BADFORMAT in case if data in pBlob is not recognized as a valid task data
KLERR::Error*Method must throw KLERR::Error* exception with code KLSTD::STDE_NOMEMORY in case of insufficient memory for storing required task data