ves-io-schema-tunnel-API-Replace

Examples of replacing tunnel

Usecase:

Replace tunnel-1

Request using vesctl:

vesctl configuration replace tunnel -i tunnel.yaml

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

RequestJSON:

{
    "metadata": {
        "name": "tunnel-1",
        "namespace": "system"
    },
    "spec": {
        "local_ip": {
            "ip_address": {
                "ip_address": {
                    "ipv4": {
                        "addr": "192.168.0.10"
                    }
                },
                "virtual_network_type": {
                    "public": {}
                }
            }
        },
        "remote_ip": {
            "ip": {
                "ipv4": {
                    "addr": "192.168.0.10"
                }
            }
        },
        "params": {
            "ipsec": {
                "ipsec_psk": {
                    "clear_secret_info": {
                        "url": "string://\u003cbase64\u003e"
                    }
                }
            }
        }
    }
}

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"tunnel-1","namespace":"system"},"spec":{"local_ip":{"ip_address":{"ip_address":{"ipv4":{"addr":"192.168.0.10"}},"virtual_network_type":{"public":{}}}},"remote_ip":{"ip":{"ipv4":{"addr":"192.168.0.10"}}},"params":{"ipsec":{"ipsec_psk":{"clear_secret_info":{"url":"string://\u003cbase64\u003e"}}}}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/tunnels/tunnel-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:15:58 GMT
Vary: Accept-Encoding

{

}