Updated on 2023-11-16 GMT+08:00

Querying Threshold Rules (Offline Soon)

Function

This API is used to query a threshold rule list.

URI

GET /v1/{project_id}/ams/alarms

For details about the substitute of this API, see Querying the Threshold Rule List.

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 applied from Identity and Access Management (IAM). Generally, it is a string containing 32 characters.

limit

No

Integer

(0,1000]

Maximum number of returned records.

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

start

No

String

-

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

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

Array

Threshold rule list.

Example response

{ 
    "errorCode": "SVCSTG.AMS.2000", 
    "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

  • Success response

    Table 4 describes the status code.

    Table 4 Status code

    Status Code

    Message

    Description

    200

    OK

    The request has succeeded.

  • Error response

    Table 5 describes the status codes. For more information, see Status Codes.

    Table 5 Status codes

    Status Code

    Message

    Description

    400

    Bad Request

    The request is invalid.

    The client should not repeat the request without modifications.

    401

    Unauthorized

    The authorization information provided by the client is incorrect or invalid.

    403

    Forbidden

    The request is rejected.

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

    500

    InternalServerError

    The server is able to receive the request but unable to understand the request.

    503

    Service Unavailable

    The requested service is invalid.

    The client should not repeat the request without modifications.

Error Code

Table 6 Error codes

Error Code

Message

Solution

SVCSTG_AMS_4000109

Invalid project ID.

Check whether the parameter meets requirements.

SVCSTG_AMS_4000110

Invalid limit.

Check whether the parameter meets requirements.

SVCSTG_AMS_4000111

Invalid start.

Check whether the parameter meets requirements.

SVCSTG_AMS_5030001

The Cassandra session is null.

Contact technical support.

SVCSTG_AMS_5030002

The Cassandra execution is abnormal.

Contact technical support.