Home / API Documentation / Operations center / Senders / Create the notification sender

Create the notification sender

Requests

HTTP request

POST /api/v1/namespaces/{namespace}/secrets

create a NotificationSender. Body should have a fixed type("cpaas.io/type=NotificationSender") and a label("cpaas.io/type=email/sms/webhook", one of these).

Path parameters

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

Request body

Content-Type */*

Sample request

Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.

{
   "apiVersion": "v1",
   "data": {
     "User-Agent": "QWxhdWRhL0NvdXJpZXI="
   },
   "kind": "Secret",
   "metadata": {
     "annotations": {
       "sync-mutable": ""
     },
     "labels": {
       "cpaas.io/type": "webhook",
       "cpaas.io/unique-name": "f54a41f84e0cacdaf7bb0d32b0a645b8",
       "helm.sh/chart-name": "alauda-aiops",
       "helm.sh/chart-version": "v3.5.5",
       "helm.sh/release-name": "alauda-aiops",
       "helm.sh/release-namespace": "cpaas-system"
     },
     "name": "default-webhook-sender",
     "namespace": "cpaas-system"
   },
   "type": "NotificationSender"
 }

Parmeters

Name Type Required Description
apiVersion string TrueSee common parameters
data object True Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
Path: data
kind string TrueSee common parameters
metadata object TrueSee common parameters
type string True Used to facilitate programmatic handling of secret data.
Path: type

Responses

Content-Type application/json, application/yaml, application/vnd.kubernetes.protobuf

Status code: 201

Created

Sample response

Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.

{
   "apiVersion": "v1",
   "data": {
     "User-Agent": "QWxhdWRhL0NvdXJpZXI="
   },
   "kind": "Secret",
   "metadata": {
     "annotations": {
       "sync-mutable": ""
     },
     "creationTimestamp": "2021-06-21T05:07:17Z",
     "labels": {
       "cpaas.io/type": "webhook",
       "cpaas.io/unique-name": "f54a41f84e0cacdaf7bb0d32b0a645b8",
       "helm.sh/chart-name": "alauda-aiops",
       "helm.sh/chart-version": "v3.5.5",
       "helm.sh/release-name": "alauda-aiops",
       "helm.sh/release-namespace": "cpaas-system"
     },
     "managedFields": [
       {
         "apiVersion": "v1",
         "fieldsType": "FieldsV1",
         "fieldsV1": {
           "f:data": {
             ".": {},
             "f:User-Agent": {}
           },
           "f:metadata": {
             "f:annotations": {
               ".": {},
               "f:sync-mutable": {}
             },
             "f:labels": {
               ".": {},
               "f:cpaas.io/type": {},
               "f:cpaas.io/unique-name": {},
               "f:helm.sh/chart-name": {},
               "f:helm.sh/chart-version": {},
               "f:helm.sh/release-name": {},
               "f:helm.sh/release-namespace": {}
             }
           },
           "f:type": {}
         },
         "manager": "Go-http-client",
         "operation": "Update",
         "time": "2021-06-21T05:07:17Z"
       }
     ],
     "name": "default-webhook-sender",
     "namespace": "cpaas-system",
     "resourceVersion": "22137",
     "selfLink": "/api/v1/namespaces/cpaas-system/secrets/default-webhook-sender",
     "uid": "96a2b908-2dab-4349-a4a1-6d836033c419"
   },
   "type": "NotificationSender"
 }

Parameters

Name Type Description
apiVersion string See common parameters
data object Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
Path: data
kind string See common parameters
metadata object See common parameters
type string Used to facilitate programmatic handling of secret data.
Path: type

Other status codes

Status code: 200

OK

Status code: 202

Accepted

Status code: 401

Unauthorized