Obtaining Jobs
Function
This API is used to obtain the job 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
POST /v5/{project_id}/common/tasks/batch-query
| 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. |
| offset | No | 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 The default value is 0. |
| limit | No | Integer | Definition Number of records displayed on each page. Constraints N/A Range Value range: 10-200 Default Value 10 |
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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| task_type | Yes | String | Task type. The options are as follows: |
| task_id | No | String | ID of the created task. |
| task_name | No | String | Fuzzy match task name |
| start_create_time | No | Long | Start time of the query by task creation time range. |
| end_create_time | No | Long | End time of the query by task creation time range. |
| trigger_type | No | String | Task triggering type. The options are as follows: |
| task_status | No | String | Task status. The options are as follows: |
| sort_key | No | String | Sorting fields. The options are as follows: |
| sort_dir | No | String | Sorting method. The options are as follows: |
| cluster_scan_info | No | cluster_scan_info object | A cluster scan task parameter. This parameter can be specified if task_type is set to cluster_scan. |
| iac_scan_info | No | iac_scan_info object | Parameter of the IAC security scanning task. This parameter can be transferred when task_type is set to iac_scan. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| scan_type_list | No | Array of strings | Definition List of scan item types in a task. If the list is specified, only the tasks that scan all the specified items will be filtered. If the list is left blank, scan item types are not filtered. Constraints N/A Range Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total_num | Integer | Number of tasks in the task list |
| data_list | Array of data_list objects | Task List |
| Parameter | Type | Description |
|---|---|---|
| task_id | String | ID of the created task. |
| task_type | String | Task type. The options are as follows: |
| task_name | String | Task name |
| trigger_type | String | Task triggering type. The options are as follows: |
| task_status | String | Task status. The options are as follows: |
| start_time | Long | Specifies the time when a task starts. |
| end_time | Long | Time when a job ended. |
| estimated_time | Integer | Estimated remaining time required for ending the current task, in minutes. |
| cluster_scan_info | cluster_scan_info object | Task information specific to cluster scanning tasks |
| iac_scan_info | iac_scan_info object | Task information specific to the IAC security scanning task. |
| Parameter | Type | Description |
|---|---|---|
| scan_type_list | Array of strings | Scan item types involved in the scan job |
| scanning_cluster_num | Integer | Number of clusters that are being scanned in the current task. |
| success_cluster_num | Integer | Number of clusters that are successfully scanned in the current task. |
| failed_cluster_num | Integer | Number of clusters that fail to be scanned in the current task. |
| Parameter | Type | Description |
|---|---|---|
| file_type | String | File type. The options are as follows: |
| scan_file_num | Integer | Total number of files scanned by the current task. |
| success_file_num | Integer | Number of files that are successfully scanned in the current task. |
| failed_file_num | Integer | Number of files that fail to be scanned in the current task. |
Example Requests
Query all the cluster scan tasks whose project_id is 2b31ed520xxxxxxebedb6e57xxxxxxxx.
POST https://{endpoint}/v5/2b31ed520xxxxxxebedb6e57xxxxxxxx/common/tasks/batch-query?enterprise_project_id=all_granted_eps
{
"task_type" : "cluster_scan"
} Example Responses
Status code: 200
Request succeeded.
{
"total_num" : 1,
"data_list" : [ {
"task_id" : "d8xxxx05-8xx5-4xx0-9xx6-c3dbxxxxxxac",
"task_type" : "cluster_scan",
"trigger_type" : "manual",
"task_status" : "running",
"start_time" : 1745311451000,
"end_time" : 1745311451000,
"estimated_time" : 5,
"cluster_scan_info" : {
"scan_type_list" : [ "cluster_vul" ],
"scanning_cluster_num" : 2,
"success_cluster_num" : 1,
"failed_cluster_num" : 1
}
} ]
} 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