All Products
Search
Document Center

Security Center:GetLastOnceTaskInfo

Last Updated:Jul 23, 2024

Queries information about the latest scan task to determine whether the task is complete.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TaskTypestringYes

The type of the task. Valid values:

  • CLIENT_PROBLEM_CHECK: client diagnosis task
  • CLIENT_DEV_OPS: O&M task of Cloud Assistant
  • ASSETS_COLLECTION: asset collection task
ASSETS_COLLECTION
TaskNamestringYes

The name of the task. Valid values:

  • CLIENT_PROBLEM_CHECK: client diagnosis task
  • CLIENT_DEV_OPS: O&M task of Cloud Assistant
  • ASSETS_COLLECTION: asset collection task
ASSETS_COLLECTION
SourcestringNo

The source of the task.

console_batch

Response parameters

ParameterTypeDescriptionExample
object
CollectTimelong

The time at which the task was run.

1671184531000
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

BE120DAB-F4E7-4C53-ADC3-A97578AB****
TotalCountinteger

The total number of entries returned.

44
TaskIdlong

The ID of the latest scan task.

3f65e1f1bb13118891a889d569a3****
FinishCountinteger

The number of tasks that have been completed.

67
TaskInfoobject

The information about the latest task.

Statusstring

The status of the task. Valid values:

  • INIT: The task is not started.
  • START: The task is started.
  • SUCCESS: The task is complete.
  • TIMEOUT: The task timed out.
SUCCESS
Progressinteger

The progress of the task in percentage.

69
Resultstring

The result of the scan task. Valid values:

  • SUCCESS: The task is successful.
  • TASK_NOT_SUPPORT_REGION: The images are deployed in a region that is not supported by container image scan.
  • TASK_NOT_EXISTS: The task does not exist.
SUCCESS

Examples

Sample success responses

JSONformat

{
  "CollectTime": 1671184531000,
  "RequestId": "BE120DAB-F4E7-4C53-ADC3-A97578AB****",
  "TotalCount": 44,
  "TaskId": 0,
  "FinishCount": 67,
  "TaskInfo": {
    "Status": "SUCCESS",
    "Progress": 69,
    "Result": "SUCCESS"
  }
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissioncaller has no permissionYou are not authorized to do this operation.
500ServerErrorServerError-

For a list of error codes, visit the Service error codes.