Querying a Threshold Rule List

Function

This API is used to query a threshold rule list.

URI

GET /v2/{project_id}/ams/alarms

Request

Request parameters

Table 1 describes the request parameters.

Table 1 Request parameters

Parameter

Mandatory

Type

Value Range

Description

project_id

Yes

String

-

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

limit

No

Integer

(0,1000]

Value range: 1–1000. Default value: 1000.

Maximum number of returned records.

start

No

Integer

[0, (Maximum value of the int type – 1000)]

Pagination information.

Request headers

Table 2 describes the request headers.

Table 2 Request headers

Name

Mandatory

Description

X-Auth-Token

Yes

User token obtained from IAM.

Content-Type

Yes

Content type, which is application/json.

Response

Response parameters

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Description

errorCode

String

Response code.

errorMessage

String

Response message.

metaData

JSON object

Metadata, including pagination information.

metaData.count

Integer

Number of returned records.

metaData.total

Integer

Total number of records.

metaData.start

String

Start of the next page, which is used for pagination.

thresholds

JSON array

Threshold rule list.

Example response

{ 
    "errorCode": "AOM.0200", 
    "errorMessage": "success", 
    "metaData": { 
      "count": 10, 
      "start": null, 
      "total": 100 
    }, 
    "thresholds":  
    [ 
    { 
        "id": "2137", 
        "alarmName": "aaaaaaaa", 
        "alarmDescription": "", 
        "actionEnabled": false, 
        "okActions": [], 
        "alarmActions": [], 
        "insufficientDataActions": [], 
        "stateValue": "alarm", 
        "stateReason": "", 
        "stateUpdatedTimestamp": null, 
        "metricName": "cpuCoreLimit", 
        "namespace": "PAAS.CONTAINER", 
        "statistic": "average", 
        "dimensions": [ 
            { 
                "name": "appName", 
                "value": "rhm-broker" 
            } 
        ], 
        "period": 60000, 
        "evaluationPeriods": 1, 
        "unit": "Core", 
        "threshold": "0", 
        "comparisonOperator": ">=", 
        "alarmAdvice": "", 
        "alarmLevel": 3 
    } 
    ] 
}

Status Code

Error Code

Table 6 Error codes

Error Code

Message

Solution

AOM.0109

Invalid project ID.

Check whether the parameter meets requirements.

AOM.0110

Invalid limit.

Check whether the parameter meets requirements.

AOM.0111

Invalid start.

Check whether the parameter meets requirements.

AOM.0501

The Cassandra session is null.

Contact technical support.

AOM.0502

The Cassandra execution is abnormal.

Contact technical support.