Agent Tasks
An agent task defines how and when a certain operation will be performed on an agent machine. An agent policy can contain several type of tasks, including check-in tasks, patch tasks, asset tasks and power tasks.
Base URL
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks
Supported Requests
Method | URL | Input | Return | ||||
---|---|---|---|---|---|---|---|
DELETE |
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/{agentId}/queuedTask/{queuedTaskId} |
|
Success code |
||||
GET |
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/{agentId}/tasks |
AgentPolicyTask | |||||
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/{agentId}/queuedTask |
|
ExecutedTask | |||||
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/{agentId}/queuedTask/{queuedTaskId} |
|
QueuedTask | |||||
POST |
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/{agentId}/checkin |
Success code | |||||
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/{agentId}/tasks/{taskId} |
Input Model
None
Example with Sample Response
Find all tasks associated with agent ID A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4
GET Request
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/tasks
Sample Response
{
"count": 4,
"value": [
{
"agentId": "A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4",
"links": {
"self": {
"href": "https://device-name.example.com:3121/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/tasks/f9cac0bc-20ba-41f8-b1ac-d347cd8dee21"
}
},
"taskId": "f9cac0bc-20ba-41f8-b1ac-d347cd8dee21",
"taskName": "Update Binaries",
"taskType": "None"
},
{
"agentId": "A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4",
"links": {
"self": {
"href": "https://device-name.example.com:3121/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/tasks/d939fb15-e5e0-402a-b169-b3b4e8de781a"
}
},
"taskId": "d939fb15-e5e0-402a-b169-b3b4e8de781a",
"taskName": "Update Patch Data",
"taskType": "None"
},
{
"agentId": "A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4",
"links": {
"self": {
"href": "https://device-name.example.com:3121/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/tasks/d006644d-e16f-4036-a5f2-99aa04f65d3a"
}
},
"taskId": "d006644d-e16f-4036-a5f2-99aa04f65d3a",
"taskName": "Clear Retry Counts",
"taskType": "None"
},
{
"agentId": "D0C5F75A80FFD5DEA9A2073A2202FF890C2B6223",
"links": {
"self": {
"href": "https://device-name.example.com:3121/st/console/api/v1.0/agenttasks/D0C5F75A80FFD5DEA9A2073A2202FF890C2B6223/tasks/026aa493-b898-4748-b800-ad5609496b23"
}
},
"taskId": "026aa493-b898-4748-b800-ad5609496b23",
"taskName": "WinTask1",
"taskType": "Patch"
}
]
}
Other Request Examples
DELETE Request
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/
queuedTask/c76c-3e47-4b97-bae5-265d586431e9
GET Request
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/queuedTask
GET Request
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/
queuedTask/c76c-3e47-4b97-bae5-265d586431e9
POST Request
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/checkin
POST Request
https://<consoleFQDN:port>/st/console/api/v1.0/agenttasks/A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4E1E2E3E4/tasks/
c76c-3e47-4b97-bae5-265d586431e9
Output Models
Name | Type | Description |
---|---|---|
agentId |
String |
The agent identifier. |
links |
Links |
Shows the related URL for the task. |
taskId |
Guid |
The task identifier. |
taskName |
String |
The name of the task. |
taskType |
Enum |
The type of task. •None (0): Uninitialized •WindowsPatch (1): Windows patch task •WindowsAsset (2): Windows asset task •WindowsPower (3): Windows power task •WindowsApplicationControl (4): Windows AC task •LinuxPatch (5): Linux patch task |
Name | Type | Description |
---|---|---|
agentId |
String |
The agent identifier. |
executingTaskId |
Guid |
The identifier of the executing task. |
links |
Links |
Shows the related URLs for the task. |
Name | Type | Description |
---|---|---|
executingTaskId |
Guid |
The identifier of the executing task. |
agentId |
String |
The agent identifier. |
links |
Links |
Shows the related URL for the task. |
taskStatus |
The status of the executing task. |
Name | Type | Description |
---|---|---|
canCancel |
Boolean |
Specifies if the task can be canceled. |
commandLine |
String |
Specifies the command line that was used to start the engine. |
endTime |
DateTime |
The time that the task completed. If null, then the task is still running. |
engineId |
Guid |
The identifier of the engine performing the task. |
hasArgument |
Boolean |
Specifies if the task has an argument. |
identifier |
AgentTaskIdentifier |
The identifier of the task. |
operationId |
Guid |
The operation that the engine is performing. |
startTime |
DateTime |
The time that the task was started. |