tencent cloud

Submitting Virus Detection Job
Terakhir diperbarui:2025-12-09 15:57:18
Submitting Virus Detection Job
Terakhir diperbarui: 2025-12-09 15:57:18

Feature Description

The cloud virus detection feature uses an asynchronous request method. You can use this interface to detect viruses (such as Trojan viruses and worm viruses) in files on the cloud, then query the virus detection results through the query virus detection result interface.

Authorization Description

When used with a sub-account, the ci:CreateAuditingVirusJob permission is required. For details, see Cloud Infinite action.
When a sub-account uses an asynchronous processing interface, the cam:passrole permission is required. The asynchronous processing interface performs read and write operations on COS resources through CAM's "role". The PassRole permission is used for role passing. For details, refer to Access Management - Write Operation - PassRole API.

Activating a Service

Using this feature requires enabling Cloud Infinite in advance and binding a bucket. For details, see Binding a Bucket.

Use Limits

When using this API, please confirm the relevant restrictions first. For details, see Usage Limits.
Detection of files in archive storage type and deep archive storage type on COS is not supported. For such files, please first Restore Archived Files.
File size support: File < 1GB.
Supported file formats: EXE, DLL, SCR, SYS, MSI, SWF, JAR, APPLETJAR, JS, VBS, HTML, BAT, WSF, PS1, HTM, MHT, HTA, CHM, LNK, DOC, DOCX, DOTX, DOCM, DOTM, XLS, XLSX, XLSM, XLSB, XLTM, XLTX, XLAM, PPT, PPTX, POTX, PPSX, PPTM, POTM, PPSM, XML, RTF, PDF, ELF, MAC, VBE, 3DMAX, ISO, CPIO, RPM, XZ, DEB.
Support detecting compressed files, such as: zip, 7z, rar4, rar5, inno, cab, autoit, nsis, gz, tar, iso, mime, chm, jar, dmg, apk.

Fee Description

If a file belongs to the infrequent storage type on COS, calling detection will incur COS infrequent data retrieval fees.


Request

Request sample

POST /virus/detect HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml

<body>
Note:
Authorization: Auth String. For details, see Request Signature document.

Request header

This API only uses common request headers. For details, see Common Request Headers documentation.

Request body

The implementation of this request operation requires the following request body:
<Request>
<Input>
<Object></Object>
<Url></Url>
</Input>
<Conf>
<DetectType>Virus</DetectType>
<Callback></Callback>
</Conf>
</Request>
The data are described as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Request
None.
Virus detection configuration items.
Container
Yes
The specific data description of the Container type Request is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Input
Request
File information that needs to be detected.
Container
Yes
Conf
Request
Detection rule configuration.
Container
Yes
The specific data description of the Container type Input is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Object
Request.Input
The filename of a virus file stored in a COS storage bucket, for example, the file virus.doc in the directory test, then the filename is test/virus.doc.
Choose one of Object or Url.
String
Yes
Url
Request.Input
Link address of virus files, for example: http://examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/virus.doc
Choose one of Object or Url.
String
No
The specific data description of the Container type Conf is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
DetectType
Request.Conf
Detected virus type, currently fixed to: Virus.
String
Yes
Callback
Request.Conf
Detection results are callback notified to your set address, supporting addresses starting with http:// or https://, for example: http://www.callback.com.
String
No

Response

Response Headers

This API only returns the public response header. For details, see Common Response Headers documentation.

Response Body

The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<JobsDetail>
<JobId></JobId>
<State></State>
<CreationTime></CreationTime>
<Object></Object>
</JobsDetail>
</Response>
The data are as follows:
Node Name (Keyword)
Parent Node
Description
Type
Response
None.
The specific response content returned by virus detection.
Container
Container node Response content:
Node Name (Keyword)
Parent Node
Description
Type
JobsDetail
Response
Detailed information of the virus detection task.
Container
Content of the Container node JobsDetail:
Node Name (Keyword)
Parent Node
Description
Type
JobId
Response.JobsDetail
The task ID of this virus detection task.
String
State
Response.JobsDetail
Status of the virus detection task, which can be one of: Submitted (detection submitted), Success (detection succeeded), Failed (detection failed), Auditing (detection in progress).
String
CreationTime
Response.JobsDetail
Creation time of the virus detection task.
String
Object
Response.JobsDetail
Filename of this detection.
String

Error Codes

This request returns common error responses and error codes. For more information, see Error Codes.

Examples

Request

POST /virus/detect HTTP/1.1
Authorization: q-sign-algorithm=sha1&q-ak=**********************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=**************************************
Host: examplebucket-1250000000.ci.ap-beijing.myqcloud.com
Content-Length: 166
Content-Type: application/xml

<Request>
<Input>
<Object>a.doc</Object>
</Input>
<Conf>
<DetectType>Virus</DetectType>
<Callback>http://callback.com/</Callback>
</Conf>
</Request>


Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Thu, 15 Jun 2017 12:37:29 GMT
Server: tencent-ci
x-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****

<Response>
<JobsDetail>
<JobId>ssb1ca9fc8a3ed11ea834c525400863904</JobId>
<State>Submitted</State>
<CreationTime>2021-07-07T12:12:12+0800</CreationTime>
<Object>a.doc</Object>
</JobsDetail>
</Response>

Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
Ya
Tidak

masukan