首页 / API 文档 / 运维中心 / 通知对象 / 创建通知对象

创建通知对象

请求信息

请求行

POST /apis/aiops.alauda.io/v1beta1/namespaces/{namespace}/notificationreceivers

创建一个通知对象。

请求行参数

名称 类型 是否必填项 描述
namespace string 命名空间。对象名称和身份验证范围,例如团队和项目。

请求参数

名称 类型 是否必填项 描述
dryRun string 当该参数出现时,表示不应该持久化修改。一个无效的或无法识别的 dryRun 指令将导致错误响应,并且不会进一步处理请求。有效值为:All,将处理所有的试运行阶段。
fieldManager string fieldManager 是与正在进行这些更改的参与者或实体相关联的名称。值必须少于 128 字符,且仅包含可打印字符,参见 https://golang.org/pkg/unicode/#IsPrint。
pretty string 如果为 true,则会将返回结果输出成适合打印的格式。

请求体

Content-Type application/json, application/yaml

请求体示例

NotificationReceiver 是 Servers API 的结构。

{
   "apiVersion": "aiops.alauda.io/v1beta1",
   "kind": "NotificationReceiver",
   "metadata": {
     "annotations": {
       "cpaas.io/display-name": "fdfadfa"
     },
     "labels": {
       "cpaas.io/type": "email"
     },
     "name": "fdfasf-fdsfasdf-xx-jri3s",
     "namespace": "cpaas-system",
     "resourceVersion": ""
   },
   "spec": {
     "destination": "fdfasf@fdsfasdf.xx"
   }
 }

请求体说明

名称 类型 是否必填项 描述
apiVersion string 查看公共参数
kind string 查看公共参数
metadata object 查看公共参数
spec object NotificationReceiverSpec 定义了通知对象的期望状态。
字段路径:spec
spec.destination string Destination 定义了接收方的目的地。
字段路径:spec.destination

返回信息

Content-Type application/json, application/yaml

状态码: 201

Created

返回体示例

NotificationReceiver 是 Servers API 的结构。

{
   "apiVersion": "aiops.alauda.io/v1beta1",
   "kind": "NotificationReceiver",
   "metadata": {
     "annotations": {
       "cpaas.io/creator": "admin@cpaas.io",
       "cpaas.io/display-name": "fdfadfa",
       "cpaas.io/updated-at": "2021-06-23T08:18:04Z"
     },
     "creationTimestamp": "2021-06-23T08:18:04Z",
     "generation": 1,
     "labels": {
       "cpaas.io/destination-md5": "59663d03790da4adc5ea569e106a6eb9",
       "cpaas.io/display-name-md5": "4eacfec4ed3f3d905fe025a5f304956e",
       "cpaas.io/type": "email"
     },
     "managedFields": [
       {
         "apiVersion": "aiops.alauda.io/v1beta1",
         "fieldsType": "FieldsV1",
         "fieldsV1": {
           "f:metadata": {
             "f:annotations": {
               ".": {},
               "f:cpaas.io/display-name": {}
             },
             "f:labels": {
               ".": {},
               "f:cpaas.io/type": {}
             }
           },
           "f:spec": {
             ".": {},
             "f:destination": {}
           }
         },
         "manager": "Mozilla",
         "operation": "Update",
         "time": "2021-06-23T08:18:04Z"
       }
     ],
     "name": "fdfasf-fdsfasdf-xx-jri3s",
     "namespace": "cpaas-system",
     "resourceVersion": "34041670",
     "selfLink": "/apis/aiops.alauda.io/v1beta1/namespaces/cpaas-system/notificationreceivers/fdfasf-fdsfasdf-xx-jri3s",
     "uid": "b68457d0-051e-48da-b17f-b7d066b3b0d2"
   },
   "spec": {
     "destination": "fdfasf@fdsfasdf.xx"
   }
 }

返回体说明

名称 类型 描述
apiVersion string 查看公共参数
kind string 查看公共参数
metadata object 查看公共参数
spec object NotificationReceiverSpec 定义了通知对象的期望状态。
字段路径:spec
spec.destination string Destination 定义了接收方的目的地。
字段路径:spec.destination

其他状态码

状态码: 200

OK

状态码: 202

Accepted

状态码: 401

Unauthorized