ves-io-schema-infraprotect_network-CustomAPI-Mitigate

Examples of performing infraprotect_network CustomAPI Mitigate

Usecase:

Start or Stop a prefix mitigation

Request:

Request using vesctl:

vesctl request rpc infraprotect_network.CustomAPI.Mitigate -i request.yaml --uri /public/namespaces/system/infraprotect_networks/mitigate --http-method POST

where file request.yaml has following contents:

namespace: system
prefix: 10.1.1.0/24
status: true

vesctl yaml response:

prefixes:
- 10.1.1.0/24

Request using curl:

curl -X 'POST' -d '{"namespace":"system","prefix":"10.1.1.0/24","status":true}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/infraprotect_networks/mitigate'

curl response:

HTTP/1.1 200 OK
Content-Length: 41
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:53:27 GMT
Vary: Accept-Encoding

{
  "prefixes": [
    "10.1.1.0/24"
  ]
}