ves-io-schema-views-proxy-API-Replace

Examples of replacing proxy

Usecase:

Replace "dynamic-http-proxy" Proxy by changing domains

Request using vesctl:

vesctl configuration replace proxy -i proxy.yaml

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

metadata:
  name: dynamic-http-proxy
  namespace: documentation
spec:
  dynamicProxy:
    disableDnsMasquerade: {}
    domains:
    - '*.abc.com'
    httpProxy: {}
  noForwardProxyPolicy: {}
  siteLocalNetwork: {}
  siteVirtualSites:
    advertiseWhere:
    - port: 8080
      virtualSite:
        virtualSite:
          name: acmecorp-vsite
          namespace: documentation

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"dynamic-http-proxy","namespace":"documentation"},"spec":{"dynamicProxy":{"domains":["*.abc.com"],"httpProxy":{},"disableDnsMasquerade":{}},"siteVirtualSites":{"advertiseWhere":[{"virtualSite":{"virtualSite":{"namespace":"documentation","name":"acmecorp-vsite"}},"port":8080}]},"siteLocalNetwork":{},"noForwardProxyPolicy":{}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/proxys/dynamic-http-proxy'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:32 GMT
Vary: Accept-Encoding

{

}