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:
  k8s:
    kubeconfigUrl:
      clearSecretInfo:
        url: string://<base64>
  publishVip: {}
  type: K8S
  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"}]}},"type":"K8S","publishVip":{},"k8s":{"kubeconfigUrl":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}}}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build144460626_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: Fri, 15 May 2020 10:52:36 GMT
Vary: Accept-Encoding

{

}