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": "ea9439cd-dcfe-4895-b39b-f9922f734a0d",
        "creation_timestamp": "2024-03-21T14:05:48.369658Z",
        "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"
        ],
        "ipv6_prefix": []
    }
}
        

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=_var_folders_2__8qnt6fwd5dvglr1xqq6l8b7w0000gp_T_go-build3109416560_b001_apidocs.test/host=C02FN35BMD6R/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/ip_prefix_sets'
        

curl response:

          HTTP/1.1 200 OK
Content-Length: 721
Content-Type: application/json
Date: Thu, 21 Mar 2024 14:05:48 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "ddos-black-list",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "ea9439cd-dcfe-4895-b39b-f9922f734a0d",
    "creation_timestamp": "2024-03-21T14:05:48.369658Z",
    "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"
    ],
    "ipv6_prefix": [
    ]
  }
}