ves-io-schema-ip_prefix_set-API-Create

Examples of creating ipprefixset

Usecase:

Create ddos-black-list list of known ip prefixes that have reputation of geerating ddos attacks

Request using vesctl:

vesctl configuration create ip_prefix_set -i ip_prefix_set.yaml

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

metadata:
  name: ddos-black-list
  namespace: system
spec:
  prefix:
  - 1.2.3.0/24
  - 4.5.6.0/24
  - 7.8.9.0/24

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: ddos-black-list
  namespace: system
spec:
  prefix:
  - 1.2.3.0/24
  - 4.5.6.0/24
  - 7.8.9.0/24
systemMetadata:
  creationTimestamp: "2020-05-15T10:52:42.106229981Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 786b0615-c4d6-4adc-a3e0-dcfde96c217d

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"ddos-black-list","namespace":"system"},"spec":{"prefix":["1.2.3.0/24","4.5.6.0/24","7.8.9.0/24"]}}' -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/ip_prefix_sets'

curl response:

HTTP/1.1 200 OK
Content-Length: 670
Content-Type: application/json
Date: Fri, 15 May 2020 10:52:42 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "ddos-black-list",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "786b0615-c4d6-4adc-a3e0-dcfde96c217d",
    "creation_timestamp": "2020-05-15T10:52:42.106229981Z",
    "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": {
    "prefix": [
      "1.2.3.0/24",
      "4.5.6.0/24",
      "7.8.9.0/24"
    ]
  }
}