
# 创建扫描任务 - CreateManualImageScanTask
#### 功能介绍
创建扫描任务。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-hss2.0/hss_02_0007.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-hss2.0/hss_02_0022.html)。
- 如果使用身份策略授权，当前API调用无需身份策略权限。
 
#### URI
POST /v5/{project_id}/image/image-scan/tasks
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释**: 项目ID，用于明确项目归属，配置后可通过该ID查询项目下资产。获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-hss2.0/hss_02_0024.html)。 **约束限制**: 不涉及 **取值范围**: 字符长度1-256位 **默认取值**: 不涉及 |
   
表2Query参数 
| 参数                    | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| enterprise_project_id | 否    | String | **参数解释**: 企业项目ID，用于过滤不同企业项目下的资产。获取方式请参见[获取企业项目ID](https://support.huaweicloud.com/api-hss2.0/hss_02_0027.html)。 如需查询所有企业项目下的资产请传参"all_granted_eps"。 **约束限制**: 开通企业项目功能后才需要配置企业项目ID参数。 **取值范围**: 字符长度1-256位 **默认取值**: 0，表示默认企业项目（default）。                                                                                                                          |
| global_image_type     | 否    | String | **参数解释**: 镜像类型 **约束限制**: 不涉及 **取值范围**: - local：本地镜像。   - registry：仓库镜像。    **默认取值**: registry |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释**: 用户Token，包含了用户的身份、权限等信息，在调用API接口时，可通过Token进行身份认证。获取方式请参见[获取用户Token](https://support.huaweicloud.com/api-hss2.0/hss_02_0009.html)。 **约束限制**: 不涉及 **取值范围**: 字符长度1-32768位 **默认取值**: 不涉及 |
| region       | 否    | String | **参数解释**: 区域ID，用于查询目的区域内的资产。获取方式请参见[获取区域ID](https://support.huaweicloud.com/api-hss2.0/hss_02_0026.html)。 **约束限制**: 不涉及 **取值范围**: 字符长度1-128位 **默认取值**: 不涉及                                    |
   
表4请求Body参数 
| 参数         | 是否必选 | 参数类型                                                                          | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| scan_scope | 否    | Integer                                                                       | **参数解释**: 扫描风险类型 **约束限制**: 不涉及 **取值范围**: - 0：none。   - 0x7fffffff：全部。   - 0x000f0000：漏洞。   - 0x0000f000：基线检查。   - 0x00000f00：恶意文件。   - 0x000000f0：敏感信息。   - 0x0000000f：软件合规。    **默认取值**: 不涉及 |
| rate_limit | 否    | Integer                                                                       | **参数解释**: 三方镜像仓扫描限速,其他镜像仓不生效 单位：个/h **约束限制**: 不涉及 **取值范围**: 0-1000，0表示不限制。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| is_all     | 否    | Boolean                                                                       | **参数解释**: 扫描全部镜像 **约束限制**: 不涉及 **取值范围**: - true：扫描全部镜像。支持全部镜像扫描或者指定镜像仓类型扫描，若为指定镜像仓类型扫描，需要填写query_info的image_type类型。   - false：指定镜像扫描,需要填写详细的镜像信息image_info字段。    **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| query_info | 否    | [query_info] object           | 按照查询结果扫描                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| image_info | 否    | Array of [image_info] objects | **参数解释**: 待扫描镜像，is_all为false需要填写； 若为仓库镜像，需要填写id，image_digest，namespace，image_name，image_version，image_version，registry_id，registry_name，registry_type，若为企业镜像，需要填写instance_id 若为本地镜像，需要填写image_id，image_name，image_version，registry_id，registry_name，registry_type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   
 表5query_info 
| 参数                       | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| local_image_type         | 否    | String  | **参数解释**: 本地镜像类型 **约束限制**: 不涉及 **取值范围**: - swr_image：swr镜像。   - other_image：其他镜像。    **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| host_id                  | 否    | String  | **参数解释**: 服务器ID **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| host_name                | 否    | String  | **参数解释**: 服务器名称 **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| public_ip                | 否    | String  | **参数解释**: 服务器公网IP **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| private_ip               | 否    | String  | **参数解释**: 私有IP地址 **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| cluster_id               | 否    | String  | **参数解释**: 集群id **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| container_id             | 否    | String  | **参数解释**: 容器id **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| container_name           | 否    | String  | **参数解释**: 容器名称 **约束限制**: 不涉及 **取值范围**: 字符长度0-128位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| pod_id                   | 否    | String  | **参数解释**: pod id **约束限制**: 不涉及 **取值范围**: 字符长度0-64位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| pod_name                 | 否    | String  | **参数解释**: pod 名称 **约束限制**: 不涉及 **取值范围**: 字符长度0-512位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| app_name                 | 否    | String  | **参数解释**: 软件名称 **约束限制**: 不涉及 **取值范围**: 字符长度0-256位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| has_vul                  | 否    | Boolean | **参数解释**: 是否存在软件漏洞 **约束限制**: 不涉及 **取值范围**: - true：存在软件漏洞。   - false：不存在软件漏洞。    **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| namespace                | 否    | String  | **参数解释**: 组织名称 **约束限制**: 不涉及 **取值范围**: 字符长度0-256位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| image_name               | 否    | String  | **参数解释**: 镜像名称 **约束限制**: 不涉及 **取值范围**: 字符长度0-256位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| image_version            | 否    | String  | **参数解释**: 镜像版本 **约束限制**: 不涉及 **取值范围**: 字符长度0-256位。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| image_type               | 否    | String  | **参数解释**: 镜像类型 **约束限制**: 不涉及 **取值范围**: - private_image：SWR私有镜像仓库。   - shared_image：SWR共享镜像仓库。   - instance_image：SWR企业仓库。   - harbor：harbor仓库。   - jfrog：jfrog仓库。    **默认取值**: 不涉及                                                                                                                                                |
| scan_status              | 否    | String  | **参数解释**: 扫描状态 **约束限制**: 不涉及 **取值范围**: - unscan：未扫描   - success：扫描完成   - scanning：扫描中   - failed：扫描失败   - download_failed：下载失败   - image_oversized：镜像超大    **默认取值**: 不涉及 |
| image_size               | 否    | Long    | **参数解释**: 镜像大小 **约束限制**: 不涉及 **取值范围**: 0-9223372036854775807。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| start_latest_update_time | 否    | Long    | **参数解释**: 创建时间开始日期，时间单位 毫秒（ms） **约束限制**: 不涉及 **取值范围**: 0-9223372036854775807。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| end_latest_update_time   | 否    | Long    | **参数解释**: 创建时间结束日期，时间单位 毫秒（ms） **约束限制**: 不涉及 **取值范围**: 0-9223372036854775807。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| start_latest_scan_time   | 否    | Long    | **参数解释**: 最近一次扫描完成时间开始日期，时间单位 毫秒（ms） **约束限制**: 不涉及 **取值范围**: 0-9223372036854775807。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| end_latest_scan_time     | 否    | Long    | **参数解释**: 最近一次扫描完成时间结束日期，时间单位 毫秒（ms） **约束限制**: 不涉及 **取值范围**: 0-9223372036854775807。 **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
 表6image_info 
| 参数            | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|:---|
| id            | 否    | Long   | id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| image_id      | 否    | String | image id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| image_digest  | 否    | String | 镜像digest                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| registry_id   | 否    | String | 镜像仓库ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| registry_name | 否    | String | 镜像仓库名称                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| image_name    | 否    | String | 镜像名称                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| image_version | 否    | String | 镜像版本                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| namespace     | 否    | String | 命名空间                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| instance_id   | 否    | String | 企业实例ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| instance_url  | 否    | String | 下载企业镜像URL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| registry_type | 否    | String | **参数解释**: 镜像仓库类型 **约束限制**: 不涉及 **取值范围**: - SwrPrivate：swr私有。   - SwrShared：swr共享。   - SwrEnterprise：swr企业。   - Harbor：harbor仓库。   - Jfrog：jfrog仓库。   - Other：其他仓库。   - Local：本地镜像    **默认取值**: 不涉及 |
   
#### 响应参数
**状态码：200**
请求已成功
无
#### 请求示例
```
{
  "scan_scope" : 2147483647,
  "rate_limit" : 1,
  "is_all" : true,
  "query_info" : {
    "local_image_type" : "swr_image",
    "host_id" : "xxx",
    "host_name" : "xxxx",
    "public_ip" : "xxxx",
    "private_ip" : "xxxx",
    "cluster_id" : "xxxx",
    "container_id" : "xxxx",
    "container_name" : "xxx",
    "pod_id" : "xxx",
    "pod_name" : "xxx",
    "app_name" : "xxx",
    "has_vul" : true,
    "namespace" : "xxxxx",
    "image_name" : "xxx",
    "image_version" : "xxx",
    "image_type" : "private_image",
    "scan_status" : "unscan",
    "start_latest_update_time" : 1,
    "end_latest_update_time" : 1,
    "start_latest_scan_time" : 1,
    "end_latest_scan_time" : 1
  },
  "image_info" : [ {
    "id" : 1111,
    "image_id" : "xxx",
    "image_digest" : "xxxx",
    "registry_id" : "xxxx",
    "registry_name" : "xxxx",
    "image_name" : "xxxx",
    "image_version" : "xxxx",
    "namespace" : "xxxx",
    "instance_id" : "xxxx",
    "instance_url" : "xxxx",
    "registry_type" : "SwrPrivate"
  } ]
}
```
#### 响应示例
无
#### SDK代码示例
SDK代码示例如下。
- [Java]
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.hss.v5.region.HssRegion;
  import com.huaweicloud.sdk.hss.v5.*;
  import com.huaweicloud.sdk.hss.v5.model.*;
  import java.util.List;
  import java.util.ArrayList;
  public class CreateManualImageScanTaskSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          String projectId = "{project_id}";
          ICredential auth = new BasicCredentials()
                  .withProjectId(projectId)
                  .withAk(ak)
                  .withSk(sk);
          HssClient client = HssClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(HssRegion.valueOf("<YOUR REGION>"))
                  .build();
          CreateManualImageScanTaskRequest request = new CreateManualImageScanTaskRequest();
          CreateManualImageScanTaskReqInfo body = new CreateManualImageScanTaskReqInfo();
          List<CreateManualImageScanTaskReqInfoImageInfo> listbodyImageInfo = new ArrayList<>();
          listbodyImageInfo.add(
              new CreateManualImageScanTaskReqInfoImageInfo()
                  .withId(1111L)
                  .withImageId("xxx")
                  .withImageDigest("xxxx")
                  .withRegistryId("xxxx")
                  .withRegistryName("xxxx")
                  .withImageName("xxxx")
                  .withImageVersion("xxxx")
                  .withNamespace("xxxx")
                  .withInstanceId("xxxx")
                  .withInstanceUrl("xxxx")
                  .withRegistryType("SwrPrivate")
          );
          CreateManualImageScanTaskReqInfoQueryInfo queryInfobody = new CreateManualImageScanTaskReqInfoQueryInfo();
          queryInfobody.withLocalImageType("swr_image")
              .withHostId("xxx")
              .withHostName("xxxx")
              .withPublicIp("xxxx")
              .withPrivateIp("xxxx")
              .withClusterId("xxxx")
              .withContainerId("xxxx")
              .withContainerName("xxx")
              .withPodId("xxx")
              .withPodName("xxx")
              .withAppName("xxx")
              .withHasVul(true)
              .withNamespace("xxxxx")
              .withImageName("xxx")
              .withImageVersion("xxx")
              .withImageType("private_image")
              .withScanStatus("unscan")
              .withStartLatestUpdateTime(1L)
              .withEndLatestUpdateTime(1L)
              .withStartLatestScanTime(1L)
              .withEndLatestScanTime(1L);
          body.withImageInfo(listbodyImageInfo);
          body.withQueryInfo(queryInfobody);
          body.withIsAll(true);
          body.withRateLimit(1);
          body.withScanScope(2147483647);
          request.withBody(body);
          try {
              CreateManualImageScanTaskResponse response = client.createManualImageScanTask(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdkhss.v5.region.hss_region import HssRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdkhss.v5 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      projectId = "{project_id}"
      credentials = BasicCredentials(ak, sk, projectId)
      client = HssClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(HssRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = CreateManualImageScanTaskRequest()
          listImageInfobody = [
              CreateManualImageScanTaskReqInfoImageInfo(
                  id=1111,
                  image_id="xxx",
                  image_digest="xxxx",
                  registry_id="xxxx",
                  registry_name="xxxx",
                  image_name="xxxx",
                  image_version="xxxx",
                  namespace="xxxx",
                  instance_id="xxxx",
                  instance_url="xxxx",
                  registry_type="SwrPrivate"
              )
          ]
          queryInfobody = CreateManualImageScanTaskReqInfoQueryInfo(
              local_image_type="swr_image",
              host_id="xxx",
              host_name="xxxx",
              public_ip="xxxx",
              private_ip="xxxx",
              cluster_id="xxxx",
              container_id="xxxx",
              container_name="xxx",
              pod_id="xxx",
              pod_name="xxx",
              app_name="xxx",
              has_vul=True,
              namespace="xxxxx",
              image_name="xxx",
              image_version="xxx",
              image_type="private_image",
              scan_status="unscan",
              start_latest_update_time=1,
              end_latest_update_time=1,
              start_latest_scan_time=1,
              end_latest_scan_time=1
          )
          request.body = CreateManualImageScanTaskReqInfo(
              image_info=listImageInfobody,
              query_info=queryInfobody,
              is_all=True,
              rate_limit=1,
              scan_scope=2147483647
          )
          response = client.create_manual_image_scan_task(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      hss "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      projectId := "{project_id}"
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          WithProjectId(projectId).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := hss.HssClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := hss.NewHssClient(hcClient)
      request := &model.CreateManualImageScanTaskRequest{}
  idImageInfo:= int64(1111)
  imageIdImageInfo:= "xxx"
  imageDigestImageInfo:= "xxxx"
  registryIdImageInfo:= "xxxx"
  registryNameImageInfo:= "xxxx"
  imageNameImageInfo:= "xxxx"
  imageVersionImageInfo:= "xxxx"
  namespaceImageInfo:= "xxxx"
  instanceIdImageInfo:= "xxxx"
  instanceUrlImageInfo:= "xxxx"
  registryTypeImageInfo:= "SwrPrivate"
  var listImageInfobody = []model.CreateManualImageScanTaskReqInfoImageInfo{
          {
              Id: &idImageInfo,
              ImageId: &imageIdImageInfo,
              ImageDigest: &imageDigestImageInfo,
              RegistryId: &registryIdImageInfo,
              RegistryName: &registryNameImageInfo,
              ImageName: &imageNameImageInfo,
              ImageVersion: &imageVersionImageInfo,
              Namespace: &namespaceImageInfo,
              InstanceId: &instanceIdImageInfo,
              InstanceUrl: &instanceUrlImageInfo,
              RegistryType: &registryTypeImageInfo,
          },
      }
  localImageTypeQueryInfo:= "swr_image"
  hostIdQueryInfo:= "xxx"
  hostNameQueryInfo:= "xxxx"
  publicIpQueryInfo:= "xxxx"
  privateIpQueryInfo:= "xxxx"
  clusterIdQueryInfo:= "xxxx"
  containerIdQueryInfo:= "xxxx"
  containerNameQueryInfo:= "xxx"
  podIdQueryInfo:= "xxx"
  podNameQueryInfo:= "xxx"
  appNameQueryInfo:= "xxx"
  hasVulQueryInfo:= true
  namespaceQueryInfo:= "xxxxx"
  imageNameQueryInfo:= "xxx"
  imageVersionQueryInfo:= "xxx"
  imageTypeQueryInfo:= "private_image"
  scanStatusQueryInfo:= "unscan"
  startLatestUpdateTimeQueryInfo:= int64(1)
  endLatestUpdateTimeQueryInfo:= int64(1)
  startLatestScanTimeQueryInfo:= int64(1)
  endLatestScanTimeQueryInfo:= int64(1)
  queryInfobody := &model.CreateManualImageScanTaskReqInfoQueryInfo{
  LocalImageType: &localImageTypeQueryInfo,
  HostId: &hostIdQueryInfo,
  HostName: &hostNameQueryInfo,
  PublicIp: &publicIpQueryInfo,
  PrivateIp: &privateIpQueryInfo,
  ClusterId: &clusterIdQueryInfo,
  ContainerId: &containerIdQueryInfo,
  ContainerName: &containerNameQueryInfo,
  PodId: &podIdQueryInfo,
  PodName: &podNameQueryInfo,
  AppName: &appNameQueryInfo,
  HasVul: &hasVulQueryInfo,
  Namespace: &namespaceQueryInfo,
  ImageName: &imageNameQueryInfo,
  ImageVersion: &imageVersionQueryInfo,
  ImageType: &imageTypeQueryInfo,
  ScanStatus: &scanStatusQueryInfo,
  StartLatestUpdateTime: &startLatestUpdateTimeQueryInfo,
  EndLatestUpdateTime: &endLatestUpdateTimeQueryInfo,
  StartLatestScanTime: &startLatestScanTimeQueryInfo,
  EndLatestScanTime: &endLatestScanTimeQueryInfo,
  }
  isAllCreateManualImageScanTaskReqInfo:= true
  rateLimitCreateManualImageScanTaskReqInfo:= int32(1)
  scanScopeCreateManualImageScanTaskReqInfo:= int32(2147483647)
  request.Body = &model.CreateManualImageScanTaskReqInfo{
  ImageInfo: &listImageInfobody,
  QueryInfo: queryInfobody,
  IsAll: &isAllCreateManualImageScanTaskReqInfo,
  RateLimit: &rateLimitCreateManualImageScanTaskReqInfo,
  ScanScope: &scanScopeCreateManualImageScanTaskReqInfo,
  }
  response, err := client.CreateManualImageScanTask(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/HSS/sdk?api=CreateManualImageScanTask&version=v5)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述    |
|:---|:---|
| 200 | 请求已成功 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-hss2.0/ErrorCode.html)。
