ves-io-schema-alert_receiver-API-Create

Examples of creating alert_receiver

Usecase:

Create alert_receiver "receiver1"

Request using vesctl:

vesctl configuration create alert_receiver -i alert_receiver.yaml

where file alertreceiver.yaml has following contents (alertreceiver.CreateRequest):

metadata:
  name: receiver1
  namespace: documentation
spec:
  email:
    email: xyz@abc.com

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: receiver1
  namespace: documentation
spec:
  email:
    email: xyz@abc.com
systemMetadata:
  creationTimestamp: "2021-08-25T09:02:30.200627820Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 9fdbf6b7-2c50-4b63-9e24-62aca871ad2b

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"receiver1","namespace":"documentation"},"spec":{"email":{"email":"xyz@abc.com"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/alert_receivers'

curl response:

HTTP/1.1 200 OK
Content-Length: 643
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:02:30 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "receiver1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9fdbf6b7-2c50-4b63-9e24-62aca871ad2b",
    "creation_timestamp": "2021-08-25T09:02:30.200627820Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "email": {
      "email": "xyz@abc.com"
    }
  }
}