Updated on 2026-10-21 GMT+08:00

Modifying an Alarm Subscription

Function

This API is used to modify an alarm subscription.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{project_id}/alarm-subs/{alarm_sub_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

alarm_sub_id

Yes

String

Definition

Alarm subscription ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition

Subscribed alarm name.

Range

N/A

enable

No

Integer

Definition

Whether to enable subscription.

Range

N/A

alarm_level

No

String

Definition

Alarm severity.

Range

N/A

notification_target

Yes

String

Definition

Message topic address.

Range

N/A

notification_target_name

Yes

String

Definition

Message topic name.

Range

N/A

notification_target_type

Yes

String

Definition:

Message topic type

Range:

  • SMN: indicates the SMN type.

language

No

String

Definition

Language.

Range

N/A

time_zone

No

String

Definition

Time zone.

Range

N/A

cluster_id

No

String

Definition

Cluster ID.

Range

N/A

alarm_details

No

Array of AlarmSubDetailResopnse objects

Definition

Details about all subscribed alarms.

Range

N/A

Table 3 AlarmSubDetailResopnse

Parameter

Mandatory

Type

Description

id

Yes

String

Definition

Alarm configuration ID.

Range

N/A

alarm_id

Yes

String

Definition

Alarm definition ID.

Range

N/A

alarm_name

Yes

String

Definition

Alarm name.

Range

N/A

name_space

Yes

String

Definition

Service.

Range

N/A

alarm_level

Yes

String

Definition

Alarm severity.

Range

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

String

Definition

Alarm subscription ID.

Range

N/A

name

String

Definition

Subscribed alarm name.

Range

N/A

enable

Integer

Definition

Whether to enable subscription.

Range

N/A

alarm_level

String

Definition

Alarm severity.

Range

N/A

project_id

String

Definition

Project ID.

Range

N/A

name_space

String

Definition

Service to which the alarm belongs.

Range

N/A

notification_target

String

Definition

Message topic address.

Range

N/A

notification_target_name

String

Definition

Message topic name.

Range

N/A

notification_target_type

String

Definition:

Message topic type

Range:

  • SMN: indicates the SMN type.

language

String

Definition

Language.

Range

N/A

time_zone

String

Definition

Time zone.

Range

N/A

cluster_id

String

Definition

Cluster ID.

Range

N/A

alarm_details

Array of AlarmSubDetailResopnse objects

Definition

Details about all subscribed alarms.

Range

N/A

Table 5 AlarmSubDetailResopnse

Parameter

Type

Description

id

String

Definition

Alarm configuration ID.

Range

N/A

alarm_id

String

Definition

Alarm definition ID.

Range

N/A

alarm_name

String

Definition

Alarm name.

Range

N/A

name_space

String

Definition

Service.

Range

N/A

alarm_level

String

Definition

Alarm severity.

Range

N/A

Example Requests

Modify the dws-test-13alarm subscription. Change the alarm severity to critical,major,minor, the SMN topic name to dws-test-nodelete, and the address to urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:dws-test-nodelete.

put https://{Endpoint}/v2/4cf650fd46704908aa071b4df2453e1e/alarm-subs/273ce506-dad8-411c-92f9-be5004739b40

{
  "alarm_level" : "important",
  "enable" : 1,
  "name" : "dws-test-13",
  "notification_target" : "urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:dws-test-nodelete",
  "notification_target_name" : "dws-test-nodelete",
  "notification_target_type" : "SMN"
}

Example Responses

Status code: 200

{
  "id" : "273ce506-dad8-411c-92f9-be5004739b40",
  "name" : "dws-test-13",
  "cluster_id" : "3b1004d1-863a-4783-b9ed-9de933269b7e",
  "enable" : 1,
  "language" : "zh-cn",
  "alarm_level" : "important",
  "project_id" : "4cf650fd46704908aa071b4df2453e1e",
  "name_space" : "dws",
  "notification_target" : "urn:smn:cn-north-7:4cf650fd46704908aa071b4df2453e1e:dws-test-nodelete",
  "notification_target_name" : "dws-test-nodelete",
  "notification_target_type" : "SMN",
  "time_zone" : "GMT+08:00",
  "alarm_details" : [ {
    "id" : "525178dc-f035-4fde-8dec-bb92e36a3e3f",
    "alarm_id" : "dab83e14-a582-4748-a48c-d6b380e95fec",
    "alarm_name" : "test",
    "name_space" : "dws",
    "alarm_level" : "important"
  } ]
}

Status Codes

Status Code

Description

200

Alarm subscription modified.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

404

No resources found.

500

Internal server error.

503

Service unavailable.