ListScanTasksByTarget
Queries the scan tasks of a specified scan target for AI Red Teaming with paging, and supports filtering by detection intensity, task status, and scan mode.
Operation description
Queries the list of scan tasks under a specified scan target with paging. Only returns the tasks of targets that belong to the current tenant.
Query scope and sorting:
Only returns tasks created within the last 366 days.
Sorts tasks in descending order of creation time.
TaskStatus filters tasks by status. ScanType filters tasks by scan mode. The scan mode is stored in the task execution parameters. Tasks that do not have a recorded scan mode are processed as attack.
Paging rules:
PageNumber starts from 1. If the value is less than 1, it is normalized to 1.
PageSize defaults to 10, with a maximum of 100 per page. If the value is greater than 100, it is clamped to 100. If the value is less than 1, a 400 error is returned.
The PageNumber and PageSize in the response are the actual effective values after normalization.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-aisc:ListScanTasksByTarget |
get |
*All Resource
|
None | None |
Request syntax
GET HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TargetId |
string |
Yes |
The unique identifier of the scan target. Only tasks under this target are queried. If the target does not exist or does not belong to the current tenant, a 400 error is returned. |
target-abc123def4567 |
| PageSize |
string |
Yes |
The number of entries per page. Default value: 10. Maximum value: 100. If the value is greater than 100, it is clamped to 100. If the value is less than 1, a 400 error is returned. |
10 |
| PageNumber |
string |
Yes |
The page number. Pages start from 1. If the value is less than 1, it is normalized to 1. |
1 |
| SampleLevel |
string |
No |
Filters tasks by detection intensity. If this parameter is not specified, tasks are not filtered by intensity. Valid values:
|
2 |
| TaskStatus |
string |
No |
Filters tasks by task status. If this parameter is not specified, tasks of all statuses are returned. Valid values:
|
completed |
| ScanType |
string |
No |
Filters tasks by scan mode. If this parameter is not specified, tasks of all modes are returned. Valid values:
|
attack |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The unique identifier of the request. It is used for troubleshooting and log tracing. |
1EBD0C05-6C1F-4C95-9C63-B7AB7B5A9C8E |
| TotalCount |
integer |
The total number of scan tasks that meet the filter conditions within the last 366 days. |
42 |
| PageSize |
integer |
The actual effective number of entries per page after normalization. This value may not be equal to the input parameter. |
10 |
| PageNumber |
integer |
The actual effective page number after normalization. This value may not be equal to the input parameter. |
1 |
| Data |
array<object> |
The list of scan tasks on the current page. |
|
|
object |
|||
| EndTime |
integer |
The end time of the task. The value is a millisecond timestamp (Unix epoch in milliseconds). If the task has not ended, the value is null. |
1735689600000 |
| ExecuteCaseCount |
integer |
The number of samples that have been executed for the task. |
80 |
| CreateTime |
integer |
The creation time of the task. The value is a millisecond timestamp (Unix epoch in milliseconds). |
1735689600000 |
| ScannerTaskMessage |
string |
The task message. If the task fails, this parameter indicates the cause of the failure. If the task succeeds or no message is available, this parameter is empty. |
Execution timed out |
| RiskLevel |
string |
The risk level of the task result. If the task is not completed or no risk assessment is generated, the value is null. Valid values:
|
high |
| SampleLevel |
integer |
The detection intensity of the task. Valid values:
|
2 |
| StartTime |
integer |
The start time of the task. The value is a millisecond timestamp (Unix epoch in milliseconds). If the task has not started, the value is null. |
1735689600000 |
| ScannerTaskStatus |
string |
The current status of the task. Valid values:
|
completed |
| TaskName |
string |
The name of the task. If no name is specified during creation, the default value is Target Scan - target name. |
Target Scan - My Model Studio target |
| ScannerTaskId |
string |
The unique identifier of the scan task. It can be used to download results and track status. |
task-abc123def4567 |
| TotalCaseCount |
integer |
The total number of samples planned to be executed for the task. |
120 |
| ScanType |
string |
The scan mode of the task. For historical tasks that do not have a recorded scan mode, the value is normalized to attack. Valid values:
|
attack |
| SampleLanguage |
string |
The sample language. Valid values:
|
zh |
| ReportLanguage |
string |
The report language. Valid values:
|
zh |
| ScannerType |
string |
The actual execution mode used by the scan task, which is obtained from the scannerType field of the task. classic indicates the sample mode. agent indicates the autonomous multi-round attack mode of the agent. executor is a historical compatibility value, which is equivalent to classic. Valid values:
|
classic |
Examples
Success response
JSON format
{
"RequestId": "1EBD0C05-6C1F-4C95-9C63-B7AB7B5A9C8E",
"TotalCount": 42,
"PageSize": 10,
"PageNumber": 1,
"Data": [
{
"EndTime": 1735689600000,
"ExecuteCaseCount": 80,
"CreateTime": 1735689600000,
"ScannerTaskMessage": "Execution timed out",
"RiskLevel": "high",
"SampleLevel": 2,
"StartTime": 1735689600000,
"ScannerTaskStatus": "completed",
"TaskName": "Target Scan - MyModelTarget",
"ScannerTaskId": "task-abc123def4567",
"TotalCaseCount": 120,
"ScanType": "attack",
"SampleLanguage": "zh",
"ReportLanguage": "zh",
"ScannerType": "classic"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.