ves-io-schema-advertise_policy-API-Replace

Examples of replacing advertise_policy

Usecase:

Example of replace to change HTTP to HTTPS. Advertise bookinfo productpage on all sites represented by virtual site acmecrop-vsite1. It is advertised as HTTPS on site local network. VIP is automatically chosen by the system

Request using vesctl:

vesctl configuration replace advertise_policy -i advertise_policy.yaml

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

metadata:
  name: advertise-on-acmecrop-vsite-1
  namespace: documentation
spec:
  port: 443
  protocol: TCP
  tlsParameters:
    commonParams:
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecrop-vsite1
        namespace: documentation
        tenant: acmecorp

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"advertise-on-acmecrop-vsite-1","namespace":"documentation"},"spec":{"where":{"virtualSite":{"ref":[{"kind":"virtual_site","tenant":"acmecorp","namespace":"documentation","name":"acmecrop-vsite1"}]}},"protocol":"TCP","port":443,"tlsParameters":{"commonParams":{"tlsCertificates":[{"certificateUrl":"string:///\u003cBase64\u003e","privateKey":{"blindfoldSecretInfo":{"location":"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/documentation/advertise_policys/advertise-on-acmecrop-vsite-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Fri, 15 May 2020 10:52:27 GMT
Vary: Accept-Encoding

{

}