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

Examples of creating protected_domain

Usecase:

Create "example.com" protected_domain

Request using vesctl:

vesctl configuration create protected_domain -i protected_domain.yaml

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

metadata:
  name: test
  namespace: system
spec:
  protectedDomain: example.com

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: test
  namespace: system
spec:
  protectedDomain: example.com
systemMetadata:
  creationTimestamp: "2022-01-12T14:50:35.767245200Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 70c38a1b-7c02-4393-b9f8-f7eb689ca773

Request using curl:

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

curl response:

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

{
  "metadata": {
    "name": "test",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "70c38a1b-7c02-4393-b9f8-f7eb689ca773",
    "creation_timestamp": "2022-01-12T14:50:35.767245200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "protected_domain": "example.com",
    "date_added": null
  }
}