ves-io-schema-cluster-API-Replace

Examples of replacing cluster

Usecase:

Replace productpage-cluster to modify loadbalancing algorithm to round robin

Request using vesctl:

vesctl configuration replace cluster -i cluster.yaml

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

RequestJSON:

{
    "metadata": {
        "name": "productpage-cluster",
        "namespace": "documentation"
    },
    "spec": {
        "endpoints": [
            {
                "kind": "endpoint",
                "tenant": "acmecorp",
                "namespace": "documentation",
                "name": "productpage-endpoint"
            }
        ],
        "health_checks": [
            {
                "kind": "healthcheck",
                "tenant": "acmecorp",
                "namespace": "documentation",
                "name": "productpage-healthcheck"
            }
        ],
        "tls_parameters": {
            "common_params": {
                "cipher_suites": [],
                "tls_certificates": [
                    {
                        "certificate_url": "string:///\u003cBase64\u003e",
                        "private_key": {
                            "blindfold_secret_info": {
                                "location": "string:///\u003cBase64\u003e"
                            }
                        }
                    }
                ]
            },
            "sni": "productpage.internal.bookinfo.com"
        }
    }
}

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"productpage-cluster","namespace":"documentation"},"spec":{"endpoints":[{"kind":"endpoint","tenant":"acmecorp","namespace":"documentation","name":"productpage-endpoint"}],"health_checks":[{"kind":"healthcheck","tenant":"acmecorp","namespace":"documentation","name":"productpage-healthcheck"}],"tls_parameters":{"common_params":{"cipher_suites":[],"tls_certificates":[{"certificate_url":"string:///\u003cBase64\u003e","private_key":{"blindfold_secret_info":{"location":"string:///\u003cBase64\u003e"}}}]},"sni":"productpage.internal.bookinfo.com"}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/clusters/productpage-cluster'

curl response:

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

{

}