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=_var_folders_2__8qnt6fwd5dvglr1xqq6l8b7w0000gp_T_go-build3109416560_b001_apidocs.test/host=C02FN35BMD6R/svc=S:examplesvc/site=mytestce01' '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, 21 Mar 2024 14:08:49 GMT
Vary: Accept-Encoding

{

}