ves-io-schema-advertise_policy-API-Replace
On This Page:
Examples of replacing advertise_policy
Usecase:
Example of replace to change HTTP to HTTPS. Advertise bookinfo productpage on all sites represented by virtual site acmecorp-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-acmecorp-vsite-1
namespace: documentation
spec:
port: 443
protocol: TCP
tlsParameters:
commonParams:
cipherSuites: []
tlsCertificates:
- certificateUrl: string:///<Base64>
privateKey:
blindfoldSecretInfo:
location: string:///<Base64>
where:
virtualSite:
ref:
- kind: virtual_site
name: acmecorp-vsite1
namespace: documentation
tenant: acmecorp
vesctl yaml response: None
Request using curl:
curl -X 'PUT' -d '{"metadata":{"name":"advertise-on-acmecorp-vsite-1","namespace":"documentation"},"spec":{"where":{"virtualSite":{"ref":[{"kind":"virtual_site","tenant":"acmecorp","namespace":"documentation","name":"acmecorp-vsite1"}]}},"protocol":"TCP","port":443,"tlsParameters":{"commonParams":{"cipherSuites":[],"tlsCertificates":[{"certificateUrl":"string:///\u003cBase64\u003e","privateKey":{"blindfoldSecretInfo":{"location":"string:///\u003cBase64\u003e"}}}]}}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build817539475_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/advertise_policys/advertise-on-acmecorp-vsite-1'
curl response:
HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Mon, 22 Feb 2021 15:43:22 GMT
Vary: Accept-Encoding
{
}