Viewing the Virus Scan Task List
Function
This API is used to view the virus scan task list.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v5/{project_id}/antivirus/task
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID. Constraints N/A Range The value can contain 1 to 256 characters. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
enterprise_project_id |
No |
String |
Definition Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID. To query assets in all enterprise projects, set this parameter to all_granted_eps. Constraints You need to set this parameter only after the enterprise project function is enabled. Range The value can contain 1 to 256 characters. Default Value 0: default enterprise project. |
|
task_name |
No |
String |
Definition Task Constraints N/A Range The value can contain 1 to 128 characters. Default Value N/A |
|
offset |
Yes |
Integer |
Definition Offset, which specifies the start position of the record to be returned. Constraints N/A Range The value range is 0 to 2,000,000. Default Value N/A |
|
limit |
Yes |
Integer |
Definition Number of records displayed on each page. Constraints N/A Range Value range: 10 to 200 Default Value 10 |
|
last_days |
No |
Integer |
Definition Query time range (days). Constraints This parameter is mutually exclusive with begin_time and end_time. They cannot be specified at the same time. If they are all specified, the setting of last_days will be applied. Range Minimum value: 1; maximum value: 90 (tasks in the last 90 days can be queried.) Default Value N/A |
|
begin_time |
No |
String |
Definition Start time of a customized filtering task. (The task start time is later than or equal to the end time.) Constraints This parameter is mutually exclusive with last_days. The parameters must be passed together with end_time, and the format must be valid. Range UTC time zone. The format is YYYY-MM-DD HH:MM:SS. Default Value N/A |
|
end_time |
No |
String |
Definition End time of a customized filtering task. (The task start time is less than or equal to the end time.) Constraints This parameter is mutually exclusive with last_days. The parameters must be transferred together with begin_time and not earlier than begin_time. Range UTC time zone. The format is YYYY-MM-DD HH:MM:SS. Default Value N/A |
|
task_status |
No |
String |
Definition Task status. Constraints N/A Range The options are as follows: Default Value N/A |
|
host_name |
No |
String |
Definition Server name. Constraints N/A Range The value contains 1 to 256 characters. Default Value N/A |
|
private_ip |
No |
String |
Definition Server private IP address. Constraints N/A Range The value can contain 1 to 128 characters. Default Value N/A |
|
public_ip |
No |
String |
Definition Server EIP. Constraints N/A Range For IPv4, the value contains 7 to 15 characters. For IPv6, the value contains 15 to 39 characters. Default Value None |
|
whether_paid_task |
Yes |
Boolean |
Definition Whether the scan task is paid. Constraints Mandatory. Only Boolean values can be specified. Range true (paid task), false (free task) Default Value N/A |
|
host_task_status |
No |
Array of strings |
Server scan status. Definition Server scan status Constraints N/A Range The options are as follows: Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token. Constraints N/A Range The value can contain 1 to 32,768 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total_num |
Integer |
Definition Total number. Range The value range is 0 to 2,147,483,647. |
|
data_list |
Array of AntiVirusTaskResponseInfo objects |
Definition List of details about the queried virus scan and removal tasks. Range The value ranges from 0 to 1000. |
|
Parameter |
Type |
Description |
|---|---|---|
|
task_id |
String |
Definition Task ID. Range The value can contain 1 to 64 characters. |
|
task_name |
String |
Definition Task Range Each tag value can contain a maximum of 255 Unicode characters. |
|
scan_type |
String |
Definition Job type Range Its value can be: |
|
start_type |
String |
Definition Startup mode. Range Its value can be: |
|
action |
String |
Definition Action Range |
|
start_time |
Integer |
Definition Attack Range The value ranges from 0 to 9223372036854775807. The time format is a timestamp (UTC time zone, starting from 1970-01-01 00:00:00), in milliseconds. |
|
task_status |
String |
Definition Task status. Range The options are as follows: |
|
host_num |
Integer |
Definition Associated servers. Range The value is a non-negative integer. The minimum value is 0. |
|
success_host_num |
Integer |
Definition Number of servers that are successfully scanned. Range The value is a non-negative integer. The minimum value is 0. |
|
fail_host_num |
Integer |
Definition Number of servers that fail to be scanned. Range The value is a non-negative integer. The minimum value is 0. |
|
cancel_host_num |
Integer |
Definition Number of servers where tasks are canceled. Range The value is a non-negative integer. The minimum value is 0. |
|
host_info_list |
Array of AntiVirusTaskHostResponseInfo objects |
Definition List of details about associated servers. Range The array can contain 0 to 10,000 elements. |
|
rescan |
Boolean |
Whether to rescan |
|
whether_paid_task |
Boolean |
Whether the scan task is paid. |
|
Parameter |
Type |
Description |
|---|---|---|
|
host_id |
String |
Definition Unique ID of a server (host). Range The value can contain 1 to 64 characters. |
|
host_name |
String |
Definition Server name. Range The value can contain 1 to 256 characters. |
|
private_ip |
String |
Definition Server private IP address. Range The value can contain 1 to 128 characters. |
|
public_ip |
String |
Definition Elastic IP Address (EIP) Range The value is a string of 1 to 256 characters and can be an IPv4 or IPv6 address. (An IPv4 address can contain 7 to 15 characters. An IPv6 address can contain 15 to 39 characters.) |
|
asset_value |
String |
Definition Asset importance. Range |
|
start_time |
Integer |
Definition Attack Range The value ranges from 0 to 9223372036854775807. The time format is a timestamp (UTC time zone, starting from 1970-01-01 00:00:00), in milliseconds. |
|
run_duration |
Integer |
Definition Running Duration Range The value is a non-negative integer. The minimum value is 0. Unit: s |
|
scan_progress |
String |
Definition Scan progress Range The value is a string in percentage (for example, 50%) or a numeric string in the range 0 to 100. |
|
virus_num |
Integer |
Definition Detected viruses Range The value is a non-negative integer. The minimum value is 0. |
|
scan_file_num |
Integer |
Definition Scanned files Range The value is a non-negative integer. The minimum value is 0. |
|
host_task_status |
String |
Definition Server scan status Range |
|
fail_reason |
String |
Definition Failure cause. Range The value can contain 0 to 512 characters. |
|
deleted |
Boolean |
Definition Delete {0} Range Its value can be: |
|
whether_using_quota |
Integer |
Definition Whether the pay-per-use virus scan quota is used. Range 0 (not used), 1 (used) |
|
agent_id |
String |
Definition Unique ID of the antivirus agent installed on a server, which is used to associate the server with the antivirus service. Constraints N/A Range The value can contain 1 to 64 characters. Default Value N/A |
|
os_type |
String |
Definition OS Type Range |
|
host_status |
String |
Definition Server status. Range |
|
agent_status |
String |
Definition Agent Status Range |
|
protect_status |
String |
Definition Protection status Range |
|
os_name |
String |
Definition OS name. Range The value can contain 0 to 128 characters. |
|
os_version |
String |
Definition System version Range The value contains 0 to 64 characters. |
Example Requests
None
Example Responses
Status code: 200
Request succeeded.
{
"total_num" : 126,
"data_list" : [ {
"task_id" : "291***af8-7ba2-4a39-9522-d1***2033db",
"task_name" : "Quick Scan-20250122155127",
"scan_type" : "quick",
"start_type" : "now",
"action" : "manual",
"start_time" : 1737532317458,
"task_status" : "scanning",
"host_num" : 1,
"success_host_num" : 0,
"fail_host_num" : 0,
"cancel_host_num" : 0,
"host_info_list" : [ {
"host_id" : "eedf8817-f486-4c4f-a395-b8373ecc7ef4",
"host_name" : "agentcompile-2",
"agent_id" : "5dd59023ad***02f9f43743dff3b8172**271ad36e5aedecf327119",
"private_ip" : "172.16.0.**",
"public_ip" : "100.85.219.**",
"asset_value" : "common",
"start_time" : 1737532317458,
"run_duration" : 0,
"scan_progress" : "0%",
"virus_num" : 4,
"scan_file_num" : 0,
"host_task_status" : "scanning",
"os_type" : "Linux",
"host_status" : "ACTIVE",
"agent_status" : "online",
"protect_status" : "opened",
"os_name" : "EulerOS",
"os_version" : "2.5",
"deleted" : false,
"whether_using_quota" : 0
} ],
"rescan" : false,
"whether_paid_task" : false
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot