Feature Overview
This API is used to query the status or result of a virus detection task.
Requests
Sample Request
GET /virus/detect/<jobId> HTTP/1.1Host: <BucketName-APPID>.ci.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
Note
Request Header
Request Body
This request does not have a request body.
Response
Response Header
Response Body
The return of this response body is application/xml data. Below is an example containing all the node data:
<Response><JobsDetail><Code></Code><Message></Message><JobId></JobId><State></State><CreationTime></CreationTime><Object></Object><Suggestion></Suggestion><DetectDetail><Result><VirusName></VirusName></Result><Result><FileName></FileName><VirusName></VirusName></Result></DetectDetail></JobsDetail><RequestId></RequestId></Response>
The parameters are described as follows:
Node Name (Keyword) | Parent Node | Description | Local Disk Types |
Response | - | Virus detection task results. | Container |
Response has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
JobsDetail | Response | Virus detection job details | Container |
JobsDetail has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
Code | Response.JobsDetail | Error code, which is returned only if State is Failed | String |
Message | Response.JobsDetail | Error message, which is returned only if State is Failed | String |
JobId | Response.JobsDetail | Virus detection job ID. | String |
State | Response.JobsDetail | The status of the virus detection task can be one of the following values: Submitted (submitted for detection), Success (detection successful), Failed (detection failed), or Auditing (undergoing detection). | String |
CreationTime | Response.JobsDetail | Virus detection job creation time. | String |
Object | Response.JobsDetail | When the file being detected is stored in COS, this field represents the file name for this detection. | String |
Url | Response.JobsDetail | When the file being checked is a file link, this field indicates the file link for the current inspection. | String |
Suggestion | Response.JobsDetail | This field indicates the detection result of this judgment. You can perform subsequent operations based on the result. We recommend you handle different results according to your business needs. Valid values: normal (detection normal), block (file detected to contain a virus). | String |
DetectDetail | Response.JobsDetail | Detailed information of this detection. | Container Array |
Container node DetectDetail contains:
Node Name (Keyword) | Parent Node | Description | Local Disk Types |
Result | Response.JobsDetail.DetectDetail | A single file's detection results may contain multiple outcomes. | Array |
Contents of the Array node "Result":
Node Name (Keyword) | Parent Node | Description | Local Disk Types |
VirusName | Response.JobsDetail.DetectDetail.Result | Detected virus name. | String |
Error Codes
Examples
Requests
GET /virus/detect/ssb1ca9fc8a3ed11ea834c525400863904 HTTP/1.1Accept: */*Authorization: q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR**&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=28e9a4986df11bed0255e97ff90500557e0e**Host: examplebucket-1250000000.ci.ap-beijing.myqcloud.com
Response
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 666Connection: keep-aliveDate: Thu, 15 Jun 2017 12:37:29 GMTServer: tencent-cix-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****<Response><JobsDetail><Code>Success</Code><Message>Success</Message><JobId>ss364c726b370211ec8fb35254008618d9</JobId><State>Success</State><CreationTime>2021-07-07T12:12:12+0800</CreationTime><Object>a.doc</Object><Suggestion>block</Suggestion><DetectDetail><Result><FileName>xxx</FileName><VirusName>Bk.YDWebShell.Php.Small.11100752</VirusName></Result><Result><FileName>xxx</FileName><VirusName>Bk.YDWebShell.Php.Small.11100752</VirusName></Result></DetectDetail></JobsDetail></Response>