ves-io-schema-bgp-API-Create

Examples of creating bgp

Usecase:

Create BGP object which configures BGP peering with default gateway to advertise VIP(s) hosted on this site. This object can be configured for entire fleet at time.

Request using vesctl:

vesctl configuration create bgp -i bgp.yaml

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

metadata:
  name: bgp-peering
  namespace: system
spec:
  bgpParameters:
    asn: 64512
    localAddress: {}
  peers:
  - external:
      address: 10.1.1.1
      asn: 64513
      familyInet:
        enable: {}
      interface:
        name: eth0
        namespace: system
        tenant: acmecorp
      port: 65379
    metadata:
      name: peer-0
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecrop-vsite1
        namespace: system
        tenant: acmecorp

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: bgp-peering
  namespace: system
spec:
  bgpParameters:
    asn: 64512
    localAddress: {}
  peers:
  - external:
      address: 10.1.1.1
      asn: 64513
      familyInet:
        enable: {}
      interface:
        name: eth0
        namespace: system
        tenant: acmecorp
      port: 65379
    metadata:
      name: peer-0
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecrop-vsite1
        namespace: system
        tenant: acmecorp
        uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2021-08-25T09:02:44.806983081Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 3937bbdb-e250-4456-a86a-061407c76c4a

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"bgp-peering","namespace":"system"},"spec":{"where":{"virtualSite":{"ref":[{"kind":"virtual_site","tenant":"acmecorp","namespace":"system","name":"acmecrop-vsite1"}]}},"bgpParameters":{"asn":64512,"localAddress":{}},"peers":[{"metadata":{"name":"peer-0"},"external":{"asn":64513,"address":"10.1.1.1","port":65379,"familyInet":{"enable":{}},"interface":{"tenant":"acmecorp","namespace":"system","name":"eth0"}}}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/bgps'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:02:44 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "bgp-peering",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3937bbdb-e250-4456-a86a-061407c76c4a",
    "creation_timestamp": "2021-08-25T09:02:44.806983081Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "where": {
      "virtual_site": {
        "ref": [
          {
            "kind": "virtual_site",
            "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
            "tenant": "acmecorp",
            "namespace": "system",
            "name": "acmecrop-vsite1"
          }
        ],
        "network_type": "VIRTUAL_NETWORK_SITE_LOCAL"
      }
    },
    "bgp_parameters": {
      "asn": 64512,
      "local_address": {

      },
      "bgp_router_id_type": "BGP_ROUTER_ID_FROM_INTERFACE",
      "bgp_router_id": null,
      "bgp_router_id_key": ""
    },
    "peers": [
      {
        "metadata": {
          "name": "peer-0",
          "description": "",
          "disable": false
        },
        "external": {
          "asn": 64513,
          "address": "10.1.1.1",
          "port": 65379,
          "family_inet": {
            "enable": {

            }
          },
          "interface": {
            "tenant": "acmecorp",
            "namespace": "system",
            "name": "eth0"
          }
        },
        "target_service": ""
      }
    ]
  }
}