Updated on 2024-08-02 GMT+08:00

Obtaining the Alarm Sending Result

Function

This API is used to obtain the alarm sending result.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/alarm-notified-histories

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID obtained from IAM. Generally, a project ID contains 32 characters.

Minimum: 32

Maximum: 32

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

event_sn

No

String

Alarm serial number.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

Minimum: 1

Maximum: 40960

Content-Type

Yes

String

Content type, which is application/json.

Enumeration values:

  • application/json

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

notified_histories

Array of NotifiedHistoriesResult objects

Historical notification list.

Table 5 NotifiedHistoriesResult

Parameter

Type

Description

event_sn

String

Alarm serial number.

Minimum: 19

Maximum: 19

notifications

Array of Notifications objects

Notification result.

Array Length: 0 - 100

Table 6 Notifications

Parameter

Type

Description

action_rule

String

Alarm action rule name.

Minimum: 1

Maximum: 100

notifier_channel

String

Notification type. SMN: Simple Message Notification.

Enumeration values:

  • SMN

smn_channel

SmnResponse object

Notification result details.

Table 7 SmnResponse

Parameter

Type

Description

sent_time

Long

Sending time.

Minimum: 0

Maximum: 9999999999

smn_notified_history

Array of SmnInfo objects

Content of a notification.

Array Length: 1 - 100

smn_request_id

String

ID for requesting SMN.

Minimum: 32

Maximum: 32

smn_response_body

String

Information returned after the SMN service is invoked.

Minimum: 0

Maximum: 1024

smn_response_code

String

HTTP status code returned after the SMN service is invoked.

Minimum: 3

Maximum: 3

smn_topic

String

SMN topic.

Minimum: 1

Maximum: 100

Table 8 SmnInfo

Parameter

Type

Description

smn_notified_content

String

SMN message content.

Minimum: 1

Maximum: 9999999

smn_subscription_status

String

SMN subscription status.

Minimum: 1

Maximum: 1

smn_subscription_type

String

SMN subscription type.

Minimum: 1

Maximum: 100

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

Minimum: 13

Maximum: 13

error_msg

String

Response message.

Minimum: 1

Maximum: 100

trace_id

String

Response ID.

Minimum: 12

Maximum: 12

Status code: 401

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 12

Maximum: 12

error_msg

String

Error message.

Minimum: 0

Maximum: 1024

error_type

String

Error type.

Minimum: 0

Maximum: 128

trace_id

String

Request ID.

Minimum: 32

Maximum: 32

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 12

Maximum: 12

error_msg

String

Error message.

Minimum: 0

Maximum: 1024

error_type

String

Error type.

Minimum: 0

Maximum: 128

trace_id

String

Request ID.

Minimum: 32

Maximum: 32

Status code: 500

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

Minimum: 13

Maximum: 13

error_msg

String

Response message.

Minimum: 1

Maximum: 100

trace_id

String

Response ID.

Minimum: 12

Maximum: 12

Example Requests

Obtain the sending result of the alarm whose serial number is 1044686593798963201.

https://{Endpoint}/v2/{project_id}/alarm-notified-histories?event_sn=1044686593798963201

Example Responses

Status code: 200

OK: The request is successful.

{
  "notified_histories" : [ {
    "event_sn" : "1044686593798963201",
    "notifications" : [ {
      "action_rule" : "lhy_alarm_action_test01",
      "notifier_channel" : "SMN",
      "smn_channel" : {
        "sent_time" : 1669114269797,
        "smn_notified_history" : [ {
          "smn_notified_content" : "<style>    span {        display: inline-block;        float: left;        font-size: 14px;    }    b {        display: inline-block;        float: left;        color: #252B3A;        font-size: 14px    }</style><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"       style=\"font-family:HuaweiFont,Helvetica,Arial,PingFangSC-Regular,Hiragino Sans GB,Microsoft YaHei,Microsoft JhengHei;border-spacing:0px 14px;font-size:14px;padding-left: 30px;line-height:25px;\">    <thead>    <tr style=\"font-size:14px;\">        <td colspan=\"2\" style=\"line-height:28px;color:#6e6e6e;font-size:14px\">            <b>Dear&nbsp;</b>            <b>users</b>            <b>&nbsp;</b>        </td>    </tr>    </thead>    <tr>        <td colspan=\"2\">            <span>1 notification has been&nbsp;</span>            <b>generated</b>            <span>&nbsp;in region ***</span>            <b>&nbsp;based on action rule lhy_alarm_action_test01.</b>            <span></span>            <span></span>                                    <span><span>The alarm rule is&nbsp;</span><b>lhy_test_001</b></span>            <span>. For more information, go to the AOM console.</span>            <br>            <br>        </td>    </tr>    <tr style=\"font-size:14px;\">        <td colspan=\"2\">            <p style=\"margin-bottom: -20px; margin-top: -26px;\">                <span style=\"color:#252B3A;line-height:24px\">Here are the details.</span>            </p>        </td>    </tr>    <td><div>Account: kaifatest;<br>Notification Type: alarm;<br>CAS Application Name: app-1;<br>Notification Type: NA;<br>Severity: Critical;<br>Name: lhy_test_001;<br>Occurred: 2022-11-22 18:51:05 GMT+08:00;<br>Source: AOM;<br>Resource Type: Application;<br>Resource Identifier: <br>&nbsp;&nbsp;casApplicationID: 2d216a2b-9a58-452e-9a82-fc0c7cbcd322;<br>&nbsp;&nbsp;casApplicationName: app-1;<br>Possible Cause: If the specified metric value crosses the threshold and the alarm severity is \\\"critical\\\", an alarm is triggered.;<br>Link: https://console.xxx/aom/alarmlist;<br>Additional Info: The threshold rule lhy_test_001 status changes from \\\"init\\\" to \\\"alarm\\\". The value of \\\"cpuCoreLimit\\\" is \\\"0.250\\\" and meets the threshold criterion \\\">=0\\\"<br>Suggestion: NA;<br><div/></td>  </table>",
          "smn_subscription_status" : 1,
          "smn_subscription_type" : "email"
        }, {
          "smn_notified_content" : "[AOM][Critical_alarm_generated] \nAlert Name: lhy_test_001;\nCAS Application Name: app-1;\nOccurrence Time: 2022-11-22 18:51:05 GMT+08:00;\nLink: https://console.xxx/aom/alarmlist;\nAlert Content: The threshold rule lhy_test_001 status changes from \"init\" to \"alarm\". The value of \"cpuCoreLimit\" is \"0.250\" and meets the threshold criterion \">=0\".;\nThis message is configured in an AOM alarm rule by kaifatest. For more information, go to the AOM console.\",",
          "smn_subscription_status" : 0,
          "smn_subscription_type" : "sms"
        }, {
          "smn_notified_content" : "[AOM][Critical_alarm_generated] \nAlert Name: lhy_test_001;\nCAS Application Name: app-1;\nOccurrence Time: 2022-11-22 18:51:05 GMT+08:00;\nLink: https://console.xxx/aom/alarmlist;\nAlert Content: The threshold rule lhy_test_001 status changes from \"init\" to \"alarm\". The value of \"cpuCoreLimit\" is \"0.250\" and meets the threshold criterion \">=0\".;\nThis message is configured in an AOM alarm rule by kaifatest. For more information, go to the AOM console.\",",
          "smn_subscription_status" : 0,
          "smn_subscription_type" : "sms"
        } ],
        "smn_request_id" : "600bfa7447da48068312bba0fb2b3afa",
        "smn_response_body" : "{\"message_id\":\"b5db3a3419b84cc29d438a7dba336c20\",\"request_id\":\"600bfa7447da48068312bba0fb2b3afa\"}",
        "smn_response_code" : "200",
        "smn_topic" : "lhy_test01"
      }
    } ]
  } ]
}

Status code: 400

Bad Request: Invalid request. The client should not repeat the request without modifications.

{
  "error_code" : "AOM.08003001",
  "error_msg" : "bad request",
  "trace_id" : ""
}

Status code: 401

Unauthorized: The authentication information is incorrect or invalid.

{
  "error_code" : "SVCSTG.AMS.2000051",
  "error_msg" : "auth failed.",
  "error_type" : "AUTH_FAILED"
}

Status code: 403

Forbidden: The request is rejected. The server has received the request and understood it, but the server refuses to respond to it. The client should not repeat the request without modifications.

{
  "error_code" : "AOM.0403",
  "error_msg" : "auth failed.",
  "error_type" : "AUTH_FAILED"
}

Status code: 500

Internal Server Error: The server is able to receive the request but unable to understand the request.

{
  "error_code" : "AOM.08001002",
  "error_msg" : "SC_INTERNAL_SERVER_ERROR",
  "trace_id" : ""
}

Status Codes

Status Code

Description

200

OK: The request is successful.

400

Bad Request: Invalid request. The client should not repeat the request without modifications.

401

Unauthorized: The authentication information is incorrect or invalid.

403

Forbidden: The request is rejected. The server has received the request and understood it, but the server refuses to respond to it. The client should not repeat the request without modifications.

500

Internal Server Error: The server is able to receive the request but unable to understand the request.

Error Codes

See Error Codes.