ves-io-schema-discovery-API-Replace

Examples of replacing discovery

Usecase:

Replace discovery object to stop publishing VIP.

Request using vesctl:

vesctl configuration replace discovery -i discovery.yaml

where file discovery.yaml has following contents (discovery.ReplaceRequest):

metadata:
  name: k8s-discovery
  namespace: system
spec:
  discoveryK8s:
    accessInfo:
      isolated: {}
      kubeconfigUrl:
        clearSecretInfo:
          url: string://<base64>
    publishInfo:
      disable: {}
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecorp-vsite
        namespace: system
        tenant: acmecorp

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"k8s-discovery","namespace":"system"},"spec":{"where":{"virtualSite":{"ref":[{"kind":"virtual_site","tenant":"acmecorp","namespace":"system","name":"acmecorp-vsite"}]}},"discoveryK8s":{"accessInfo":{"kubeconfigUrl":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}},"isolated":{}},"publishInfo":{"disable":{}}}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/discoverys/k8s-discovery'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:06:58 GMT
Vary: Accept-Encoding

{

}