ves-io-schema-bgp-API-Replace

Examples of replacing bgp

Usecase:

Replace BGP object bgp-peering in acmecrop-vsite1 to now start using port 2000 instead of 179

Request using vesctl:

vesctl configuration replace bgp -i bgp.yaml

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

RequestJSON:

{
    "metadata": {
        "name": "bgp-peering",
        "namespace": "system"
    },
    "spec": {
        "where": {
            "virtual_site": {
                "ref": [
                    {
                        "kind": "virtual_site",
                        "tenant": "acmecorp",
                        "namespace": "system",
                        "name": "acmecrop-vsite1"
                    }
                ]
            }
        },
        "bgp_parameters": {
            "asn": 64512,
            "local_address": {}
        },
        "peers": [
            {
                "metadata": {
                    "name": "peer-0"
                },
                "external": {
                    "asn": 64514,
                    "address": "10.1.1.2",
                    "port": 65379,
                    "family_inet": {
                        "enable": {}
                    },
                    "interface": {
                        "tenant": "acmecorp",
                        "namespace": "system",
                        "name": "eth0"
                    }
                }
            }
        ]
    }
}

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"bgp-peering","namespace":"system"},"spec":{"where":{"virtual_site":{"ref":[{"kind":"virtual_site","tenant":"acmecorp","namespace":"system","name":"acmecrop-vsite1"}]}},"bgp_parameters":{"asn":64512,"local_address":{}},"peers":[{"metadata":{"name":"peer-0"},"external":{"asn":64514,"address":"10.1.1.2","port":65379,"family_inet":{"enable":{}},"interface":{"tenant":"acmecorp","namespace":"system","name":"eth0"}}}]}}' -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/bgps/bgp-peering'

curl response:

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

{

}