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=_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/clusters/productpage-cluster'
        

curl response:

          HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Thu, 21 Mar 2024 14:04:57 GMT
Vary: Accept-Encoding

{

}