Updated on 2025-09-08 GMT+08:00

Exporting Asset Fingerprints

Function

This API is used to export asset fingerprints.

Calling Method

For details, see Calling APIs.

URI

POST /v5/{project_id}/asset/export

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.

asset_type

Yes

String

Definition

Asset fingerprint type.

Constraints

N/A

Range

  • users: account

  • auto_launch: auto-started item

  • database: database

  • jar_package: middleware

  • port: open port

  • process: process

  • web_cms: web application

  • web_framework: web framework

  • web_service: web service

  • web_site: website

  • app: software

  • kernel_module: kernel module

Default Value

N/A

category

Yes

String

Definition

Category

Constraints

N/A

Range

  • host

  • container

Default Value

host

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

search_param

No

String

Definition

Query condition. The value is a string in JSON format. Example: {"port_string": "8080"}

Constraints

The request parameters of the following interfaces are in JSON format:

  • users: /v5/{project_id}/asset/users

  • auto_launch: /v5/{project_id}/asset/auto-launchs

  • database: /v5/{project_id}/asset/web-app-and-services

  • jar_package: /v5/{project_id}/asset/midwares/detail

  • port: /v5/{project_id}/asset/ports/detail

  • process: /v5/{project_id}/asset/processes/detail

  • web_cms: /v5/{project_id}/asset/web-app-and-services

  • web_framework: /v5/{project_id}/asset/host/web-framework

  • web_service: /v5/{project_id}/asset/web-app-and-services

  • web_site: /v5/{project_id}/asset/host/web-site

  • app: /v5/{project_id}/asset/apps

  • kernel_module: /v5/{project_id}/asset/host/kernel-module

Range

Length: 0 to 128 characters

Default Value

N/A

export_headers

Yes

Array of ExportHead objects

Definition

Export data table header details.

Constraints

The table header information must be in the following format: [[Field1,ColumnHeader1],[Field2,ColumnHeader2],[Field3,ColumnHeader3]]

Range

You can select some or all of the following values to form the table header information:

All assets have the following fields:

  • host_name: server name

  • host_ip: server IP address

  • users

  • user_name: username

  • login_permission: whether the user has the login permission

  • root_permission: whether the user has the root permission

  • user_group_name: user group

  • user_home_dir: user directory

  • shell: user startup shell

  • recent_scan_time: last scan time

  • first_scan_time: first scan time

  • container_id: container ID

  • container_name: container name

  • auto_launch

  • name: name

  • type: type

  • path: file path

  • hash: file hash

  • run_user: The user who runs it.

  • recent_scan_time: last scan time

  • container_id: container ID

  • container_name: container name

  • database

  • web_cms

  • web_service

  • name: software name

  • version: software version

  • install_path: installation path

  • config_path: configuration file path

  • uid: user ID

  • mode: software file permission

  • pid: software process ID

  • proc_path: software process path

  • record_time: scan time

  • container_id: container ID

  • container_name: container name

  • jar_package

  • name: name

  • file_name: file name

  • catalogue: category

  • file_type: file type

  • version: version

  • path: file path

  • hash: file hash

  • uid: user ID

  • gid: user group ID

  • mode: file permission

  • pid: process ID.

  • proc_path: process path

  • is_embedded: whether the JAR package is an inner-layer JAR package

  • package_path: path of the outer JAR package

  • record_time: scan time

  • container_id: container ID

  • container_name: container name

  • port

  • port_status: whether the port needs to be processed

  • port: port number

  • type: type

  • pid: process ID

  • path: program file path

  • laddr: listening IP address

  • container_id: container ID

  • container_name: container name

  • process

  • process_path: process path

  • launch_params: startup parameter

  • launch_time: start time

  • user_name: The user who runs it.

  • run_permission: execution permission

  • process_pid: process ID

  • hash: file hash

  • container_id: container ID

  • container_name: container name

  • web_framework

  • name: name

  • file_name: file name

  • catalogue: category

  • file_type: file type

  • version: version

  • path: file path

  • hash: file hash

  • uid: user ID

  • gid: user group ID

  • mode: file permission

  • pid: process ID

  • proc_path: process path

  • record_time: scan time

  • container_id: container ID

  • container_name: container name

  • web_site

  • domain: external domain name

  • port: external port number

  • url_path: URL path

  • path: web directory

  • mode: web directory file permission

  • uid: user ID

  • record_time: scan time

  • is_https: whether HTTPS is used

  • pid: process ID

  • cert_issuer: SSL certificate issuer

  • cert_user: SSL certificate user

  • cert_issue_time: SSL certificate issue time

  • cert_expired_time: SSL certificate expiration time

  • container_id: container ID

  • container_name: container name

  • app

  • app_name: software name

  • version: version number

  • update_time: update time

  • recent_scan_time: last scan time

  • container_id: container ID

  • container_name: container name

  • kernel_module

  • name: name

  • version: version

  • srcversion: source code version

  • desc: description

  • path: file path

  • size: file size

  • mode: file permission

  • uid: user ID

  • ctime: file creation time

  • mtime: last modification time

  • hash: file hash

  • record_time: scan time

Fields specific to other asset categories:

Default Value

N/A

Table 5 ExportHead

Parameter

Mandatory

Type

Description

[items]

No

Array of strings

Definition

Export data table header details.

Constraints

The table header information must be in the following format: [[Field 1, Display name of table header 1], [Field 2, Display name of table header 2], [Field 3, Display name of table header 3]]

Range

You can select some or all of the following values to form the table header information. All assets have the following fields:

  • host_name: server name

  • host_ip: server IP address. This field is specific to other asset types.

  • users

  • user_name: username

  • login_permission: Whether the user has the login permission.

  • root_permission: Whether the user has the root permission.

  • user_group_name: user group

  • user_home_dir: user directory

  • shell: user startup shell

  • recent_scan_time: last scan time

  • first_scan_time: first scan time

  • container_id: container ID

  • container_name: container name

  • auto_launch

  • name: name

  • type: type

  • path: file path

  • hash: file hash

  • run_user: The user who runs it.

  • recent_scan_time: last scan time

  • container_id: container ID

  • container_name: container name

  • database

  • web_cms

  • web_service

  • name: software name

  • version: software version

  • install_path: installation path

  • config_path: configuration file path

  • uid: user ID

  • mode: software file permission

  • pid: software process ID

  • proc_path: software process path

  • record_time: scan time

  • container_id: container ID

  • container_name: container name

  • jar_package

  • name: name

  • file_name: file name

  • catalogue: category

  • file_type: file type

  • version: version

  • path: file path

  • hash: file hash

  • uid: user ID

  • gid: user group ID

  • mode: file permission

  • pid: process ID

  • proc_path: process path

  • is_embedded: Whether the package is an inner JAR package.

  • package_path: path of the outer JAR package

  • record_time: scan time

  • container_id: container ID

  • container_name: container name

  • port

  • port_status: Whether the port needs to be processed.

  • port: port number

  • type: type

  • pid: process ID

  • path: program file path

  • laddr: listening IP address

  • container_id: container ID

  • container_name: container name

  • process

  • process_path: process path

  • launch_params: startup parameter

  • launch_time: start time

  • user_name: The user who runs it.

  • run_permission: execution permission

  • process_pid: process ID

  • hash: file hash

  • container_id: container ID

  • container_name: container name

  • web_framework

  • name: name

  • file_name: file name

  • catalogue: category

  • file_type: file type

  • version: version

  • path: file path

  • hash: file hash

  • uid: user ID

  • gid: user group ID

  • mode: file permission

  • pid: process ID

  • proc_path: process path

  • record_time: scan time

  • container_id: container ID

  • container_name: container name

  • web_site

  • domain: external domain name

  • port: external port number

  • url_path: URL path

  • path: web directory

  • mode: web directory file permission

  • uid: user ID

  • record_time: scan time

  • is_https: Whether HTTPS is used.

  • pid: process ID

  • cert_issuer: SSL certificate issuer

  • cert_user: SSL certificate user

  • cert_issue_time: SSL certificate issue time

  • cert_expired_time: SSL certificate expiration time

  • container_id: container ID

  • container_name: container name

  • app

  • app_name: software name

  • version: version number

  • update_time: update time

  • recent_scan_time: last scan time

  • container_id: container ID

  • container_name: container name

  • kernel_module

  • name: name

  • version: version

  • srcversion: source code version

  • desc: description

  • path: file path

  • size: file size

  • mode: file permission

  • uid: user ID

  • ctime: file creation time

  • mtime: last modification time

  • hash: file hash

  • record_time: scan time

Default Value

N/A

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

None

Example Responses

None

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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.*;


public class DownloadAssetFileSolution {

    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();
        DownloadAssetFileRequest request = new DownloadAssetFileRequest();
        DownloadAssetFileRequestBody body = new DownloadAssetFileRequestBody();
        request.withBody(body);
        try {
            DownloadAssetFileResponse response = client.downloadAssetFile(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());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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 = DownloadAssetFileRequest()
        request.body = DownloadAssetFileRequestBody(
        )
        response = client.download_asset_file(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := hss.NewHssClient(
        hss.HssClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.DownloadAssetFileRequest{}
	request.Body = &model.DownloadAssetFileRequestBody{
	}
	response, err := client.DownloadAssetFile(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.