ves-io-schema-ip_prefix_set-API-Create

Examples of creating ip_prefix_set

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 ip_prefix_set.yaml has following contents (ip_prefix_set.CreateRequest):

RequestJSON:

{"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:

ResponseJSON:

  "metadata": {
    "name": "ddos-black-list",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d50f0186-4d65-4d07-9a4e-87632a54e2b3",
    "creation_timestamp": "2022-07-28T12:10:29.370946392Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "spec": {
    "prefix": [
      "1.2.3.0/24",
      "4.5.6.0/24",
      "7.8.9.0/24"
    ]
  }
}```
`

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-build1372770011_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: 696 Content-Type: application/json Date: Thu, 28 Jul 2022 12:10:29 GMT Vary: Accept-Encoding

{ "metadata": { "name": "ddos-black-list", "namespace": "system", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "d50f0186-4d65-4d07-9a4e-87632a54e2b3", "creation_timestamp": "2022-07-28T12:10:29.370946392Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "spec": { "prefix": [ "1.2.3.0/24", "4.5.6.0/24", "7.8.9.0/24" ] } }