Update notification rule
Requests
HTTP request
PUT /apis/aiops.alauda.io/v1beta1/namespaces/{namespace}/notifications/{name}
replace the specified Notification
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | True | name of the Notification |
| namespace | string | True | object name and auth scope, such as for teams and projects |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dryRun | string | False | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
| fieldManager | string | False | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. |
| pretty | string | False | If 'true', then the output is pretty printed. |
Request body
Content-Type
application/json,
application/yaml
Sample request
Notification is the Schema for the notifications API
{
"apiVersion": "aiops.alauda.io/v1beta1",
"kind": "Notification",
"metadata": {
"annotations": {
"cpaas.io/creator": "admin@cpaas.io",
"cpaas.io/description": "adfsdfa",
"cpaas.io/display-name": "fadfadsf",
"cpaas.io/updated-at": "2021-06-24T08:52:22Z"
},
"creationTimestamp": "2021-06-24T08:52:22Z",
"generation": 1,
"labels": {
"notificationtemplate.cpaas.io/local-ares-template-template": "true"
},
"managedFields": [
{
"apiVersion": "aiops.alauda.io/v1beta1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:cpaas.io/description": {},
"f:cpaas.io/display-name": {}
}
},
"f:spec": {
".": {},
"f:subscriptions": {}
}
},
"manager": "Mozilla",
"operation": "Update",
"time": "2021-06-24T08:52:22Z"
}
],
"name": "fdsfa",
"namespace": "cpaas-system",
"resourceVersion": "35533758",
"selfLink": "/apis/aiops.alauda.io/v1beta1/namespaces/cpaas-system/notifications/fdsfa",
"uid": "0f1d1c15-f070-4b32-a3eb-ee213acca18e"
},
"spec": {
"subscriptions": [
{
"method": "wechat",
"receivers": [
{
"name": "https---abc232-9vo0f",
"namespace": "cpaas-system"
}
],
"template": "local-ares-template-template"
}
]
}
}Parmeters
| Name | Type | Required | Description |
|---|---|---|---|
| apiVersion | string | True | See common parameters |
| kind | string | True | See common parameters |
| metadata | object | True | See common parameters |
| spec | object | True |
Spec defines the specification of a notification
Path: spec |
| spec.subscriptions | array | True |
Subscriptions for this notification
Path: spec.subscriptions |
| spec.subscriptions[] | object | True |
NotificationSubscription defines a subscription for notification
Path: spec.subscriptions[] |
| subscriptions[].method | string | True |
Method of recipient, such as email/dingding/sms/webhook
Path: spec.subscriptions[].method |
| subscriptions[].receivers | array | True |
Receivers, at least one notification receiver should be added
Path: spec.subscriptions[].receivers |
| subscriptions[].receivers[] | object | True |
Path: spec.subscriptions[].receivers[] |
| receivers[].name | string | True |
Path: spec.subscriptions[].receivers[].name |
| receivers[].namespace | string | True |
Path: spec.subscriptions[].receivers[].namespace |
| subscriptions[].template | string | True |
Template to render notification message
Path: spec.subscriptions[].template |
Responses
Content-Type
application/json,
application/yaml
Status code: 200
OK
Sample response
Notification is the Schema for the notifications API
{
"apiVersion": "aiops.alauda.io/v1beta1",
"kind": "Notification",
"metadata": {
"annotations": {
"cpaas.io/creator": "admin@cpaas.io",
"cpaas.io/description": "adfsdfa",
"cpaas.io/display-name": "fadfadsf",
"cpaas.io/updated-at": "2021-06-24T08:52:22Z"
},
"creationTimestamp": "2021-06-24T08:52:22Z",
"generation": 1,
"labels": {
"notificationtemplate.cpaas.io/local-ares-template-template": "true"
},
"managedFields": [
{
"apiVersion": "aiops.alauda.io/v1beta1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:cpaas.io/description": {},
"f:cpaas.io/display-name": {}
}
},
"f:spec": {
".": {},
"f:subscriptions": {}
}
},
"manager": "Mozilla",
"operation": "Update",
"time": "2021-06-24T08:52:22Z"
}
],
"name": "fdsfa",
"namespace": "cpaas-system",
"resourceVersion": "35533758",
"selfLink": "/apis/aiops.alauda.io/v1beta1/namespaces/cpaas-system/notifications/fdsfa",
"uid": "0f1d1c15-f070-4b32-a3eb-ee213acca18e"
},
"spec": {
"subscriptions": [
{
"method": "wechat",
"receivers": [
{
"name": "https---abc232-9vo0f",
"namespace": "cpaas-system"
}
],
"template": "local-ares-template-template"
}
]
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| kind | string | See common parameters |
| metadata | object | See common parameters |
| spec | object |
Spec defines the specification of a notification
Path: spec |
| spec.subscriptions | array |
Subscriptions for this notification
Path: spec.subscriptions |
| spec.subscriptions[] | object |
NotificationSubscription defines a subscription for notification
Path: spec.subscriptions[] |
| subscriptions[].method | string |
Method of recipient, such as email/dingding/sms/webhook
Path: spec.subscriptions[].method |
| subscriptions[].receivers | array |
Receivers, at least one notification receiver should be added
Path: spec.subscriptions[].receivers |
| subscriptions[].receivers[] | object |
Path: spec.subscriptions[].receivers[] |
| receivers[].name | string |
Path: spec.subscriptions[].receivers[].name |
| receivers[].namespace | string |
Path: spec.subscriptions[].receivers[].namespace |
| subscriptions[].template | string |
Template to render notification message
Path: spec.subscriptions[].template |