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

Examples of creating allowed_domain

Usecase:

Create "example.com" allowed_domain

Request using vesctl:

vesctl configuration create allowed_domain -i allowed_domain.yaml

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

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

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: test
  namespace: system
spec:
  allowedDomain: exampel.com
systemMetadata:
  creationTimestamp: "2022-01-12T14:50:32.232369300Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: d4dc0c6b-7659-4ce2-81f0-6cf9b5b15a8b

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"test","namespace":"system"},"spec":{"allowedDomain":"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/allowed_domains'

curl response:

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

{
  "metadata": {
    "name": "test",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d4dc0c6b-7659-4ce2-81f0-6cf9b5b15a8b",
    "creation_timestamp": "2022-01-12T14:50:32.232369300Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "allowed_domain": "exampel.com",
    "date_added": null
  }
}