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
  bgpPeers:
  - asn: 64512
    port: 179
  networkInterface:
  - kind: network_interface
    name: eth0
    namespace: system
    tenant: acmecorp
  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
  bgpPeers:
  - asn: 64512
    port: 179
  networkInterface:
  - kind: network_interface
    name: eth0
    namespace: system
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecrop-vsite1
        namespace: system
        tenant: acmecorp
        uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-05-15T10:52:30.804745814Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 06310230-6dfa-42c5-9019-f10f189be33d

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},"bgpPeers":[{"asn":64512,"port":179}],"networkInterface":[{"kind":"network_interface","tenant":"acmecorp","namespace":"system","name":"eth0"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build144460626_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: Fri, 15 May 2020 10:52:30 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "bgp-peering",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "06310230-6dfa-42c5-9019-f10f189be33d",
    "creation_timestamp": "2020-05-15T10:52:30.804745814Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "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,
      "bgp_router_id_type": "BGP_ROUTER_ID_FROM_INTERFACE",
      "bgp_router_id": null,
      "bgp_router_id_key": ""
    },
    "bgp_peers": [
      {
        "asn": 64512,
        "bgp_peer_address_type": "BGP_PEER_ADDRESS_FROM_DEFAULT_GW",
        "bgp_peer_address": null,
        "bgp_peer_address_key": "",
        "port": 179,
        "bgp_peer_subnet_offset": 0
      }
    ],
    "network_interface": [
      {
        "kind": "network_interface",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "system",
        "name": "eth0"
      }
    ]
  }
}