Search Alert Type¶
Query alert types by page.
Request Format¶
POST https://{apigw-address}/event-service/v2.1/alert-types/search?action=search
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required or Not |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
true |
String |
Organization ID which the asset belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
expression |
false |
String |
Query expression, which supports for sql-like query. The fields that are supported for query include: |
pagination |
false |
Pagination request struct |
Pagination parameter. When not specified, 10 entries are displayed in each page. The entries are sorted in descending order by |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
AlertType struct |
Alert type. See AlertType Struct. |
AlertType Struct ¶
Name |
Data Type |
Description |
---|---|---|
typeId |
String |
Alert type ID |
typeDesc |
StringI18n |
Alert type description |
orgId |
String |
Organization ID which the asset belongs to |
parentTypeId |
String |
Parent alert type ID. If set as null, it is the parent alert type. |
tags |
Tag struct |
Tags |
updatePerson |
String |
Update personnel name |
updateTime |
Long |
Update time (UTC) |
Input/Output Samples¶
Request Sample¶
POST https://{apigw-address}/event-service/v2.1/alert-types/search?action=search&orgId=1c499110e8800000
{
"pagination": {
"pageNo": 1,
"pageSize": 1,
"sorters": [{
"field": "typeId",
"order": "DESC"
}]
}
}
Return Sample¶
{
"pagination": {
"pageNo": 1,
"pageSize": 1,
"totalSize": 14,
"sortedBy": [{
"field": "typeId",
"order": "DESC"
}]
},
"code": 0,
"msg": "OK",
"requestId": "c1be09d8-a6f2-4647-92e1-3c545fa1b3dd",
"data": [{
"typeId": "dateType",
"orgId": "yourOrgId",
"typeDesc": {
"i18nValue": {
"en_US": "dateType desc",
"zh_CN": ""
}
},
"tags": {
},
"updatePerson": "yj_test_customer",
"updateTime": 1546612655000
}]
}
Java SDK Sample¶
public void testSearchAlertType() {
SearchAlertTypeRequest request = new SearchAlertTypeRequest();
request.setOrgId(orgId);
Pagination pagination = new Pagination();
pagination.setPageNo(1);
pagination.setPageSize(1);
List<Sorter> sorterList = new ArrayList<>();
sorterList.add(new Sorter("typeId", Sorter.Order.DESC));
pagination.setSorters(sorterList);
request.setPagination(pagination);
try {
SearchAlertTypeResponse response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
.url("https://{apigw-address}")
.getResponse(request, SearchAlertTypeResponse.class);
Gson gson = new Gson();
System.out.println(gson.toJson(response));
} catch (Exception e) {
e.printStackTrace();
}
}