Help Center> SecMaster> API Reference> API> Alert Management> Searching for an Alert List
Updated on 2024-03-20 GMT+08:00

Searching for an Alert List

Function

Searching for an Alert List

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/workspaces/{workspace_id}/soc/alerts/search

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Minimum: 32

Maximum: 36

workspace_id

Yes

String

Workspace ID

Minimum: 32

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Minimum: 0

Maximum: 2097152

content-type

Yes

String

Content type.

Default: application/json;charset=UTF-8

Minimum: 0

Maximum: 64

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of records displayed on each page.

Minimum: 0

Maximum: 1000

offset

No

Integer

Offset

Minimum: 0

Maximum: 1000

sort_by

No

String

Sorting field -- create_time | update_time

Minimum: 0

Maximum: 1000

order

No

String

Sort by -- DESC | ASC

Minimum: 0

Maximum: 1000

Enumeration values:

  • DESC

  • ASC

from_date

No

String

Search start time, for example, 2023-02-20T00:00:00.000Z

Minimum: 0

Maximum: 64

to_date

No

String

Search end time, for example, 2023-02-27T23:59:59.999Z

Minimum: 0

Maximum: 64

condition

No

condition object

Search condition expression.

Table 4 condition

Parameter

Mandatory

Type

Description

conditions

No

Array of conditions objects

Expression list.

Array Length: 0 - 999

logics

No

Array of strings

Expression logic.

Minimum: 0

Maximum: 100

Array Length: 0 - 999

Table 5 conditions

Parameter

Mandatory

Type

Description

name

No

String

Expression name.

Minimum: 0

Maximum: 64

data

No

Array of strings

Expression content list.

Minimum: 0

Maximum: 100

Array Length: 0 - 999

Response Parameters

Status code: 200

Table 6 Response header parameters

Parameter

Type

Description

X-request-id

String

Request ID, in the format request_uuid-timestamp-hostname.

Table 7 Response body parameters

Parameter

Type

Description

code

String

Error code

Minimum: 0

Maximum: 64

message

String

Error Message

Minimum: 0

Maximum: 1024

total

Integer

Total number of alerts.

Minimum: 0

Maximum: 10000

limit

Integer

Number of records displayed on each page.

Minimum: 0

Maximum: 10000

offset

Integer

Offset

Minimum: 0

Maximum: 10000

success

Boolean

Successful or not.

data

Array of ListAlertDetail objects

Alert list.

Array Length: 0 - 10000

Table 8 ListAlertDetail

Parameter

Type

Description

data_object

ListAlertRsp object

Alert details.

create_time

String

Create time

Minimum: 0

Maximum: 64

update_time

String

Update time

Minimum: 0

Maximum: 64

project_id

String

Id value

Minimum: 32

Maximum: 64

workspace_id

String

Id value

Minimum: 32

Maximum: 64

id

String

The name, display only

Minimum: 0

Maximum: 1024

type

String

The name, display only

Minimum: 0

Maximum: 1024

version

Integer

The name, display only

Minimum: 0

Maximum: 1024

format_version

Integer

The name, display only

Minimum: 0

Maximum: 1024

dataclass_ref

dataclass_ref object

Data class object.

Table 9 ListAlertRsp

Parameter

Type

Description

version

String

Version.

Minimum: 1

Maximum: 64

environment

environment object

Environment Info

data_source

data_source object

Data source.

first_observed_time

String

Update time

Minimum: 0

Maximum: 64

last_observed_time

String

Update time

Minimum: 0

Maximum: 64

create_time

String

Create time

Minimum: 0

Maximum: 64

arrive_time

String

Update time

Minimum: 0

Maximum: 64

title

String

The name, display only

Minimum: 0

Maximum: 1024

description

String

The description, display only

Minimum: 0

Maximum: 1024

source_url

String

Incident URL.

Minimum: 1

Maximum: 64

count

Integer

Incident occurrences

Minimum: 0

Maximum: 5

confidence

Integer

Confidence level

Minimum: 0

Maximum: 5

severity

String

Severity.

Minimum: 1

Maximum: 64

criticality

Integer

Criticality, which specifies the importance level of the resources involved in an incident.

Minimum: 0

Maximum: 5

alert_type

Object

Incident classification.

network_list

Array of network_list objects

network_list

Array Length: 0 - 100

resource_list

Array of resource_list objects

network_list

Array Length: 0 - 100

remediation

remediation object

Remedy measure.

verification_state

String

Verification Status

Minimum: 1

Maximum: 64

handle_status

String

Incident processing status.

Minimum: 1

Maximum: 64

sla

String

sla

Minimum: 0

Maximum: 65535

update_time

String

Create time

Minimum: 0

Maximum: 64

close_time

String

Create time

Minimum: 0

Maximum: 64

chop_phase

String

Period/Handling phase No.

Minimum: 4

Maximum: 64

ipdrr_phase

String

Period/Handling phase No.

Minimum: 4

Maximum: 64

ppdr_phase

String

Period/Handling phase No.

Minimum: 4

Maximum: 64

simulation

String

Whether it is a debugging incident.

Minimum: 0

Maximum: 64

actor

String

Client

Minimum: 0

Maximum: 64

owner

String

The name, display only

Minimum: 0

Maximum: 1024

creator

String

The name, display only

Minimum: 0

Maximum: 1024

close_reason

String

Closure Reason

Minimum: 32

Maximum: 64

close_comment

String

Closure Reason

Minimum: 0

Maximum: 64

malware

malware object

Malware

system_info

Object

System information.

process

Array of process objects

Process information.

Array Length: 0 - 100

user_info

Array of user_info objects

User Details

Array Length: 0 - 100

file_info

Array of file_info objects

File Information

Array Length: 0 - 100

system_alert_table

Object

System information.

id

String

Id value

Minimum: 32

Maximum: 64

workspace_id

String

workspace id

Minimum: 32

Maximum: 64

Table 10 environment

Parameter

Type

Description

vendor_type

String

The name, display only

Minimum: 0

Maximum: 1024

domain_id

String

Id value

Minimum: 32

Maximum: 64

region_id

String

Id value

Minimum: 1

Maximum: 64

project_id

String

Id value

Minimum: 32

Maximum: 64

Table 11 data_source

Parameter

Type

Description

source_type

Integer

current page count

Minimum: 0

Maximum: 9999

domain_id

String

Id value

Minimum: 32

Maximum: 64

project_id

String

Id value

Minimum: 32

Maximum: 64

region_id

String

Id value

Minimum: 1

Maximum: 64

Table 12 network_list

Parameter

Type

Description

direction

Object

Direction. The value can be IN or OUT.

protocol

String

Protocol. Example- IANA registered name.

Minimum: 1

Maximum: 64

src_ip

String

Source IP address

Minimum: 0

Maximum: 64

src_port

Integer

Source port. The value ranges from 0 to 65535.

Minimum: 0

Maximum: 65535

src_domain

String

Source domain name. The value contains a maximum of 128 characters.

Minimum: 0

Maximum: 128

dest_ip

String

Destination IP address

Minimum: 0

Maximum: 64

dest_port

String

Destination port. The value ranges from 0 to 65535.

Minimum: 0

Maximum: 64

dest_domain

String

Destination domain name. The value contains a maximum of 128 characters.

Minimum: 0

Maximum: 128

src_geo

Object

Geographical location of the source IP address.

dest_geo

Object

Geographical location of the destination IP address.

Table 13 resource_list

Parameter

Type

Description

id

String

Id value

Minimum: 32

Maximum: 64

name

String

The name, display only

Minimum: 0

Maximum: 1024

type

String

The name, display only

Minimum: 0

Maximum: 1024

domain_id

String

Id value

Minimum: 32

Maximum: 64

project_id

String

Id value

Minimum: 32

Maximum: 64

region_id

String

Id value

Minimum: 0

Maximum: 64

ep_id

String

Id value

Minimum: 0

Maximum: 64

ep_name

String

The name, display only

Minimum: 0

Maximum: 1024

tags

String

Id value

Minimum: 0

Maximum: 64

Table 14 remediation

Parameter

Type

Description

recommendation

String

The name, display only

Minimum: 0

Maximum: 1024

url

String

The name, display only

Minimum: 0

Maximum: 1024

Table 15 malware

Parameter

Type

Description

malware_family

String

Malicious family.

Minimum: 0

Maximum: 64

malware_class

String

Malware category.

Minimum: 0

Maximum: 64

Table 16 process

Parameter

Type

Description

process_name

String

The name, display only

Minimum: 0

Maximum: 1024

process_path

String

The name, display only

Minimum: 0

Maximum: 1024

process_pid

Integer

Id value

Minimum: 0

Maximum: 65535

process_uid

Integer

Id value

Minimum: 0

Maximum: 65535

process_cmdline

String

The name, display only

Minimum: 0

Maximum: 1024

Table 17 user_info

Parameter

Type

Description

user_id

String

Id value

Minimum: 0

Maximum: 64

user_name

String

The name, display only

Minimum: 0

Maximum: 1024

Table 18 file_info

Parameter

Type

Description

file_path

String

The name, display only

Minimum: 0

Maximum: 1024

file_content

String

The name, display only

Minimum: 0

Maximum: 1024

file_new_path

String

The name, display only

Minimum: 0

Maximum: 1024

file_hash

String

The name, display only

Minimum: 0

Maximum: 1024

file_md5

String

The name, display only

Minimum: 0

Maximum: 1024

file_sha256

String

The name, display only

Minimum: 0

Maximum: 1024

file_attr

String

The name, display only

Minimum: 0

Maximum: 1024

Table 19 dataclass_ref

Parameter

Type

Description

id

String

Id value

Minimum: 32

Maximum: 64

name

String

The name, display only

Minimum: 0

Maximum: 1024

Status code: 400

Table 20 Response header parameters

Parameter

Type

Description

X-request-id

String

Request ID, in the format request_uuid-timestamp-hostname.

Table 21 Response body parameters

Parameter

Type

Description

code

String

Error Code

Minimum: 0

Maximum: 64

message

String

Error Description

Minimum: 0

Maximum: 1024

Example Requests

Example request for querying the alert list. To query the medium-risk alerts in the open state from January 20, 2024 to January 26, 2024, sort the alerts by create time in descending order, return to the first page, with 10 records on each page.

{
  "limit" : 10,
  "offset" : 0,
  "sort_by" : "create_time",
  "order" : "DESC",
  "condition" : {
    "conditions" : [ {
      "name" : "severity",
      "data" : [ "severity", "=", "Medium" ]
    }, {
      "name" : "handle_status",
      "data" : [ "handle_status", "=", "Open" ]
    } ],
    "logics" : [ "severity", "and", "handle_status" ]
  },
  "from_date" : "2024-01-20T00:00:00.000Z+0800",
  "to_date" : "2024-01-26T23:59:59.999Z+0800"
}

Example Responses

Status code: 200

Response body of the request for searching for alerts.

{
  "code" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
  "message" : "Error message",
  "total" : 41,
  "limit" : 2,
  "offset" : 1,
  "success" : true,
  "data" : [ {
    "data_object" : {
      "version" : "1.0",
      "environment" : {
        "vendor_type" : "MyXXX",
        "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f"
      },
      "data_source" : {
        "source_type" : 3,
        "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f"
      },
      "first_observed_time" : "2021-01-30T23:00:00Z+0800",
      "last_observed_time" : "2021-01-30T23:00:00Z+0800",
      "create_time" : "2021-01-30T23:00:00Z+0800",
      "arrive_time" : "2021-01-30T23:00:00Z+0800",
      "title" : "MyXXX",
      "description" : "This my XXXX",
      "source_url" : "http://xxx",
      "count" : 4,
      "confidence" : 4,
      "severity" : "TIPS",
      "criticality" : 4,
      "alert_type" : { },
      "network_list" : [ {
        "direction" : {
          "IN" : null
        },
        "protocol" : "TCP",
        "src_ip" : "192.168.0.1",
        "src_port" : "1",
        "src_domain" : "xxx",
        "dest_ip" : "192.168.0.1",
        "dest_port" : "1",
        "dest_domain" : "xxx",
        "src_geo" : {
          "latitude" : 90,
          "longitude" : 180
        },
        "dest_geo" : {
          "latitude" : 90,
          "longitude" : 180
        }
      } ],
      "resource_list" : [ {
        "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "name" : "MyXXX",
        "type" : "MyXXX",
        "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "ep_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "ep_name" : "MyXXX",
        "tags" : "909494e3-558e-46b6-a9eb-07a8e18ca62f"
      } ],
      "remediation" : {
        "recommendation" : "MyXXX",
        "url" : "MyXXX"
      },
      "verification_state" : "Unknown,True_Positive,False_Positive The default value is Unknown.",
      "handle_status" : "Open – enabled.Block – blocked.Closed – closed.The default value is Open.",
      "sla" : 60000,
      "update_time" : "2021-01-30T23:00:00Z+0800",
      "close_time" : "2021-01-30T23:00:00Z+0800",
      "ipdrr_phase" : "Preparation | Detection and Analysis | Containment, Eradication&Recovery | Post-Incident-Activity",
      "simulation" : "false",
      "actor" : "Tom",
      "owner" : "MyXXX",
      "creator" : "MyXXX",
      "close_reason" : "False positive; Resolved; Duplicate; Others",
      "close_comment" : "False positive; Resolved; Duplicate; Others",
      "malware" : {
        "malware_family" : "family",
        "malware_class" : "Malicious memory occupation."
      },
      "system_info" : { },
      "process" : [ {
        "process_name" : "MyXXX",
        "process_path" : "MyXXX",
        "process_pid" : 123,
        "process_uid" : 123,
        "process_cmdline" : "MyXXX"
      } ],
      "user_info" : [ {
        "user_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "user_name" : "MyXXX"
      } ],
      "file_info" : [ {
        "file_path" : "MyXXX",
        "file_content" : "MyXXX",
        "file_new_path" : "MyXXX",
        "file_hash" : "MyXXX",
        "file_md5" : "MyXXX",
        "file_sha256" : "MyXXX",
        "file_attr" : "MyXXX"
      } ],
      "system_alert_table" : { },
      "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
      "workspace_id" : "909494e3-558e-46b6-a9eb-07a8e18ca620"
    },
    "create_time" : "2021-01-30T23:00:00Z+0800",
    "update_time" : "2021-01-30T23:00:00Z+0800",
    "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
    "workspace_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
    "id" : "MyXXX",
    "version" : 123,
    "format_version" : 123,
    "dataclass_ref" : {
      "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
      "name" : "MyXXX"
    }
  } ]
}

SDK Sample Code

The SDK sample code is as follows.

Example request for querying the alert list. To query the medium-risk alerts in the open state from January 20, 2024 to January 26, 2024, sort the alerts by create time in descending order, return to the first page, with 10 records on each page.

 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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.secmaster.v2.region.SecMasterRegion;
import com.huaweicloud.sdk.secmaster.v2.*;
import com.huaweicloud.sdk.secmaster.v2.model.*;

import java.util.List;
import java.util.ArrayList;

public class ListAlertsSolution {

    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");

        ICredential auth = new BasicCredentials()
                .withAk(ak)
                .withSk(sk);

        SecMasterClient client = SecMasterClient.newBuilder()
                .withCredential(auth)
                .withRegion(SecMasterRegion.valueOf("<YOUR REGION>"))
                .build();
        ListAlertsRequest request = new ListAlertsRequest();
        DataobjectSearch body = new DataobjectSearch();
        List<String> listConditionLogics = new ArrayList<>();
        listConditionLogics.add("severity");
        listConditionLogics.add("and");
        listConditionLogics.add("handle_status");
        List<String> listConditionsData = new ArrayList<>();
        listConditionsData.add("handle_status");
        listConditionsData.add("=");
        listConditionsData.add("Open");
        List<String> listConditionsData1 = new ArrayList<>();
        listConditionsData1.add("severity");
        listConditionsData1.add("=");
        listConditionsData1.add("Medium");
        List<DataobjectSearchConditionConditions> listConditionConditions = new ArrayList<>();
        listConditionConditions.add(
            new DataobjectSearchConditionConditions()
                .withName("severity")
                .withData(listConditionsData1)
        );
        listConditionConditions.add(
            new DataobjectSearchConditionConditions()
                .withName("handle_status")
                .withData(listConditionsData)
        );
        DataobjectSearchCondition conditionbody = new DataobjectSearchCondition();
        conditionbody.withConditions(listConditionConditions)
            .withLogics(listConditionLogics);
        body.withCondition(conditionbody);
        body.withToDate("2024-01-26T23:59:59.999Z+0800");
        body.withFromDate("2024-01-20T00:00:00.000Z+0800");
        body.withOrder(DataobjectSearch.OrderEnum.fromValue("DESC"));
        body.withSortBy("create_time");
        body.withOffset(0);
        body.withLimit(10);
        request.withBody(body);
        try {
            ListAlertsResponse response = client.listAlerts(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());
        }
    }
}

Example request for querying the alert list. To query the medium-risk alerts in the open state from January 20, 2024 to January 26, 2024, sort the alerts by create time in descending order, return to the first page, with 10 records on each page.

 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# coding: utf-8

from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdksecmaster.v2 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 = __import__('os').getenv("CLOUD_SDK_AK")
    sk = __import__('os').getenv("CLOUD_SDK_SK")

    credentials = BasicCredentials(ak, sk) \

    client = SecMasterClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListAlertsRequest()
        listLogicsCondition = [
            "severity",
            "and",
            "handle_status"
        ]
        listDataConditions = [
            "handle_status",
            "=",
            "Open"
        ]
        listDataConditions1 = [
            "severity",
            "=",
            "Medium"
        ]
        listConditionsCondition = [
            DataobjectSearchConditionConditions(
                name="severity",
                data=listDataConditions1
            ),
            DataobjectSearchConditionConditions(
                name="handle_status",
                data=listDataConditions
            )
        ]
        conditionbody = DataobjectSearchCondition(
            conditions=listConditionsCondition,
            logics=listLogicsCondition
        )
        request.body = DataobjectSearch(
            condition=conditionbody,
            to_date="2024-01-26T23:59:59.999Z+0800",
            from_date="2024-01-20T00:00:00.000Z+0800",
            order="DESC",
            sort_by="create_time",
            offset=0,
            limit=10
        )
        response = client.list_alerts(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)

Example request for querying the alert list. To query the medium-risk alerts in the open state from January 20, 2024 to January 26, 2024, sort the alerts by create time in descending order, return to the first page, with 10 records on each page.

 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/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")

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        Build()

    client := secmaster.NewSecMasterClient(
        secmaster.SecMasterClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListAlertsRequest{}
	var listLogicsCondition = []string{
        "severity",
	    "and",
	    "handle_status",
    }
	var listDataConditions = []string{
        "handle_status",
	    "=",
	    "Open",
    }
	var listDataConditions1 = []string{
        "severity",
	    "=",
	    "Medium",
    }
	nameConditions:= "severity"
	nameConditions1:= "handle_status"
	var listConditionsCondition = []model.DataobjectSearchConditionConditions{
        {
            Name: &nameConditions,
            Data: &listDataConditions1,
        },
        {
            Name: &nameConditions1,
            Data: &listDataConditions,
        },
    }
	conditionbody := &model.DataobjectSearchCondition{
		Conditions: &listConditionsCondition,
		Logics: &listLogicsCondition,
	}
	toDateDataobjectSearch:= "2024-01-26T23:59:59.999Z+0800"
	fromDateDataobjectSearch:= "2024-01-20T00:00:00.000Z+0800"
	orderDataobjectSearch:= model.GetDataobjectSearchOrderEnum().DESC
	sortByDataobjectSearch:= "create_time"
	offsetDataobjectSearch:= int32(0)
	limitDataobjectSearch:= int32(10)
	request.Body = &model.DataobjectSearch{
		Condition: conditionbody,
		ToDate: &toDateDataobjectSearch,
		FromDate: &fromDateDataobjectSearch,
		Order: &orderDataobjectSearch,
		SortBy: &sortByDataobjectSearch,
		Offset: &offsetDataobjectSearch,
		Limit: &limitDataobjectSearch,
	}
	response, err := client.ListAlerts(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

Response body of the request for searching for alerts.

400

Response body for request failures of searching for alerts.

Error Codes

See Error Codes.