ves-io-schema-bgp_asn_set-API-Create

Examples of creating bgpasnset

Usecase:

Create bgpasnset bgp-asn-anonymous in current namespace. list of networks. It can be used to block address from anonymous networks. valid only publicly exposed services

Request using vesctl:

vesctl configuration create bgp_asn_set -i bgp_asn_set.yaml

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

metadata:
  name: bgp-asn-anonymous
  namespace: documentation
spec:
  asNumbers:
  - 1234
  - 5678
  - 9101
  - 1121
  - 3141

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: bgp-asn-anonymous
  namespace: documentation
spec:
  asNumbers:
  - 1234
  - 5678
  - 9101
  - 1121
  - 3141
systemMetadata:
  creationTimestamp: "2021-08-25T09:02:45.815111839Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: ee88ba5e-1b1f-46d3-bdb2-94ebe49cdd86

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"bgp-asn-anonymous","namespace":"documentation"},"spec":{"asNumbers":[1234,5678,9101,1121,3141]}}' -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/documentation/bgp_asn_sets'

curl response:

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

{
  "metadata": {
    "name": "bgp-asn-anonymous",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "ee88ba5e-1b1f-46d3-bdb2-94ebe49cdd86",
    "creation_timestamp": "2021-08-25T09:02:45.815111839Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "as_numbers": [
      1234,
      5678,
      9101,
      1121,
      3141
    ]
  }
}