Updated on 2026-04-03 GMT+08:00

Creating a Container Export Task

Function

This API is used to create a container export task.

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}/container/export-task

Table 1 Path Parameters

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

Table 2 Query Parameters

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.

export_size

No

Integer

Definition

Exported records

Constraints

N/A

Range

1-100000

Default Value

100000

Request Parameters

Table 3 Request header 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

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

cluster_container

No

Boolean

Definition

Whether the container is managed by a cluster. Set this parameter to true if only containers in a cluster are exported. Set this parameter to false if only non-cluster containers are exported.

Constraints

N/A

Range

The value can be "true" or "false".

Default Value

N/A

cluster_type

No

String

Definition

Cluster type.

Constraints

N/A

Range

  • cce: CCE cluster

  • ali: Alibaba Cloud cluster

  • tencent: Tencent Cloud cluster

    • azure: Microsoft Azure Cloud cluster

    • aws: AWS Cloud cluster

    • self_built_hw: customer-built cluster on Huawei Cloud

    • self_built_idc: IDC on-premises cluster

Default Value

N/A

cluster_name

No

String

Definition

Name of the cluster to which the audited source belongs.

Constraints

N/A

Range

The value contains 1 to 255 characters.

Default Value

N/A

container_name

No

String

Definition

Container name

Constraints

N/A

Range

The value contains 1 to 255 characters.

Default Value

N/A

pod_name

No

String

Definition

Pod name

Constraints

N/A

Range

The value can contain 1 to 512 characters.

Default Value

N/A

image_name

No

String

Definition

Image name.

Constraints

N/A

Range

The value contains 1 to 255 characters.

Default Value

N/A

status

No

String

Definition

Container status.

Constraints

N/A

Range

  • Running

  • Waiting

  • Terminated

  • Isolated

  • Paused

Default Value

N/A

risky

No

Boolean

Definition

Check whether there are security risks. If only containers with security risks are to be exported, set this parameter to true. If only containers without security risks are to be exported, set this parameter to false.

Constraints

N/A

Range

The value can be "true" or "false".

Default Value

N/A

create_time

No

create_time object

Created

cpu_limit

No

String

Definition

CPU limit

Constraints

N/A

Range

You can enter 0 to 64 characters. The unit is MB, for example, 100 MB.

Default Value

N/A

memory_limit

No

String

Definition

Memory limit.

Constraints

N/A

Range

You can enter 0 to 64 characters. The unit is Mi or Gi, for example, 300 Mi.

Default Value

N/A

export_headers

Yes

Array<Array<String>>

Definition

Export the header information of the container list.

Constraints

N/A

Range

Valid key values and their corresponding header names. (The header names can be customized.)

  • container_id: container ID

  • container_name: container name

  • image_name: image name

  • pod_name: pod

  • cluster_name: cluster

  • cluster_type: cluster type

  • status: status

  • risky: whether there are security risks

  • low_risk: low risk

  • medium_risk: medium risk

  • high_risk: high risk

  • fatal_risk: critical risk

  • create_time: creation time

  • restart_count: number of restarts

  • cpu_limit: CPU limit

  • memory_limit: memory limit

Default Value

N/A

Table 5 create_time

Parameter

Mandatory

Type

Description

start_time

No

Long

Screening start time

end_time

No

Long

Filtering termination time

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

task_id

String

Export task ID

Example Requests

Create a container export task.

{
  "export_headers" : [ [ "container_name", "Container Name" ], [ "image_name", "Image Name" ], [ "risky", "Security Risk" ] ]
}

Example Responses

Status code: 200

Request succeeded.

{
  "task_id" : "test"
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.