ves-io-schema-shape-client_side_defense-mitigated_domain-API-Create

Examples of creating mitigated_domain

Usecase:

Create "example.com" mitigated_domain

Request using vesctl:

vesctl configuration create mitigated_domain -i mitigated_domain.yaml

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

metadata:
  name: test
  namespace: system
spec:
  mitigatedDomain: exampel.com

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: test
  namespace: system
spec:
  mitigatedDomain: exampel.com
systemMetadata:
  creationTimestamp: "2022-01-12T14:50:33.863324100Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: e2c5145d-d411-4750-bdc7-8dc435e13500

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"test","namespace":"system"},"spec":{"mitigatedDomain":"exampel.com"}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build038462651_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/client_side_defense/namespaces/system/mitigated_domains'

curl response:

HTTP/1.1 200 OK
Content-Length: 643
Content-Type: application/json
Date: Wed, 12 Jan 2022 14:50:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "test",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "e2c5145d-d411-4750-bdc7-8dc435e13500",
    "creation_timestamp": "2022-01-12T14:50:33.863324100Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "mitigated_domain": "exampel.com",
    "date_added": null
  }
}