ves-io-schema-alert_policy-API-Create

Examples of creating alert_policy

Usecase:

Create a new alert_policy.

Request using vesctl:

vesctl configuration create alert_policy -i alert_policy.yaml

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

metadata:
  name: object-1
  namespace: documentation
spec: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: object-1
  namespace: documentation
spec:
  receivers: []
  routes: []
systemMetadata:
  creationTimestamp: "2021-05-12T11:17:22.073637196Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 29d12e40-7982-4e67-8196-f491b29618c5

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"object-1","namespace":"documentation"},"spec":{}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build672621555_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/alert_policys'

curl response:

HTTP/1.1 200 OK
Content-Length: 677
Content-Type: application/json
Date: Wed, 12 May 2021 11:17:22 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "object-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "29d12e40-7982-4e67-8196-f491b29618c5",
    "creation_timestamp": "2021-05-12T11:17:22.073637196Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "receivers": [
    ],
    "routes": [
    ],
    "notification_parameters": null
  }
}