Home / API Documentation / Operations center / Object of notification / Create a notification object

Create a notification object

Requests

HTTP request

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

create a NotificationReceiver

Path parameters

Name Type Required Description
namespace string Trueobject name and auth scope, such as for teams and projects

Query parameters

Name Type Required Description
dryRun string FalseWhen 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 FalsefieldManager 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 FalseIf 'true', then the output is pretty printed.

Request body

Content-Type application/json, application/yaml

Sample request

NotificationReceiver is the Schema for the 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"
   }
 }

Parmeters

Name Type Required Description
apiVersion string TrueSee common parameters
kind string TrueSee common parameters
metadata object TrueSee common parameters
spec object True NotificationReceiverSpec defines the desired state of NotificationReceiver
Path: spec
spec.destination string True Destination define the destination of a receiver
Path: spec.destination

Responses

Content-Type application/json, application/yaml

Status code: 201

Created

Sample response

NotificationReceiver is the Schema for the 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"
   }
 }

Parameters

Name Type Description
apiVersion string See common parameters
kind string See common parameters
metadata object See common parameters
spec object NotificationReceiverSpec defines the desired state of NotificationReceiver
Path: spec
spec.destination string Destination define the destination of a receiver
Path: spec.destination

Other status codes

Status code: 200

OK

Status code: 202

Accepted

Status code: 401

Unauthorized