API / Agent Behavior Questions

Solved
YR
Yoan R Bronze Contributor
COPPERNIC

Hello,

I have some question regarding the agent behavior when it receive requests.

We use the MobiControl API.

  1. Does the agent process tasks synchronously or asynchronously ?
  2. What is the agent's behavior regarding queuing / buffer ?
  3. If the agent is unreachable and we send several commands to the agent, will all the commands be processed the next time the agent connects or only the last command sent ?
  4. Is there a way to manage request priorities ?
  5. If we send a reboot request to the agent (POST /devices/{deviceId}/actions: SoftReset) is there a way from our business application to catch this information ? Would it be possible to identify from our application that a reboot request has been sent to the agent ? Is there a library available for this kind of operation ?

Many thanks for your answer / explanation / documentation regarding these different points.

5 years ago
SOTI MobiControl
ANSWERS
J
JCMOD@SOTI Platinum Contributor
5 years ago

Hi Yoan,

Here's the response, hope this helps:

General Reminder - The Web Console processes the request for the API and not the device. From the device's perspective, it is no different from sending a lot of commands to it from the web console.
 
 
Does the agent process tasks synchronously or asynchronously ?
First in first out from the Deployment Server sequentially, but tasks that take time (Package Deployment, File Sync) will not delay an action, message or a script.
 
 
What is the agent's behavior regarding queuing / buffer ?
The Agent doesn't have a formal queue and handles requests sequentially from the DS (each one immediately). The DS has a queue and manages the requests from there.
 
 
If the agent is unreachable and we send several commands to the agent, will all the commands be processed the next time the agent connects or only the last command sent ?
If this is a script command or message, you have to set the flag in the API to queue the script if the device is offline. If you don't do this the script will be discarded for that device. Also, all other "actions" are not queued if the device is "offline"
 
 
Is there a way to manage request priorities ?
No, I recommend designing the API application with this in mind.
 
 
If we send a reboot request to the agent (POST /devices/{deviceId}/actions: SoftReset) is there a way from our business application to catch this information ?
No, The only mention of the reboot request is in the Device System logs.
 
 
Would it be possible to identify from our application that a reboot request has been sent to the agent ?
No. The only mention of the reboot request is in the Device System logs.
 
 
Is there a library available for this kind of operation ?
No, and the use case seems too narrow for a Feature Request. But you should file one anyway.
 
 
Theoretically, as a workaround, you could change your business application to accept an intent that the app could interpret as a request to soft reboot. Then, by using the SendScript action in the Actions API, you could send an intent from the agent to the app, wait a few seconds, then perform a soft reset in the script.
 
 
Regards,
Solution
J
JCMOD@SOTI Platinum Contributor
5 years ago

Hello Yoan,

I've requested this information internally for you, expect an update in due course. 

Regards,

YR
Yoan R Bronze Contributor
5 years ago

Hi, many thanks to you !