Regarding Automatic Deletion, Cleanup, and Stop of Retrieval Tasks

I would like to develop an application that requests the Edge Retrieve feature for XProtect products.

In that case, I understand that it is necessary to control the requested tasks using the VideoOS.Platform.SDK.RemoteRetrievalTasks.RetrievalTask class.

Based on this, could you please provide information on the following three points?

1. Are the tasks generated by requests automatically deleted based on the retention period? If so, what are the conditions for deletion?

2. Regardless of whether the task result is Succeeded or not, is it necessary to explicitly call Cleanup()?

3. If an abnormality occurs on the application side and the requested task needs to be canceled, can Stop() be called regardless of the task’s state?

No, there is close or clean-up task you need to perform. If you explore the Remote Retrieval Task sample you can see this in use. - https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/remoteretrievaltasksample/readme.html&tree=tree_2.html

Yes.

Yes. We are not sure it will always resolve abnormal situations, but in that case our guess is that the Stop() might be without effect, but it will not harm, this is speculation as abnormality could be many things.

Please note that REST API can also be used for edge retrieval, if this is appealing please see (RetrieveEdgeStorage task)- https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/#tag/DeviceConfig/operation/postTaskForCameras

Thank you for your reply.Please tell me a bit more.

1. Since tasks are not automatically cleaned up, does that mean cleanup is always required once a task is completed, regardless of whether it succeeds or fails?

2. Currently, I have confirmed that RemoteRetrievalTask cannot be retrieved via the REST API (e.g., GET /API/rest/v1/tasks). Is this the expected behavior?

Yes. For other tasks run by the system there is automatic clean-up, for retrieval task you do in SDK/API there is no automatic clean-up.

In the Management Client you can notice looking under System Dashboard Current Tasks that you see a general node and then underneath Recording Servers nodes. This means that you can find current tasks in two places, generally for the Management Server and underneath that for the Recording Servers. It is the same way in the REST API that you can find tasks for the Recording Servers in a different endpoint.

Please read more about this here - https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/#section/Introduction/Tasks

In your case, instead of GET /API/rest/v1/tasks you need to do GET /api/rest/v1/recordingservers/[id]/tasks ([id] id of recording server)

PS.

Please note that to do the clean-up you need to do POST /api/rest/v1/tasks/[id]?task=TaskCleanup ([id] id of task)

From 2025R1 and forward it will be possible to do a /api/rest/v1/ recordingservers/[id]/tasks/[id]?task=TaskCleanup

Thank you for your reply. Please tell me a bit more.

1.Looking at the retrieval results, all tasks have “recordingServer” as their parent, making it impossible to determine which task is linked to which camera.

Could you tell me how to check which task is associated with which camera?

2. When an error occurs in a task, are the keys “errorCode” and “errorText” added to indicate its status?

The RetrivalTask contains the fields DeviceId and DeviceName.

Yes