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):

RequestJSON:

{"metadata":{"name":"dynamic-http-proxy","namespace":"documentation"},"spec":{"dynamic_proxy":{"domains":["*.abc.com"],"http_proxy":{},"disable_dns_masquerade":{}},"site_virtual_sites":{"advertise_where":[{"virtual_site":{"virtual_site":{"namespace":"documentation","name":"acmecorp-vsite"}},"port":8080}]},"site_local_network":{},"no_forward_proxy_policy":{},"no_interception":{}}} `

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"dynamic-http-proxy","namespace":"documentation"},"spec":{"dynamic_proxy":{"domains":["*.abc.com"],"http_proxy":{},"disable_dns_masquerade":{}},"site_virtual_sites":{"advertise_where":[{"virtual_site":{"virtual_site":{"namespace":"documentation","name":"acmecorp-vsite"}},"port":8080}]},"site_local_network":{},"no_forward_proxy_policy":{},"no_interception":{}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build1372770011_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: Thu, 28 Jul 2022 12:15:02 GMT
Vary: Accept-Encoding

{

}