Modifying an Event Notification Rule
Function
Modify an event notification rule.
URI
PUT /v1/{project_id}/cae/notice-rules/{rule_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. See Obtaining a Project ID. |
rule_id |
Yes |
String |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token.
|
X-Enterprise-Project-ID |
No |
String |
Enterprise project ID.
NOTE:
For details about how to obtain enterprise project IDs and enterprise project features, see Enterprise Management User Guide.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
api_version |
Yes |
String |
API version. Fixed value: v1. |
kind |
Yes |
String |
API type. Fixed value: NoticeRule. |
spec |
Yes |
UpdateNoticeRuleItem object |
Request data. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
event_name |
No |
String |
Name of the trigger event. Values: Instance scheduling successful, Instance scheduling failed, Health checked, Health check failed, Image pulled, Pull image failed, Container started up, Container startup failed, Volume mounted, Attach volume failed. |
scope |
Yes |
NoticeRuleScope object |
Scope of the notification rule that takes effect. |
trigger_policy |
Yes |
TriggerPolicy object |
Trigger policy. |
enable |
No |
Boolean |
Enable or not. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Type of the effective scope. including environments (for all components in a specified environment), applications (for all components of a specified application), and components (for specified components). |
environments |
No |
Array of strings |
List of valid environment IDs. |
applications |
No |
Array of strings |
List of valid application IDs. |
components |
No |
Array of strings |
List of valid component IDs. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
trigger_type |
Yes |
String |
Trigger type. Options: accumulative or immediately. |
period |
No |
Integer |
Trigger period. This parameter needs to be set when accumulative is selected. The default unit is second. The value can be 5 minutes, 20 minutes, 1 hour, 4 hours, or 24 hours. |
operator |
No |
String |
Comparison operator. The value can be > or >=. |
count |
No |
Integer |
Number of trigger times. This parameter needs to be set when accumulative is selected. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
api_version |
String |
API version. Fixed value: v1. |
kind |
String |
API type. Fixed value: NoticeRule. |
spec |
CreateNoticeRuleRespItem object |
Request data. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Unique ID of a notification rule. |
name |
String |
Notification name. |
event_name |
String |
Name of the triggered event. |
scope |
NoticeRuleScope object |
Scope of the notification rule that takes effect. |
trigger_policy |
TriggerPolicy object |
Trigger policy. |
notification |
NoticeRuleNotification object |
Notification mechanism. |
enable |
Boolean |
Enable or not. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Type of the effective scope. including environments (for all components in a specified environment), applications (for all components of a specified application), and components (for specified components). |
environments |
Array of strings |
List of valid environment IDs. |
applications |
Array of strings |
List of valid application IDs. |
components |
Array of strings |
List of valid component IDs. |
Parameter |
Type |
Description |
---|---|---|
trigger_type |
String |
Trigger type. Options: accumulative or immediately. |
period |
Integer |
Trigger period. This parameter needs to be set when accumulative is selected. The default unit is second. The value can be 5 minutes, 20 minutes, 1 hour, 4 hours, or 24 hours. |
operator |
String |
Comparison operator. The value can be > or >=. |
count |
Integer |
Number of trigger times. This parameter needs to be set when accumulative is selected. |
Parameter |
Type |
Description |
---|---|---|
protocol |
String |
Definition Notification protocol type. Constraints N/A. Range
Default Value N/A. |
extension |
extension object |
|
endpoint |
String |
Notification endpoint address. For an email protocol, the endpoint must be an email address. For an SMS protocol, the endpoint must be a phone number. For the WeChat protocol and DingTalk chatbot, see Obtaining Subscription Endpoints. WeCom and DingTalk chatbot are in OBT of SMN. Submit a service ticket to enable them. |
template |
String |
Notification template language. Options: ZH EN |
Example Requests
Modify an event notification rule.
PUT https://{endpoint}/v1/{project_id}/cae/notice-rules/{rule_id} { "api_version" : "v1", "kind" : "NoticeRule", "spec" : { "event_name" : "Started", "scope" : { "type" : "environments", "environments" : [ "f3c12180-b34a-42d8-bb5a-12ba0a6b579e" ] }, "trigger_policy" : { "trigger_type" : "immediately" }, "enable" : true } }
Example Responses
Status code: 200
OK
{ "api_version" : "v1", "kind" : "NoticeRule", "spec" : { "name" : "test", "event_name" : "Started", "scope" : { "type" : "environments", "environments" : [ "f3c12180-b34a-42d8-bb5a-12ba0a6b579e" ] }, "trigger_policy" : { "trigger_type" : "immediately" }, "enable" : true } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot